## MQWidget.TreeListBox class

A tree list box class.

Super classes: MQWidget.WidgetBase

### Property

get | set | Type | Name | Description
--- | --- | --- | --- | ---
x | x | int | currentID | a current ID
x | x | int | visibleRow | a number of visible rows
x | x | float | lineHeightRate | a rate of a line height
x | x | bool | horzScrollVisible | a visibility of a horizontal scroll bar
x | x | bool | vertScrollVisible | a visibility of a vertical scroll bar
x | x | bool | multiSelect | multiple selection

### Method

Member | Description
--- | ---
ListBox | Constructor.
addItem | Add an item.
deleteItem | Delete an item.
clearItems | Delete all items.
reparentItem | Change an item' parent.
getItemCount | Get a number of items.
getItemIDByIndex | Get an item' ID by the index.
getItemParent | Get a parent item.
getItemChildren | Get child items.
getItem | Get an item.
setItem | Set an item.
getItemTag | Get an item tag.
setItemTag | Set a tag of an item.
getItemSelected | Get a selection status of an item.
setItemSelected | Set a selection status of an item.
getItemHint | Get a hint string of an item.
setItemHint | Set a selection status of an item.
getItemCollapsed | Get a collapsed status of an item.
setItemCollapsed | Set a collapsed status of an item.
clearSelection | Deselect all items.
makeItemVisible | Adjust a position of a scroll bar to display the specified item.
addChangedEvent | Add an event when a current index has been changed.

ListBox([parent])
Constructor.
  Parameters:
  MQWidget.WidgetBase | parent | - | A parent widget

addItem(text)
Add an item.
  Parameters:
  string | text | - | an item text
  Return value:
  int | - | an ID of the added item

deleteItem(id)
Delete an item.
  Parameters:
  int | id | - | an item's ID

clearItems
Delete all items.

reparentItem(id, new_parent_id)
Change an item' parent.
  Parameters:
  int | id | - | an item's ID
  int | new_parent_id | - | a new parent item's ID

getItemCount
Get a number of items.
  Return value:
  int | - | a number of items

getItemIDByIndex(id)
Get an item' ID by the index.
  Parameters:
  int | id | - | an index of an item
  Return value:
  int | - | an item's ID

getItemParent(id)
Get a parent item.
  Parameters:
  int | id | - | a child item's ID
  Return value:
  int | - | a parent item's ID

getItemChildren(id)
Get child items.
  Parameters:
  int | id | - | an item's ID
  Return value:
  list<int> | - | child items' ID

getItem(id)
Get an item.
  Parameters:
  int | id | - | an item's ID
  Return value:
  string | - | a text of the item

setItem(id, text)
Set an item.
  Parameters:
  int | id | - | an item's ID
  string | text | - | a text of the item

getItemTag(id)
Get an item tag.
  Parameters:
  int | id | - | an item's ID
  Return value:
  int | - | a tag of the item

setItemTag(id, tag)
Set a tag of an item.
  Parameters:
  int | id | - | an item's ID
  int | tag | - | a tag of the item

getItemSelected(id)
Get a selection status of an item.
  Parameters:
  int | id | - | an item's ID
  Return value:
  bool | - | a selection status of the item

setItemSelected(id, select)
Set a selection status of an item.
  Parameters:
  int | id | - | an item's ID
  bool | select | - | a selection status of an item

getItemHint(id)
Get a hint string of an item.
  Parameters:
  int | id | - | an item's ID
  Return value:
  string | - | a hint string

setItemHint(id, hint)
Set a selection status of an item.
  Parameters:
  int | id | - | an item's ID
  string | hint | - | a hint string

getItemCollapsed(id)
Get a collapsed status of an item.
  Parameters:
  int | id | - | an item's ID
  Return value:
  bool | - | a collapsed status of the item

setItemCollapsed(id, select)
Set a collapsed status of an item.
  Parameters:
  int | id | - | an item's ID
  bool | select | - | a collapsed status of an item

clearSelection
Deselect all items.

makeItemVisible(id)
Adjust a position of a scroll bar to display the specified item.
  Parameters:
  int | id | - | an item's ID

addChangedEvent(callback)
Add an event when a current index has been changed.
  Parameters:
  function(sender) | callback | - | callback function