listbox class

A widget displaying a list of items
Inherits
object widget
Description
The listbox class is a widget displaying a list of string items.
The listbox can operate in four selection modes: single, multi, extended and none. In the "single" mode only one item can be selected at a time and that item is also the current one. In the "multi" mode multiple items can be selected and unselected and the current item may or may not be one of the selected items. In the "extended" mode multiple items can be selected but they must be selected in a single mouse action or by keeping the shift button pressed while clicking on the item. In this mode the current item is always one of the selected items.
In the "none" mode no items can be selected and the current item may be any item in the list.
In most situations you will operate the listbox in "single" mode (and this is the default mode set at widget creation).
Functions
$setSelectionMode(<selection_mode:string>)
Sets the current selection mode specified by the parameter <mode> that can be one of the following string:
"single" : only one item can be selected at a time
"multi" : multiple items can be selected at a time
"extended" : multiple items can be selected but only in a single mouse interaction
"none" : no items can be selected
The default mode is "single"
<string> $selectionMode()
Returns the current selection mode
$insertItem(<text:string>, <index:uint>)
Inserts a text item at position <index>. If index is negative or not specified the item is appended.
$changeItem(<text:string>, <index:uint>)
Changes text of item at <index> to <text>.
$removeItem(<index:uindex>)
Removes item at given index.
$count()
Returns number of items in the widget.
<string> $currentText()
Returns the text of the currently selected item.
<integer> $currentItem()
Returns index of current item or -1 if no item is current.
$textAt(<index:integer>)
Returns item at given index.
$setCurrentItem(<index:integer>)
Sets the current listbox item.
$clear()
Removes all the items
<boolean> $isSelected(<index:integer>)
Returns 1 if the item at <index> is selected and 0 otherwise
$setSelected(<index:integer>,<bSelected:boolean>)
Changes the selection status of the item at <index> to the value specified by <bSelected>. If <bSelected> is 1 the item is selected, if <bSelected> is 0 the item is unselected.
$selectionChangeEvent()
This function is called by KVIrc when the selection in the listbox changes.
$currentItemChangeEvent()
This function is called by KVIrc when the current item changes.
<index:integer> $onItemEvent()
This function is called by KVIrc when the current item pointed by the mouse changes and gives in $0 the item index.
<array:x,y,width,height> $itemRect(<item:index>)
Returns the rectangle on the screen that item occupies, or an invalid rectangle if item is 0 or is not currently visible.
Signals
<string> $currentItemChange()
This signal is emitted by the default implementation of $currentItemChangeEvent().
<string> $onItem()
This signal is emitted by the default implementation of $onItemEvent().

Index, Object Classes
KVIrc 3.9.99 Documentation
Generated by root at Wed Oct 17 19:34:06 2007