Main Page | Packages | Class Tree | Index | Help

xp.controls

class ListBox

MovieClip
  |
  +--xp.system.UIControl
        |
        +--xp.controls.ScrollSelectView
              |
              +--xp.controls.ScrollSelectList
                    |
                    +--xp.controls.ListBox


class ListBox
extends ScrollSelectList

Allows users to select one or more options from a scrolling list.

The ListBox component is a scrollable single- or multiple-selection list box.
A list can also display graphics, including other components.
You add the items displayed in the list by using the Values dialog box that appears when you click in the listLabels, listIcons or listData parameter fields.
To add items to the list at run time you use methods of its list items source ListBox.itemsSource. You can use the ListItemsSource.addItem() and ListItemsSource.addItemAt() methods to add items to the list. The ListBox component uses a zero-based index, where the item with index 0 is the top item displayed.
When adding, removing, or replacing list items using the ListBox or ListItemsSource class methods and properties, you may need to specify the index of the list item.
You can set the following authoring parameters for each ListBox component instance in the Property inspector or in the Component inspector:
listLabels is an array of text values that populate the label values of the listbox.
The default value is [] (an empty array).
There is no equivalent runtime property.
listIcons is an array of linkageIds that populate the icon values of the listbox.
The default value is [] (an empty array).
There is no equivalent runtime property.
listData is an array of values that populate the data of the list.
The default value is [] (an empty array).
There is no equivalent runtime property.
The list receives focus when you click it or tab to it, and you can then use the following keys to control it:
KeyDescription
Alphanumeric keysJump to the next item that has Key.getAscii() as the first character in its label.
ControlToggle key that allows multiple noncontiguous selections and deselections.
Down ArrowSelection moves down one item.
HomeSelection moves to the top of the list.
Page Down
Page Up
ShiftAllows for contiguous selection.
Up ArrowSelection moves up one item

The listBox supports a Key search or Lookup feature.
When this is enabled items are searched for when keys are pressed.
Search is based on a match between the search expression and the list items display label.
Searching is case insensitive and can be one of the following modes:
none: No key search support
first: Searching is based on a match of the last key pressed and the first letter of the list item display label incremental: Each character of the search expression that you enter causes the list to search for the first occurrence of the string that it has so far been given.
If there is no match the current search expression is cleared

Event summary for the ListBox class
The following table lists events of the ListBox class.




EventTypeDescription
xp.events.EventchangeBroadcast whenever user interaction causes the selection to change.
xp.events.ValueChangedEventvalueChangedBroadcast whenever user interaction causes the selection value to change.
xp.events.ItemRollOverEventitemRollOverBroadcast when the pointer rolls over list items.
xp.events.ItemRollOutEventitemRollOutBroadcast when the pointer rolls over and then off of list items.


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
classInfo: Object
A static class information object

public
displayBindings: Object
A binding definition for the combobox display

public
displayIconFormatFunction: Object
The format function object for the display icon field

public
displayIconFormatter: Object
The formatter object for the display icon field

public
displayIconFormatterOptions: Object
The formatter options object for the display icon field

public
displayIconPath: String
The path or fieldName of the display icon field

public
displayLabelFormatFunction: Object
The format function object for the display label field

public
displayLabelFormatter: Object
The formatter object for the display label field

public
displayLabelFormatterOptions: Object
The formatter options object for the display label field

public
displayLabelPath: String
The path or fieldName of the display label field

public
iconFormatFunction: Object
The format function object for the icon field

public
iconFormatter: Object
The formatter object for the icon field

public
iconPath: String
The path or field of the icon field

public
itemBindings: Object
The DataBinding for the listItems

public
itemStyle: Object
The list item styles

public
labelFormatFunction: Object
The format function object for the label field

public
labelFormatter: Object
The formatter object for the label field

public
labelPath: String
The path or fieldName of the label field


listData: Array
Authoring Parameter - Data for List Items (optional)


listIcons: Array
Authoring Parameter - Icons for List Items (optional)


listLabels: Array
Authoring Parameter - Labels for List Items (optional)

public
rowStyle: Object
The list row styles

public
selectedValueBinding: Object
The DataBinding for the selected item

public
selectedValueFormatFunction: Object
The format function object for the value field

public
selectedValueFormatter: Object
The formatter object for the value field

public
selectedValuePath: String
The data path in the selected Item to the value

public
styleClass: String
The name of the style class this instance will use.

