[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 4.18.5.7 List Box

A list box's type is "List Box".

#### Attributes

Listboxes publish the following attributes.

`Style`

  One of ``lbfsBump'`, ``lbfsSimple'`, ``lbfsSunken'`, ``lbfsRaised'`, ``lbfsNone'` or ``lbfsFlat'`. Determines the style of frame for the component.

`Alpha`

  The alpha of the overlay texture.

`HiAlpha`

  The alpha of the selection bar texture.

`Columns`

  The number of columns in the list control. For every column the following properties are present (X denotes the current column number):

`DefaultSortCol`

  List rows are sorted based on the content of this column.

`Background`

  Texture to use as background.

`Highlight`

  Texture to use for the selection bar.

#### Skin Attributes

Listboxes support the following skin attributes.

`OverlayTextureAlpha`

  The alpha value of the overlay texture.

`Texture`

  Used for overlaying the frame area with the global texture.

`TreeCollapsed`

  Used to depict the item as collapsed (if it has any children)

`TreeExpanded`

  Used to depict the item as expanded (if it has any children)

`TreeVertLine`

  Used to connect to items on the same tree level.

`TreeHorzLine`

  Used to connect to and item with its parent.

`TreeChkUnmarked`

  Stateful entries can be marked/unmarked. This is used to draw the unmarked case.

`TreeChkMarked`

  Stateful entries can be marked/unmarked. This is used to draw the marked case.

`TreeGrpUnmarked`

  Grouped entries are either marked or unmarked. This is used to draw the unmarked case.

`TreeGrpMarked`

  Grouped entries are either marked or unmarked. This is used to draw the marked case.

#### Signals

List boxes send the following signals.

`signalListBoxSelectionChanged`

  Occurs when the currently selected item changes.

`signalListBoxStateChanged`

  Occurs when the state of a stateful column changes.

`signalListBoxFocused`

  Occurs when the list box gains focus.

`signalListBoxScrolled`

  Occurs when the scroll bar at the side of the list box is used.

#### Actions

List boxes understand the following actions.

`InsertItem`

  Inserts a new item. See below for parameters. Note that an item does not need to have text or image or state, but it should have one of the above.

#### Input Parameters

This sections describes the input parameters understood by the list box's ``InsertItem'` action.

Name | Type | Description
`textX` | `iString*` | Text for the item in column X.
`imageX` | `iString*` | Pathname of the image in column X.
`statefulX` | `bool` | ``true'` if the item in column X needs a state box (like a check box or radio button).
`stateX` | `bool` | State of the item in column X.
`groupstateX` | `bool` | If ``true'`, the item in column X will have a radio button-type state box instead of the default check box-style state.
`aligntxtX` | `int` | Alignment of the text in column X. By default, all text is left-aligned. This can be 0 or 1. Zero is left-align; 1 is right-align. If there is state, it will be aligned with the text.
`alignimgX` | `int` | This is the same as ``aligntxtX'`, except that it operates on the image.
`paramX` | `int` | An optional parameter you can attach to an item in the row.
`selectable` | `bool` | If ``false'`, then the item is not selectable and will never be highlighted. This is useful for items that have state of some sort and aren't intended to be "picked" out of a list.
`parent` | `int` | Key that identifies the parent of which this item should be a child. This will turn the new item into a child item.

#### Output Parameters

This sections describes the output parameters of the list box's ``InsertItem'` action.

Name | Type | Description
``id'` | ``int'` | Unique key of this item. This can be saved and used as the value of a parent when adding children to an item, or it may be saved and used with the ``GetState'` action.

`DeleteItem`

  Deletes a row from the listbox.

#### Input Parameters

This sections describes the input parameters understood by the list box's ``DeleteItem'` action.

Name | Type | Description
`text` | `iString*` | This string is looked up is the listbox' sorting column. If it is found the corresponding row is deleted.
`id` | `iString*` | This string is looked up is the listbox' sorting column. If it is found the corresponding row is deleted.

#### Output Parameters

This sections describes the output parameters of the list box's ``DeleteItem'` action.

Name | Type | Description
``result'` | ``int'` | The row number of the deleted row. If deletion failed -1 is returned.

`GetSelectedItem`

  Returns the text, state and param values of the selected item if there is one.

#### Input Parameters

This sections describes the input parameters understood by the ``GetSelectedItem'` action of the list box.

Name | Type | Description
`textX` | `iString*` | Requests the text for the item in column X.
`stateX` | `bool` | Requests the state of the item in column X.
`paramX` | `int` | Requests the param value of the item in column X.

#### Output Parameters

This sections describes the output parameters of the list box's ``GetSelectedItem'` action.

Name | Type | Description
`textX` | `iString*` | Contains the text for the item in column X if it was requested.
`stateX` | `bool` | Contains the state of the item in column X if it was requested.
`paramX` | `int` | Contains the param value of the item in column X if it was requested.
``success'` | ``bool'` | Is true, if there is data returned. False if not (e.g. no item was selected)

`GetItem`

  Returns the text, state and param values of a specific row.

#### Input Parameters

This sections describes the input parameters understood by the list box's ``GetItem'` action.

Name | Type | Description
`row` | `int` | Specifies the row number of the item we are interested in.
`textX` | `iString*` | Requests the text for the item in column X.
`stateX` | `bool` | Requests the state of the item in column X.
`paramX` | `int` | Requests the param value of the item in column X.

#### Output Parameters

This sections describes the output parameters of the list box's ``GetItem'` action.

Name | Type | Description
`textX` | `iString*` | Contains the text for the item in column X if it was requested.
`stateX` | `bool` | Contains the state of the item in column X if it was requested.
`paramX` | `int` | Contains the param value of the item in column X if it was requested.
`success` | `bool` | Is true, if there is data returned. False if not (e.g. the row does not exist)

`ClearList`

  Deletes all entries from the list.

#### Input Parameters

None.

#### Output Parameters

None.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.