Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ToggleControl Class Reference

#include <ToggleControl.h>

Inheritance diagram for ToggleControl:

Inheritance graph
[legend]
List of all members.

Detailed Description

a simple control for turning things on and off

Can also be used for radio buttons - select one of a group

By using the externalStore (setStore()/getStore()), you can use this instead of a ValueEditControl<bool>

Definition at line 13 of file ToggleControl.h.

Public Member Functions

 ~ToggleControl ()
 destructor
virtual ControlBaseactivate (MotionManager::MC_ID mcid, Socket *disp)
 returns NULL
virtual ControlBasedoSelect ()
 returns NULL
virtual ControlBasesetName (const std::string &n)
 sets the name of the control
virtual void toggleStatus ()
 calls setStatus() with the not of getStatus()
virtual void toggleStatus (char c)
 if status is a ' ', it'll be replaced with c, otherwise a space.
virtual void toggleStatus (char c1, char c2)
 status will toggle between the two arguments; if current status is neither, the first is used
virtual void setStatus (bool check)
 a true will put a 'X' for the status; false shows ' '
virtual void setStatus (char c)
 pass the character to put as the status
virtual bool getStatus () const
 returns true if there's a non-space as the status
virtual char getStatusChar () const
 returns the current status char
virtual void setRadioGroup (RadioGroup *rad)
 removes itself from current RadioGroup, and adds itself to rad if non-NULL
virtual RadioGroupgetRadioGroup () const
 returns the current RadioGroup
virtual void setStore (bool *s)
 sets externalStore (and updates its current setting)
virtual bool * getStore () const
 returns externalStore
Constructors
 ToggleControl ()
 ToggleControl (const std::string &n, RadioGroup *rad=NULL)
 ToggleControl (const std::string &n, const std::string &d, RadioGroup *rad=NULL)

Protected Attributes

RadioGrouprg
 pointer to an optional radio group to allow one-of-many selections
bool * externalStore
 an external bit which should be kept in sync with current setting

Private Member Functions

 ToggleControl (const ToggleControl &)
 don't call
ToggleControloperator= (const ToggleControl &)
 don't call

Classes

class  RadioGroup
 a little class for managing the currently active ToggleControl to allow radio buttons More...


Constructor & Destructor Documentation

ToggleControl::ToggleControl  )  [inline]
 

Definition at line 49 of file ToggleControl.h.

ToggleControl::ToggleControl const std::string &  n,
RadioGroup rad = NULL
[inline]
 

Definition at line 50 of file ToggleControl.h.

ToggleControl::ToggleControl const std::string &  n,
const std::string &  d,
RadioGroup rad = NULL
[inline]
 

Definition at line 51 of file ToggleControl.h.

ToggleControl::~ToggleControl  )  [inline]
 

destructor

Definition at line 53 of file ToggleControl.h.

ToggleControl::ToggleControl const ToggleControl  )  [private]
 

don't call


Member Function Documentation

virtual ControlBase* ToggleControl::activate MotionManager::MC_ID  mcid,
Socket disp
[inline, virtual]
 

returns NULL

Reimplemented from NullControl.

Definition at line 55 of file ToggleControl.h.

virtual ControlBase* ToggleControl::doSelect  )  [inline, virtual]
 

returns NULL

Reimplemented from NullControl.

Definition at line 56 of file ToggleControl.h.

virtual RadioGroup* ToggleControl::getRadioGroup  )  const [inline, virtual]
 

returns the current RadioGroup

Definition at line 124 of file ToggleControl.h.

Referenced by WalkCalibration::setupReady().

virtual bool ToggleControl::getStatus  )  const [inline, virtual]
 

returns true if there's a non-space as the status

Definition at line 103 of file ToggleControl.h.

Referenced by WaypointWalkControl::doSelect(), SensorObserverControl::doSelect(), SensorObserverControl::processEvent(), WalkCalibration::refresh(), setRadioGroup(), setStatus(), setStore(), toggleStatus(), and SensorObserverControl::updateRT().

virtual char ToggleControl::getStatusChar  )  const [inline, virtual]
 

returns the current status char

Definition at line 108 of file ToggleControl.h.

Referenced by getStatus(), and toggleStatus().

virtual bool* ToggleControl::getStore  )  const [inline, virtual]
 

returns externalStore

Definition at line 127 of file ToggleControl.h.

ToggleControl& ToggleControl::operator= const ToggleControl  )  [private]
 

don't call

virtual ControlBase& ToggleControl::setName const std::string &  n  )  [inline, virtual]
 

sets the name of the control

Reimplemented from ControlBase.

Definition at line 58 of file ToggleControl.h.

virtual void ToggleControl::setRadioGroup RadioGroup rad  )  [inline, virtual]
 

removes itself from current RadioGroup, and adds itself to rad if non-NULL

Definition at line 113 of file ToggleControl.h.

Referenced by ToggleControl(), and ~ToggleControl().

virtual void ToggleControl::setStatus char  c  )  [inline, virtual]
 

pass the character to put as the status

Definition at line 87 of file ToggleControl.h.

virtual void ToggleControl::setStatus bool  check  )  [inline, virtual]
 

a true will put a 'X' for the status; false shows ' '

Definition at line 82 of file ToggleControl.h.

Referenced by ToggleControl::RadioGroup::activate(), WaypointWalkControl::refresh(), WalkCalibration::setupReady(), and toggleStatus().

virtual void ToggleControl::setStore bool *  s  )  [inline, virtual]
 

sets externalStore (and updates its current setting)

Definition at line 126 of file ToggleControl.h.

virtual void ToggleControl::toggleStatus char  c1,
char  c2
[inline, virtual]
 

status will toggle between the two arguments; if current status is neither, the first is used

Definition at line 74 of file ToggleControl.h.

virtual void ToggleControl::toggleStatus char  c  )  [inline, virtual]
 

if status is a ' ', it'll be replaced with c, otherwise a space.

Definition at line 66 of file ToggleControl.h.

virtual void ToggleControl::toggleStatus  )  [inline, virtual]
 

calls setStatus() with the not of getStatus()

Definition at line 61 of file ToggleControl.h.

Referenced by activate(), and doSelect().


Member Data Documentation

bool* ToggleControl::externalStore [protected]
 

an external bit which should be kept in sync with current setting

Definition at line 132 of file ToggleControl.h.

Referenced by getStore(), setStatus(), and setStore().

RadioGroup* ToggleControl::rg [protected]
 

pointer to an optional radio group to allow one-of-many selections

Definition at line 130 of file ToggleControl.h.

Referenced by getRadioGroup(), setRadioGroup(), and setStatus().


The documentation for this class was generated from the following file:

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:11 2005 by Doxygen 1.4.4