Fields inherited from class xp.controls.ScrollSelectList

classInfo

Fields inherited from class xp.controls.ScrollSelectView

__alternateColor, __backgroundColor, __hGridLineColor, __highlightColor, __selectColor, __selectedValueFormatter, __selectedValuePath, __vGridLineColor, autoSync, body, canEdit, canInsert, classInfo, editable, editorType, editRow, footer, header, hGridLines, hLargeScroll, hscrollbar, hScrollPolicy, hSmallScroll, isSelectionRequired, scrollMode, statusbar, tabStop, textHighlightColor, textSelectColor, titlebar, topIndex, useRollOver, vGridLines, vLargeScroll, vscrollbar, vScrollPolicy, vSmallScroll

Fields inherited from class xp.system.UIControl

__layout, allowDrop, autoLayout, bindingDefaultValue, bindingFormatter, bindingPath, bindingSource, bindingType, bindingValidator, border, causesValidation, classInfo, clickOnENTER, clickOnSPACE, container, context, data, disableAcceptButton, disableCancelButton, enableBGMouseEvents, enableDblClickEvent, enableKeyDownEvents, enableKeyEvents, enableKeyUpEvents, enableMouseWheelEvents, formatterOptions, horizontalAlignment, index, isBinding, itemId, logEnabled, parent, parentContainer, parentForm, percentageHeight, percentageWidth, styleClass, tabIndex, tabStop, tooltip, tree, verticalAlignment

Property Summary

public
dataProvider: Object (read, write)
Gets or set the list items

Properties inherited from class xp.controls.ScrollSelectList

rowCount

Properties inherited from class xp.controls.ScrollSelectView

alternateColor, backgroundColor, contentHeight, contentPixelHeight, contentWidth, hGridLineColor, highlightColor, hPosition, rowAutosize, rowHeight, rowWidth, sbHHeight, sbVWidth, selectColor, selectedIndex, selectedIndices, selectedItem, selectedItems, selectedValue, selectedValueFormatter, selectedValuePath, selectionMode, variableRowHeight, vGridLineColor, viewportHeight, viewportLeft, viewportPixelHeight, viewportTop, viewportWidth, virtualMode, vPosition

Properties inherited from class xp.system.UIControl

alpha, autosize, background, backgroundVisible, bindings, borderBrush, borderRadius, borderShadow, borderStyle, borderThickness, bottom, dataSource, enableMouseEvents, focusManager, height, id, isEnabled, isFocused, isMouseOver, isPressed, isSelected, isValid, layout, left, margin, maxHeight, maxWidth, measuredHeight, measuredMinHeight, measuredMinWidth, measuredWidth, minHeight, minWidth, padding, readOnly, resources, right, styleName, top, triggers, visible, width, x, y

Constructor

public
ListBox ( )
Constructor - This should not be called directly.


Method Summary

public
getClass ( ): Function
Returns a reference to the components static class

public
getItemsArray ( labels: Array, icons: Array, data: Array ): Array
Gets the items array from 3 native type arrays

public
initChildren ( ): Void
Override to create the itemStyle

public static
newInstance ( owner, instanceId, depth, initObj )
Creates a new Instance of this class

public
updateVirtualRows ( start: Number, end: Number, rowCount ): Void
Update the data for the visible rows in the list

Methods inherited from class xp.controls.ScrollSelectList

getClass

Methods inherited from class xp.controls.ScrollSelectView

clearSelected, drawComponent, getClass, getItemAt, getItemIndex, getItemValue, getValueIndex, isSelected, setScrollContentVPos, setSelectedIndices, setSelectedItems

Methods inherited from class xp.system.UIControl

addBinding, addBindings, addEventListener, addPropertyTrigger, applyStyle, beginDeferUpdate, canUpdate, centerContent, checkState, containsFocus, destroy, destroyObject, drawFocus, endDeferUpdate, findFocusFromObject, findFocusInChildren, getBinding, getBounds, getCenter, getClass, getFocus, getFocusManager, getFocusRect, getLocation, getPropertyValue, getSize, getStateName, getTrigger, globalToLocalPoint, invalidate, invalidateLayout, invalidateSize, invalidateSizeAndLayout, invalidChild, isChild, isMouseDirectlyOver, isParent, localToGlobalPoint, localToLocalPoint, measure, mouseWheel, move, onChildFocus, onKillFocus, onSetFocus, processEnterKey, processEscapeKey, processTabKey, redraw, refresh, removeEventListener, routeEvent, setBounds, setFocus, setLocation, setPropertyValue, setSize, setValueChanged, update, validate



