insert_list_item, delete_list_item,
clean_the_list, set_list_icons,
add_list_column, set_list_label
Entity: predicates
Usage:
R is get_list_text(List_Box, Position)
R is get_list_length(List_Box)
R is get_list_selected(List_Box)
insert_list_item(List_Box, Position, Text, Icon)
delete_list_item(List_Box, Position)
clean_the_list(List_Box)
set_list_icons(List_Box, Type, Icon1, Icon2, ...)
add_list_column(List_Box, Where, Label, Wide)
set_list_label(List_Box, Where, Position, Text)
List Box
In all list box functions and predicates you have to specify (in List_Box) which list box have to be used.
Text is get_list_text(List_Box, Position)
Returns the text which is at the position Position.
Number is get_list_length(List_Box)
Returns the number of items which are in List_Box.
Position is get_list_selected(List_Box)
Returns the position of the selected item in List_Box. If there
is not any item selected then this function fails.
insert_list_item(List_Box, Position, Text, Icon)
Inserts item at Position with label Text and icon Icon.
Position has to be an integer number or "end".
The Icon has to be the number of the icon in the list of icons (look at set_list_icons). Of course, the argument Icon will have sense only if you provided a list of icons. If you don't want any icon then you can leave this argument a free variable (_).
delete_list_item(List_Box, Position)
Deletes the item which are on the position Position.
clean_the_list(List_Box)
Deletes all items in the List_Box.
set_list_icons(List_Box, Type, Icon1, Icon2, ...)
Attach to the List_Box a list of icons. The list box needs two
lists of icons to put them at the items (with small and with big size).
Type can be "b" or "s". The first mean that follows a list
of big icons (32X32). The second mean that follows a list of small icons
(16X16). Icon1, Icon2, ... have to be strings containing file names
of ICO files.
After list of icons is attached you can use its icons in predicates like insert_list_item where Icon is the number of icon in this list.
add_list_column(List_Box, Where, Label, Wide)
When the list box is in Report view (which is the default one)
then you can see columns with text. As default you see only one column
which is with the names and icons of the items but using this predicate
you can add more columns. Here Where is the number of the new column
(from left to right). Label is a string with column label. Wide
is integer which gives the wide of the column.
set_list_label(List_Box, Where, Position, Text)
When you have new column (look at add_list_column) then you
will like to put some information in it. For this you need this predicate.
Here Where is the number of the column, Position is the number
of the item in front of which you want the text to be placed and the Text
is a string containing the text.
Look at the example:
List Box.spj (in folder Examples)