
CHAPTER 4: User-Interface Tools Control objects 139
selection
(ListBox)
Array of
ListItem
For a ListBox, an array of ListItem objects for the current selection in a
multi-selection list. Setting this value causes the selected item to be
highlighted and to be scrolled into view if necessary. If no items are
selected, the value is
null. Set to null to deselect all items.
The value can also change because the user clicked or double-clicked
an item, or because an item was removed with remove()
or
removeAll()
. Whenever the value changes, the onChange callback is
called. If the value is changed by a double click, calls the
onDoubleClick
callback.
You can set the value using the index of an item or an array of indices,
rather than object references. If set to an index value that is out of
range, the operation is ignored. When set with index values, the
property still returns object references.
X If you set the value to an array for a single-selection list, only the
first item in the array is selected.
X If you set the value to a single item for a multi-selection list, that
item is added to the current selection.
selection
(DropDownList,
TreeView)
ListItem For a DropDownList or TreeView list object, the currently selected
ListItem
object.
Setting this value causes the selected item to be highlighted and to
be scrolled into view if necessary. If no item is selected, the value is
null. Set to null to deselect all items.
The value can also change because the user clicked on an item, or
because an item was removed with remove()
or removeAll().
Whenever the value changes, the onChange
callback is called.
You can set the value using the index of an item or an array of indices,
rather than object references. If set to an index value that is out of
range, the operation is ignored. When set with an index value, the
property still returns an object reference.
shortcutKey
String The key sequence that invokes the onShortcutKey callback for this
element (in Windows only).
size
Dimension A Dimension object that defines the actual dimensions of an element.
Initially
undefined, and unless explicitly set by a script, it is defined
by a
LayoutManager.
Although a script can explicitly set size before the layout manager is
invoked to establish an element size other than the
preferredSize
or the default size, this is not recommended.
Defined as
[bounds.width, bounds.height]. Setting an element’s
size changes its bounds property, and vice-versa.
stepdelta
Number The amount by which to increment or decrement a Scrollbar
element’s position when the user clicks a stepper button.
Kommentare zu diesen Handbüchern