Field Documentation

classInfo

public static var classInfo: Object
A static class information object

Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance.

displayBindings

public var displayBindings: Object
A binding definition for the combobox display

displayIconFormatFunction

public var displayIconFormatFunction: Object
The format function object for the display icon field

displayIconFormatter

public var displayIconFormatter: Object
The formatter object for the display icon field

displayIconFormatterOptions

public var displayIconFormatterOptions: Object
The formatter options object for the display icon field

displayIconPath

public var displayIconPath: String
The path or fieldName of the display icon field

displayLabelFormatFunction

public var displayLabelFormatFunction: Object
The format function object for the display label field

displayLabelFormatter

public var displayLabelFormatter: Object
The formatter object for the display label field

displayLabelFormatterOptions

public var displayLabelFormatterOptions: Object
The formatter options object for the display label field

displayLabelPath

public var displayLabelPath: String
The path or fieldName of the display label field

iconFormatFunction

public var iconFormatFunction: Object
The format function object for the icon field

iconFormatter

public var iconFormatter: Object
The formatter object for the icon field

iconPath

public var iconPath: String
The path or field of the icon field

itemBindings

public var itemBindings: Object
The DataBinding for the listItems

itemStyle

public var itemStyle: Object
The list item styles

labelFormatFunction

public var labelFormatFunction: Object
The format function object for the label field

labelFormatter

public var labelFormatter: Object
The formatter object for the label field

labelPath

public var labelPath: String
The path or fieldName of the label field

listData

var listData: Array
Authoring Parameter - Data for List Items (optional)

An array that specifies the data associated with the list items. The default value is [] (an empty array).

listIcons

var listIcons: Array
Authoring Parameter - Icons for List Items (optional)

An array that specifies the linkage identifiers of the library symbols to be used as the icons in the list. The default value is [] (an empty array).

listLabels

var listLabels: Array
Authoring Parameter - Labels for List Items (optional)

An array that specifies the text labels to use in the list. The default value is [] (an empty array).

rowStyle

public var rowStyle: Object
The list row styles

selectedValueBinding

public var selectedValueBinding: Object
The DataBinding for the selected item

selectedValueFormatFunction

public var selectedValueFormatFunction: Object
The format function object for the value field

selectedValueFormatter

public var selectedValueFormatter: Object
The formatter object for the value field

selectedValuePath

public var selectedValuePath: String
The data path in the selected Item to the value

styleClass

public var styleClass: String
The name of the style class this instance will use.


Property Documentation

dataProvider

public dataProvider: Object (read, write)
Gets or set the list items

An array of list items. When this property is set, internally the array is wrapped in a ListDataSource and passed to the itemsSource property


Constructor Documentation

ListBox

public function ListBox()
Constructor - This should not be called directly.

If you want to dynamically create a new instance of a control use its static newInstance method


Method Documentation

getClass

public function getClass(): Function
Returns a reference to the components static class

Overrides:

getItemsArray

public function getItemsArray(labels: Array,
 icons: Array,
 data: Array): Array
Gets the items array from 3 native type arrays

Builds an object array from array of native types (string or number or boolean types)

initChildren

public function initChildren(): Void
Override to create the itemStyle

Overrides:

newInstance

public static function newInstance(owner,
 instanceId,
 depth,
 initObj)
Creates a new Instance of this class

Creates an instance of a component at runtime. You need to use the import statement and specify the class package name before calling this method. In addition, the component must be in the FLA file’s library.

Parameters:
owner
A reference to the movie clip or object that will contains the new Instance.
instanceId
A string indicating the instance name of the new instance.(optional)
depth
A number indicating the depth of the new instance.(optional)
initObj
An object containing initialization properties for the new instance.(optional)
Returns:
A object that is an instance of the specified class.

updateVirtualRows

public function updateVirtualRows(start: Number,
 end: Number,
 rowCount): Void
Update the data for the visible rows in the list

Updates row objects by refreshing their dataSource with data from the itemsSource. It will also adjust the position and visibility of rows as needed. After the rows are updated, it will call the body to update itself and refresh the scrollbars This is called automatically by the system and should not be called manually

Parameters:
start
The index of the first row to update
end
The index of the last row to update
rowCount
The maximum number of rows to display (for use in dropDown mode)

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc