Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

ValueEditControl< T > Class Template Reference

#include <ValueEditControl.h>

Inheritance diagram for ValueEditControl< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class ValueEditControl< T >

allows real-time modification of a value through a pointer

Todo:
needs some work to really be useful again

Definition at line 16 of file ValueEditControl.h.

Public Member Functions

 ValueEditControl (const std::string &n, T *t)
 constructor

 ValueEditControl (const std::string &n, const std::string &p, T *t)
 constructor

 ValueEditControl (const std::string &n, const std::string &d, const std::string &p, T *t)
 constructor

 ValueEditControl (const ValueEditControl< T > &vec)
 copy constructor

ValueEditControl operator= (const ValueEditControl< T > &vec)
 assignment operator

virtual ~ValueEditControl ()
 destructor

virtual ControlBaseactivate (MotionManager::MC_ID display, Socket *gui)
 reads in current value from target

virtual void processEvent (const EventBase &e)
 will increment/decrement the current and then assign it to the target when head buttons pressed

virtual void pause ()
 request to continue receiving events so we can modify the value while running

virtual ControlBasedoSelect ()
 if the value of the target!=cur, assigns the current value to the target and all the copies

virtual ControlBasedoNextItem ()
 adds one to the current value

virtual ControlBasedoPrevItem ()
 subtracts one from the current value

virtual ControlBasetakeInput (const std::string &str)
 called when the user has supplied a text string (may not have been prompted by doReadStdIn()!)

virtual std::string getName () const
 shows current value

Target
accessors for the target pointer

virtual T * getTarget () const
 returns the target pointer

virtual ValueEditControlsetTarget (T *t)
 sets the target pointer - the object pointed to will be overwritten on activate()
Returns:
*this


Copies
accessors for the copies vector, so you can assign the same value to several places if you need to

virtual std::vector< T * > & getCopies ()
 returns a reference to the vector copies

virtual ValueEditControladdCopy (T *t)
 #copies.push_back(t)


Protected Attributes

T * target
 the main target

cur
 the value to use when set

std::vector< T * > copies
 additional targets


Constructor & Destructor Documentation

template<class T>
ValueEditControl< T >::ValueEditControl const std::string &  n,
T *  t
[inline]
 

constructor

Definition at line 19 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, and ValueEditControl< T >::target.

template<class T>
ValueEditControl< T >::ValueEditControl const std::string &  n,
const std::string &  p,
T *  t
[inline]
 

constructor

Definition at line 21 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, and ValueEditControl< T >::target.

template<class T>
ValueEditControl< T >::ValueEditControl const std::string &  n,
const std::string &  d,
const std::string &  p,
T *  t
[inline]
 

constructor

Definition at line 23 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, and ValueEditControl< T >::target.

template<class T>
ValueEditControl< T >::ValueEditControl const ValueEditControl< T > &  vec  )  [inline]
 

copy constructor

Definition at line 25 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, and ValueEditControl< T >::target.

template<class T>
virtual ValueEditControl< T >::~ValueEditControl  )  [inline, virtual]
 

destructor

Definition at line 29 of file ValueEditControl.h.


Member Function Documentation

template<class T>
virtual ControlBase* ValueEditControl< T >::activate MotionManager::MC_ID  display,
Socket gui
[inline, virtual]
 

reads in current value from target

Reimplemented from StringInputControl.

Definition at line 32 of file ValueEditControl.h.

References StringInputControl::activate(), ValueEditControl< T >::cur, erouter, EventRouter::forgetListener(), and ValueEditControl< T >::target.

template<class T>
virtual ValueEditControl& ValueEditControl< T >::addCopy T *  t  )  [inline, virtual]
 

#copies.push_back(t)

Definition at line 105 of file ValueEditControl.h.

References ValueEditControl< T >::copies.

template<class T>
virtual ControlBase* ValueEditControl< T >::doNextItem  )  [inline, virtual]
 

adds one to the current value

Reimplemented from ControlBase.

Definition at line 79 of file ValueEditControl.h.

References ValueEditControl< T >::cur, and StringInputControl::refresh().

template<class T>
virtual ControlBase* ValueEditControl< T >::doPrevItem  )  [inline, virtual]
 

subtracts one from the current value

Reimplemented from ControlBase.

Definition at line 85 of file ValueEditControl.h.

References ValueEditControl< T >::cur, and StringInputControl::refresh().

template<class T>
virtual ControlBase* ValueEditControl< T >::doSelect  )  [inline, virtual]
 

if the value of the target!=cur, assigns the current value to the target and all the copies

Reimplemented from ControlBase.

Reimplemented in MCValueEditControl< T >.

Definition at line 65 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, ValueEditControl< T >::getName(), and ValueEditControl< T >::target.

template<class T>
virtual std::vector<T*>& ValueEditControl< T >::getCopies  )  [inline, virtual]
 

returns a reference to the vector copies

Definition at line 104 of file ValueEditControl.h.

References ValueEditControl< T >::copies.

template<class T>
virtual std::string ValueEditControl< T >::getName  )  const [inline, virtual]
 

shows current value

Reimplemented from ControlBase.

Definition at line 109 of file ValueEditControl.h.

References ControlBase::getName(), and ValueEditControl< T >::target.

template<class T>
virtual T* ValueEditControl< T >::getTarget  )  const [inline, virtual]
 

returns the target pointer

Definition at line 98 of file ValueEditControl.h.

References ValueEditControl< T >::target.

template<class T>
ValueEditControl ValueEditControl< T >::operator= const ValueEditControl< T > &  vec  )  [inline]
 

assignment operator

Definition at line 27 of file ValueEditControl.h.

References ValueEditControl< T >::copies, ValueEditControl< T >::cur, ControlBase::operator=(), and ValueEditControl< T >::target.

template<class T>
virtual void ValueEditControl< T >::pause  )  [inline, virtual]
 

request to continue receiving events so we can modify the value while running

Reimplemented from ControlBase.

Definition at line 57 of file ValueEditControl.h.

References EventRouter::addListener(), EventBase::buttonEGID, EventBase::deactivateETID, erouter, and ControlBase::pause().

template<class T>
virtual void ValueEditControl< T >::processEvent const EventBase e  )  [inline, virtual]
 

will increment/decrement the current and then assign it to the target when head buttons pressed

Implements EventListener.

Definition at line 38 of file ValueEditControl.h.

References ValueEditControl< T >::doNextItem(), ValueEditControl< T >::doSelect(), and EventBase::getSourceID().

template<class T>
virtual ValueEditControl& ValueEditControl< T >::setTarget T *  t  )  [inline, virtual]
 

sets the target pointer - the object pointed to will be overwritten on activate()

Returns:
*this

Definition at line 99 of file ValueEditControl.h.

References ValueEditControl< T >::target.

template<class T>
virtual ControlBase* ValueEditControl< T >::takeInput const std::string &  str  )  [inline, virtual]
 

called when the user has supplied a text string (may not have been prompted by doReadStdIn()!)

Reimplemented from StringInputControl.

Definition at line 91 of file ValueEditControl.h.

References ValueEditControl< T >::cur, and ValueEditControl< T >::doSelect().


Member Data Documentation

template<class T>
std::vector<T*> ValueEditControl< T >::copies [protected]
 

additional targets

Definition at line 118 of file ValueEditControl.h.

template<class T>
T ValueEditControl< T >::cur [protected]
 

the value to use when set

Definition at line 117 of file ValueEditControl.h.

template<class T>
T* ValueEditControl< T >::target [protected]
 

the main target

Definition at line 116 of file ValueEditControl.h.


The documentation for this class was generated from the following file:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:14 2003 by Doxygen 1.3.2