ListBox
HC
GUI programming
ListBoxes
ListBox
ListBox parent name choices onSelect onDClick
(ListBox parent name choices)
(ListBox parent name choices onSelect onDClick style pos size)
outputs a new ListBox and shows it on the parent (a Frame or a Graph, main Graph if []).
name is its label text.
choices is a list of items from whom the user can select one.
onSelect is a Logo instructionlist which will be run when the user selects a choice.
onDCLick is a Logo instructionlist which will be run when the user double-clicks on a choice.
style is the window style and can be a combination of the following constants:
wxLB_SINGLE Single-selection list.
wxLB_MULTIPLE Multiple-selection list: the user can toggle multiple items on and off.
wxLB_EXTENDED Extended-selection list: the user can select multiple items using the SHIFT key and the mouse or special key combinations.
wxLB_HSCROLL Create horizontal scrollbar if contents are too wide (Windows only).
wxLB_ALWAYS_SB Always show a vertical scrollbar.
wxLB_NEEDED_SB Only create a vertical scrollbar if needed.
wxLB_SORT The listbox contents are sorted in alphabetical order.
Note that wxLB_SINGLE, wxLB_MULTIPLE and wxLB_EXTENDED styles are mutually exclusive and you can specify at most one of them (single selection is the default).
pos is the position of the ChoiceBox (a list of two integer numbers, x and y),
size is the size of the ChoiceBox (a list of two integer numbers, width and height).
Example:
lb=(ListBox [][MyListBox]
[ [String 1]
[and a second string]
[a third string]
[and the last string]
]
[ (show "|MyListBox2| ListBoxSelections)
]
[ pr [Doubleclick]
]
wxLB_multiple [0 0][300 200])
|
Examples:
References:
ListBoxEnable(4), ListBoxSelections(3), ListBoxSetChoices(3), ListBoxAppend(2), ListBoxCount(2), ListBoxDestroy(2), ListBoxOnChar(2), ListBoxOnDClick(2), ListBoxOnKeyDown(2), ListBoxOnKeyUp(2), ListBoxOnSelect(2), ListBoxRemoveItem(2), ListBoxSetBackgroundColor(2), ListBoxSetColor(2), ListBoxSetFontName(2), ListBoxSetFontSize(2), ListBoxSetFontStyle(2), ListBoxSetFontWeight(2), ListBoxSetItem(2), ListBoxSetSelections(2), ListBoxes(2), Release Notes for Version 4.685(2), ChoiceBox, ComboBoxes