listbox class

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 listwidget 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"
`$setFlag(<idx:integer>,<flag1:string>, <flag2:string>, ...)`
Sets the flags for the item at index idx to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item. Supported flags are:
- noitemflag : no flag sets; - selectable : item is selectable; - editable : item is editable; - dragEnabled : item can dragged; - dropEnabled : item can used as drop target; - userCheckable : item is checkable; - enabled : item is enabled; - tristate : item is checkable with three separate states.
`$setChecked(<checkstate:bool>)`
Sets the eventual item check box 'checked state' to <bool>.
`<bool> $isChecked()`
Returns '1' if the eventual item check box is checked, '0' otherwise.
`<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:iIndex>)`
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
`$setFont(<idx:integer>,<family:string>,<size:integer>[,<style1:string>, <style2:string>, ...])`
Set the font's family, size and style, at index <idx>; valid flag for style are: italic, bold, underline, overline, strikeout, fixedpitch If you just want to set a style without altering the preset font size and family, you can use $setFont() like this: %widget->$setFont(0,0,"bold")
`<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.
`$itemEnteredEvent()`
This function is called by KVIrc when the mouse cursor enters an item.
`$selectionChangedEvent()`
This function is called by KVIrc when the selection in the listbox changes.
`$currentItemChangedEvent()`
This function is called by KVIrc when the current item changes.
`$itemChangedEvent()`
This function is called by KVIrc when the current data item changes (i.e. the user check a checkable item) .
Signals
`<string> $currentItemChanged()`
This signal is emitted by the default implementation of $currentItemChangedEvent().
`<string> $itemChanged()`
This signal is emitted by the default implementation of $itemChangedEvent().
`<string> $itemEntered()`
This signal is emitted by the default implementation of $itemEnteredEvent().
`<string> $selectionChanged()`
This signal is emitted by the default implementation of $selectionChangedEvent().

Index, Object Classes