Specifications
User Interface Controls
1-33
Use the Bring to Front and Send to Back operations in the Layout menu for
this purpose.
List Boxes
List boxes display a list of items and enable users to select one or more items.
The
String property contains the list of strings displayed in the list box. The
first item in the list has an index of 1.
The
Value property contains the index into the list of strings that correspond
to the selected item. If the user selects multiple items, then
Value is a vector of
indices.
By default, the first item in the list is highlighted when the list box is first
displayed. If you do not want any item highlighted, then set the
Value property
to empty,
[].
The
ListboxTop property defines which string in the list displays as the top
most item when the list box is not large enough to display all list entries.
ListboxTop is an index into the array of strings defined by the String property
and must have a value between 1 and the number of strings. Noninteger values
are fixed to the next lowest integer.
Single or Multiple Selection
The values of the Min and Max properties determine whether users can make
single or multiple selections:
•If
Max – Min > 1, then list boxes allow multiple item selection.
•If
Max – Min <= 1, then list boxes do not allow multiple item selection.
Selection Type
Listboxes differentiate between single and double clicks on an item and set the
figure
SelectionType property to normal or open accordingly. See Triggering
Callback Execution for information on how to program multiple selection.
Triggering Callback Execution
MATLAB evaluates the list box’s callback after the mouse button is released or
a keypress event (including arrow keys) that changes the
Value property (i.e.,
any time the user clicks on an item, but not when clicking on the list box