listview class

# listview class A listview class
Inherits
widget
Description
It can display and control a hierarchy of multi-column items, and provides the ability to add new items at any time. The items are added by creating children listviewitem objects: simply allocating them with $new will add the items to the listview and simply deleting them will remove them. Allocating a listviewitem item2 as a child of item1 will insert it to the same listview creating a subtree of items spannig from item1. The subtree can be opened or closed by a simple click either on the parent item or on the little plus sign on the side of it (when $setrootisdecorated is set to $true. The listview can be in Single, Multi, Extended or NoSelection selection mode. In single selection mode there can be only one selected item at a time and the selected item is also the current item (this mode is the default). In Multi and Extended selection mode there can be multiple selected items and the current item is one of them. The difference between Multi and Extended is in the way that items can be selected by the mouse actions: experiment with the two modes :). The NoSelection mode has obviously no selection at all.
Functions
`$addColumn(<text_label:string> <width:unsigned integer>)`
Adds a width pixels wide column with the column header label to the list view.
`$setSorting(<column:integer>,<bAscending:boolean>)`
Sets the list view to be sorted by column column in ascending order if ascending is 1 or descending order if it is FALSE. If column is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers
`$hideListViewHeader()`
Hide the listview column header.
`$showListViewHeader()`
Show the listview column header.
`<boolean> $isListViewHeaderVisible()`
Returns '1' if the listview header is currently visible. Otherwise this function returns '0'.
`$setAllColumnsShowFocus(<bAllColumnsShowFocus:boolean>)`
When the argument is $true, causes the listview to display the focus and selection by highlighting all the columns of the item. When the argument is $false then only the first column is selected/highlighted.
`$setSelectionMode(<mode:string>)`
Sets the selection mode for this listview. <mode> can be one of "Single","NoSelection","Multi" or "Extended".
`<listviewitem> $selectedItem()`
Returns the currently selected listviewitem or $null if no items are selected. This function works only if the list view is in single selection mode.
`<listviewitem> $currentItem()`
Returns the current listviewitem or $null if no item is current at the moment.
`<listviewitem> $firstChild()`
Returns the first child listviewitem of this listview or $null if there are no items at all.
`$clickEvent(<item:object>)`
This function is called when the user clicks in the list view. In its argument the listviewitem object clicked or 0 if the user didn't click on an item. The default implementation emits the $clicked() signal.
`$selectionChangedEvent(<item:object>)`
This event handle whenever the set of selected items has changed. The argument is the newly selected item if the listview is in single selection mode. When the listview is in Multi or Extended selection mode then item is always $null. The default implementation emits the $selectionChanged() signal.
`$currentChangedEvent(<item:object>)`
This event are called whenever the current item has changed. In its argument is the newly selected item or 0 if the change made no item current. The default implementation emits the $currentChanged() signal.
`$returnPressedEvent(<item:object>)`
This function is called by the framework when the enter key is pressed. In its arument the currrent item. The default implementation emits the $returnPressed() signal.
`$spacePressedEvent(<item:object>)`
This function is called by the framework when the space key is pressed. In its arument the currrent item. The default implementation emits the $spacePressed() signal.
`$onItemEvent(<item:object)`
This event is called by framwork when the user moves the mouse cursor onto item. The default implementation emits the $onItem() signal.
`$itemExpandedEvent(<item:object>)`
This event is called when an item has been expanded, i.e. when the children of item are shown. The default implementation emits the $expanded() signal.
`$itemCollapsedEvent(<item:object>)`
This event is called when an item has been collapsed, i.e. when the children of item are hidden. The default implementation emits the $collapsed() signal.
`$itemRenamedEvent(<item:object>,<col:integer>,<text:string>)`
This event is called when the item has been renamed in text, e.g. by in in-place renaming, in column col. The default implementation emits the $itemRenamed() signal.
`$rightButtonClickEvent(<item:object>,<x:integer>,>y:integer>)`
This signal is emitted when the right button is clicked. The arguments are the relevant item (may be 0), the point in global coordinates and the relevant column (or -1 if the click was outside the list). The default implementation emits the $rightButtonClicked() signal.
Signals
`$clicked()`
This signal is emitted by the default implementation of $clickEvent().
`$selectionChanged()`
This signal is emitted by the default implementation of $selectionChangedEvent().
`$currentChanged()`
This signal is emitted by the default implementation of $currentChangedEvent().
`$returnPressed()`
This signal is emitted by the default implementation of $returnPressedEvent().
`$spacePressed()`
This signal is emitted by the default implementation of $spacePredssedEvent().
`$onItem()`
This signal is emitted by the default implementation of $onItemEvent().
`$itemExpanded()`
This signal is emitted by the default implementation of $itemExpandedEvent().
`$itemCollapsed()`
This signal is emitted by the default implementation of $itemCollapsedEvent().
`$itemRenamed()`
This signal is emitted by the default implementation of $itemRenamedEvent().
`$rightButtonClicked()`
This signal is emitted by the default implementation of $rightButtonClickedEvent().

Index, Object Classes

KVIrc 3.4.0 Documentation
Generated by loris at Mon Mar 17 20:35:38 2008