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

ONE::gui::SliderModel Class Reference

Inheritance diagram for ONE::gui::SliderModel:

Inheritance graph
[legend]
List of all members.

Detailed Description

data model for ScrollBar s and other sliders

The model has a minimum and a maximum value as well as a percentual position that ranges between 0.0 and 1.0. All functions that modify the model notify registered listeners of the change.

Author:
Daniel Seibert


Public Types

typedef Lst * LPtr

Public Member Functions

void addSliderModelListener (const LPtr &l)
void fireEvent (Evt &e) const
 notifies all registered listeners
const int & getMaximum () const
const int & getMinimum () const
const floatgetValue () const
bool isMuted () const
 reflects this dispatcher's muted state.
void removeSliderModelListener (const LPtr &l)
void setMaximum (int m)
void setMinimum (int m)
void setMuted (bool mute)
 mutes or un-mutes the dispatcher
void setValue (float v, bool b=false)
 SliderModel (int mi=-1, int ma=-1, float v=0.0f)

Protected Member Functions

void add (const LPtr &l)
 registers a listener
void remove (const LPtr &l)
 de-registers a listener.


Member Typedef Documentation

template<class Evt, class Lst, class Rly>
typedef Lst* ONE::util::EventDispatcher< Evt, Lst, Rly >::LPtr [inherited]
 


Constructor & Destructor Documentation

ONE::gui::SliderModel::SliderModel int  mi = -1,
int  ma = -1,
float  v = 0.0f
 


Member Function Documentation

template<class Evt, class Lst, class Rly>
void ONE::util::EventDispatcher< Evt, Lst, Rly >::add const LPtr l  )  [inline, protected, inherited]
 

registers a listener

Parameters:
l a listener

void ONE::gui::SliderModelDispatcher::addSliderModelListener const LPtr l  )  [inline, inherited]
 

template<class Evt, class Lst, class Rly>
void ONE::util::EventDispatcher< Evt, Lst, Rly >::fireEvent Evt &  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

const int& ONE::gui::SliderModel::getMaximum  )  const
 

const int& ONE::gui::SliderModel::getMinimum  )  const
 

const float& ONE::gui::SliderModel::getValue  )  const
 

template<class Evt, class Lst, class Rly>
bool ONE::util::EventDispatcher< Evt, Lst, Rly >::isMuted  )  const [inline, inherited]
 

reflects this dispatcher's muted state.

Returns:
true if the dispatcher is muted, false otherwise

template<class Evt, class Lst, class Rly>
void ONE::util::EventDispatcher< Evt, Lst, Rly >::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::SliderModelDispatcher::removeSliderModelListener const LPtr l  )  [inline, inherited]
 

void ONE::gui::SliderModel::setMaximum int  m  ) 
 

void ONE::gui::SliderModel::setMinimum int  m  ) 
 

template<class Evt, class Lst, class Rly>
void ONE::util::EventDispatcher< Evt, Lst, Rly >::setMuted bool  mute  )  [inline, inherited]
 

mutes or un-mutes the dispatcher

Muted dispatchers no longer notify their listeners.

void ONE::gui::SliderModel::setValue float  v,
bool  b = false
 


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