
List selection model
The model keeps track of selected lines. It supports different selection modes which may be modified via the ListSelectionModel::setSelectionMode function.
Public Types | |
| typedef ListSelectionListener * | LPtr |
| enum | mode { SINGLE_SELECTION, RANGE_SELECTION, MULTI_RANGE_SELECTION } |
Public Member Functions | |
| void | addListSelectionListener (const LPtr &l) |
| void | clearSelection () |
| deselects all rows | |
| EventDispatcher () | |
| void | fireEvent (ListSelectionEvent &e) const |
| notifies all registered listeners | |
| index | getFirstSelected () const |
| retrieves the first selected index | |
| index | getLastSelected () const |
| retrieves the index of the last selected line | |
| mode | getSelectionMode () const |
| retrieves the current selection mode | |
| bool | isMuted () const |
| reflects this dispatcher's muted state. | |
| bool | isSelected (const index &row) const |
| checks if the given row is selected | |
| bool | isSelectionEmpty () const |
| checks if nothing is selected | |
| ListSelectionModel (mode m=SINGLE_SELECTION) | |
| void | removeListSelectionListener (const LPtr &l) |
| void | setMuted (bool mute) |
| mutes or un-mutes the dispatcher | |
| void | setSelected (index from, index to, bool sel) |
| selects or deselects all rows in [from,to] | |
| void | setSelected (const index &row, bool sel) |
| selects or deselects the given row | |
| void | setSelectionMode (mode m) |
| changes the selection mode | |
Static Public Attributes | |
| static const index | INVALID |
Protected Member Functions | |
| void | add (const LPtr &l) |
| registers a listener | |
| void | remove (const LPtr &l) |
| de-registers a listener. | |
Friends | |
| class | List |
|
|
|
|
|
|
|
|
|
|
|
registers a listener
|
|
|
|
|
|
deselects all rows
|
|
|
|
|
|
notifies all registered listeners
The listeners are called in the order in which they were added.
|
|
|
retrieves the first selected index
|
|
|
retrieves the index of the last selected line
|
|
|
retrieves the current selection mode
|
|
|
reflects this dispatcher's muted state.
|
|
|
checks if the given row is selected
|
|
|
checks if nothing is selected
|
|
|
de-registers a listener.
This listener will no longer notify
|
|
|
|
|
|
mutes or un-mutes the dispatcher Muted dispatchers no longer notify their listeners. |
|
||||||||||||||||
|
selects or deselects all rows in [from,to]
|
|
||||||||||||
|
selects or deselects the given row
|
|
|
changes the selection mode This function deselects any row that may have been selected. |
|
|
|
|
|
|
1.4.3