GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
NCURSES_LIST
+
Point of view
ANY
ANY
INTERNALS_HANDLER
TYPED_INTERNALS
NCURSES_WIDGET
All features
class NCURSES_LIST [E_]
Summary
top
This class adds a list selection widget.
Direct parents
Inherit list:
NCURSES_WIDGET
,
TRAVERSABLE
Overview
top
Creation features
make
(p:
NCURSES_WIDGET
, x:
INTEGER_32
, y:
INTEGER_32
, w:
INTEGER_32
, h:
INTEGER_32
)
Exported features
left
:
INTEGER_32
top
:
INTEGER_32
width
:
INTEGER_32
height
:
INTEGER_32
refresh_later
add_first
(string:
STRING
, elt: E_)
add_last
(string:
STRING
, elt: E_)
add
(string:
STRING
, elt: E_, index:
INTEGER_32
)
put
(string:
STRING
, elt: E_, index:
INTEGER_32
)
select_item
(index:
INTEGER_32
)
deselect_item
(index:
INTEGER_32
)
is_selected
(index:
INTEGER_32
):
BOOLEAN
is_multiple_selection_allowed
:
BOOLEAN
allow_multiple_selection
(b:
BOOLEAN
)
get_selection
: HASHED_DICTIONARY[E_,
INTEGER_32
]
set_focus_on
(index:
INTEGER_32
)
focused
:
INTEGER_32
The
TRAVERSABLE
ability:
count
:
INTEGER_32
Number of available items in the hoard.
lower
:
INTEGER_32
Minimum index.
upper
:
INTEGER_32
Maximum index.
is_empty
:
BOOLEAN
Is the hoard empty ?
See also
count
.
item
(i:
INTEGER_32
): E_
Item at the corresponding index
i
.
first
: E_
The very
first
item.
last
: E_
The
last
item.
new_iterator
: ITERATOR[E_]
redraw_later
redraw_now
hidden
:
BOOLEAN
show
hide
is_children_drawing_disable
:
BOOLEAN
draw_children
(b:
BOOLEAN
)
set_foreground_color
(color:
INTEGER_32
)
set_background_color
(color:
INTEGER_32
)
set_colors
(foreground:
INTEGER_32
, background:
INTEGER_32
)
get_foreground_color
:
INTEGER_32
get_background_color
:
INTEGER_32
ncurses
:
NCURSES
Access to the
ncurses
singleton.
invisible_cursor_mode
:
INTEGER_32
In this mode the cursor is invisible.
default_visible_cursor_mode
:
INTEGER_32
The default visible cursor mode.
special_visible_cursor_mode
:
INTEGER_32
In this mode cursor may blink in a more special or in a more visible way.
valid_cursor_visibility
(code:
INTEGER_32
):
BOOLEAN
Check that code is one of
invisible_cursor_mode
,
default_visible_cursor_mode
or
special_visible_cursor_mode
.
enumerate
: ENUMERATE[E_]
Other features:
get_new_iterator
: ITERATOR[E_]
Agent-based features:
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
Apply
action
to every item of
Current
.
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Do all items satisfy
test
?
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Does at least one item satisfy
test
?
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
Aggregate all the elements starting from the initial value.
Printing:
out_in_tagged_out_memory
Append terse printable representation of current object in
tagged_out_memory
.
generation
:
INTEGER_32
Agent-based features:
do_all
(action:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]])
Apply
action
to every item of
Current
.
Indexing:
valid_index
(i:
INTEGER_32
):
BOOLEAN
True when
i
is valid (i.e., inside actual bounds).
left
:
INTEGER_32
writable attribute
top
require
ncurses.is_enabled
top
:
INTEGER_32
writable attribute
top
require
ncurses.is_enabled
width
:
INTEGER_32
writable attribute
top
require
ncurses.is_enabled
height
:
INTEGER_32
writable attribute
top
require
ncurses.is_enabled
refresh_later
effective procedure
top
add_first
(string:
STRING
, elt: E_)
effective procedure
top
require
string /= Void
add_last
(string:
STRING
, elt: E_)
effective procedure
top
require
string /= Void
add
(string:
STRING
, elt: E_, index:
INTEGER_32
)
effective procedure
top
require
string /= Void
put
(string:
STRING
, elt: E_, index:
INTEGER_32
)
effective procedure
top
require
string /= Void
select_item
(index:
INTEGER_32
)
effective procedure
top
deselect_item
(index:
INTEGER_32
)
effective procedure
top
is_selected
(index:
INTEGER_32
):
BOOLEAN
effective function
top
is_multiple_selection_allowed
:
BOOLEAN
writable attribute
top
allow_multiple_selection
(b:
BOOLEAN
)
effective procedure
top
get_selection
: HASHED_DICTIONARY[E_,
INTEGER_32
]
effective function
top
set_focus_on
(index:
INTEGER_32
)
effective procedure
top
ensure
focused
= index
focused
:
INTEGER_32
writable attribute
top
count
:
INTEGER_32
effective function
top
Number of available items in the hoard.
See also
is_empty
ensure
Result >= 0
lower
:
INTEGER_32
effective function
top
Minimum index.
See also
upper
,
valid_index
,
item
.
upper
:
INTEGER_32
effective function
top
Maximum index.
See also
lower
,
valid_index
,
item
.
is_empty
:
BOOLEAN
effective function
top
Is the hoard empty ?
See also
count
.
ensure
definition:
Result = count = 0
item
(i:
INTEGER_32
): E_
effective function
top
Item at the corresponding index
i
.
See also
lower
,
upper
,
valid_index
.
require
valid_index(i)
first
: E_
effective function
top
The very
first
item.
See also
last
,
item
.
require
not is_empty
ensure
definition:
Result = item(lower)
last
: E_
effective function
top
The
last
item.
See also
first
,
item
.
require
not is_empty
ensure
definition:
Result = item(upper)
new_iterator
: ITERATOR[E_]
effective function
top
ensure
Result /= Void
Result.generation = generation
redraw_later
effective procedure
top
redraw_now
effective procedure
top
hidden
:
BOOLEAN
writable attribute
top
show
effective procedure
top
hide
effective procedure
top
is_children_drawing_disable
:
BOOLEAN
writable attribute
top
draw_children
(b:
BOOLEAN
)
effective procedure
top
set_foreground_color
(color:
INTEGER_32
)
effective procedure
top
set_background_color
(color:
INTEGER_32
)
effective procedure
top
set_colors
(foreground:
INTEGER_32
, background:
INTEGER_32
)
effective procedure
top
get_foreground_color
:
INTEGER_32
effective function
top
get_background_color
:
INTEGER_32
effective function
top
ncurses
:
NCURSES
once function
top
Access to the
ncurses
singleton.
invisible_cursor_mode
:
INTEGER_32
is 0
constant attribute
top
In this mode the cursor is invisible.
default_visible_cursor_mode
:
INTEGER_32
is 1
constant attribute
top
The default visible cursor mode.
special_visible_cursor_mode
:
INTEGER_32
is 2
constant attribute
top
In this mode cursor may blink in a more special or in a more visible way.
valid_cursor_visibility
(code:
INTEGER_32
):
BOOLEAN
effective function
top
Check that code is one of
invisible_cursor_mode
,
default_visible_cursor_mode
or
special_visible_cursor_mode
.
ensure
Result = code.in_range(
invisible_cursor_mode
,
special_visible_cursor_mode
)
enumerate
: ENUMERATE[E_]
effective function
top
get_new_iterator
: ITERATOR[E_]
frozen
effective function
top
This feature is obsolete:
Please use new_iterator instead. This SmartEiffel historic feature is badly named.
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
effective procedure
top
Apply
action
to every item of
Current
.
See also
for_all
,
exists
,
aggregate
.
require
action /= Void
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
effective function
top
Do all items satisfy
test
?
See also
for_each
,
exists
,
aggregate
.
require
test /= Void
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
effective function
top
Does at least one item satisfy
test
?
See also
for_each
,
for_all
,
aggregate
.
require
test /= Void
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
top
Aggregate all the elements starting from the initial value.
See also
for_each
,
for_all
,
exists
.
require
action /= Void
out_in_tagged_out_memory
effective procedure
top
Append terse printable representation of current object in
tagged_out_memory
.
generation
:
INTEGER_32
writable attribute
top
do_all
(action:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]])
frozen
effective procedure
top
Apply
action
to every item of
Current
.
This feature is obsolete:
This feature is not secure because it accepts a FUNCTION, the result of which is lost. Plese use `for_each` instead.
valid_index
(i:
INTEGER_32
):
BOOLEAN
effective function
top
True when
i
is valid (i.e., inside actual bounds).
See also
lower
,
upper
,
item
.
ensure
definition:
Result =
lower
<= i and i <=
upper