Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::gui::ListSelectionModel Class Reference

Inheritance diagram for ONE::gui::ListSelectionModel:

Inheritance graph
[legend]
List of all members.

Detailed Description

List selection model

The model keeps track of selected lines. It supports different selection modes which may be modified via the ListSelectionModel::setSelectionMode function.

Author:
Daniel Seibert


Public Types

typedef ListSelectionListenerLPtr
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


Member Typedef Documentation

typedef ListSelectionListener * ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::LPtr [inherited]
 


Member Enumeration Documentation

enum ONE::gui::ListSelectionModel::mode
 

Enumerator:
SINGLE_SELECTION  allows selection of one row
RANGE_SELECTION  allows selection of one block of lines
MULTI_RANGE_SELECTION  allows free selection


Constructor & Destructor Documentation

ONE::gui::ListSelectionModel::ListSelectionModel mode  m = SINGLE_SELECTION  ) 
 


Member Function Documentation

void ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::add const LPtr l  )  [protected, inherited]
 

registers a listener

Parameters:
l a listener

void ONE::gui::ListSelectionDispatcher::addListSelectionListener const LPtr l  )  [inline, inherited]
 

void ONE::gui::ListSelectionModel::clearSelection  ) 
 

deselects all rows

ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::EventDispatcher  )  [inherited]
 

void ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::fireEvent ListSelectionEvent &  e  )  const [inherited]
 

notifies all registered listeners

The listeners are called in the order in which they were added.
This function is provided primarily for use by subclasses. However, it may also be called from the outside in order to inject events into the system. Note that great care should be taken when doing so. For example, listeners generally rely on the event's source being identical to the instance that passes them around, i.e. this event dispatcher.

Parameters:
e the event to forward to each listener

index ONE::gui::ListSelectionModel::getFirstSelected  )  const
 

retrieves the first selected index

Returns:
the first index that was selected or INVALID if nothing is selected

index ONE::gui::ListSelectionModel::getLastSelected  )  const
 

retrieves the index of the last selected line

Returns:
the last selected index or INVALID if nothing is selected

mode ONE::gui::ListSelectionModel::getSelectionMode  )  const
 

retrieves the current selection mode

bool ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::isMuted  )  const [inherited]
 

reflects this dispatcher's muted state.

Returns:
true if the dispatcher is muted, false otherwise

bool ONE::gui::ListSelectionModel::isSelected const index &  row  )  const
 

checks if the given row is selected

bool ONE::gui::ListSelectionModel::isSelectionEmpty  )  const
 

checks if nothing is selected

void ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::remove const LPtr l  )  [protected, inherited]
 

de-registers a listener.

This listener will no longer notify l of events, unless l is registered more than once. If so, a call to this function will only remove the first occurence of l.

Parameters:
l a listener

void ONE::gui::ListSelectionDispatcher::removeListSelectionListener const LPtr l  )  [inline, inherited]
 

void ONE::util::EventDispatcher< ListSelectionEvent , ListSelectionListener , struct ListSelectionRelay >::setMuted bool  mute  )  [inherited]
 

mutes or un-mutes the dispatcher

Muted dispatchers no longer notify their listeners.

void ONE::gui::ListSelectionModel::setSelected index  from,
index  to,
bool  sel
 

selects or deselects all rows in [from,to]

void ONE::gui::ListSelectionModel::setSelected const index &  row,
bool  sel
 

selects or deselects the given row

void ONE::gui::ListSelectionModel::setSelectionMode mode  m  ) 
 

changes the selection mode

This function deselects any row that may have been selected.


Friends And Related Function Documentation

friend class List [friend]
 


Member Data Documentation

const index ONE::gui::ListSelectionModel::INVALID [static]
 


Generated on Wed Sep 7 19:03:18 2005 for ONEngine by  doxygen 1.4.3