Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ToggleControl Class Reference

a simple control for turning things on and off More...

#include <ToggleControl.h>

Inheritance diagram for ToggleControl:

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.

List of all members.

Classes

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

Public Member Functions

 ~ToggleControl ()
 destructor
virtual ControlBaseactivate (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

Constructor & Destructor Documentation

ToggleControl::ToggleControl (  ) 

Definition at line 49 of file ToggleControl.h.

ToggleControl::ToggleControl ( const std::string &  n,
RadioGroup rad = NULL 
)

Definition at line 50 of file ToggleControl.h.

ToggleControl::ToggleControl ( const std::string &  n,
const std::string &  d,
RadioGroup rad = NULL 
)

Definition at line 51 of file ToggleControl.h.

ToggleControl::~ToggleControl (  ) 

destructor

Definition at line 53 of file ToggleControl.h.

ToggleControl::ToggleControl ( const ToggleControl  )  [private]

don't call


Member Function Documentation

virtual ControlBase* ToggleControl::activate ( MC_ID  ,
Socket  
) [virtual]

returns NULL

Reimplemented from NullControl.

Definition at line 55 of file ToggleControl.h.

virtual ControlBase* ToggleControl::doSelect (  )  [virtual]

returns NULL

Reimplemented from NullControl.

Definition at line 56 of file ToggleControl.h.

virtual RadioGroup* ToggleControl::getRadioGroup (  )  const [virtual]

returns the current RadioGroup

Definition at line 124 of file ToggleControl.h.

Referenced by WalkCalibration::setupReady().

virtual bool ToggleControl::getStatus (  )  const [virtual]
virtual char ToggleControl::getStatusChar (  )  const [virtual]

returns the current status char

Definition at line 108 of file ToggleControl.h.

Referenced by getStatus(), and toggleStatus().

virtual bool* ToggleControl::getStore (  )  const [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  )  [virtual]

sets the name of the control

Reimplemented from ControlBase.

Definition at line 58 of file ToggleControl.h.

virtual void ToggleControl::setRadioGroup ( RadioGroup rad  )  [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  )  [virtual]

pass the character to put as the status

Definition at line 87 of file ToggleControl.h.

virtual void ToggleControl::setStatus ( bool  check  )  [virtual]
virtual void ToggleControl::setStore ( bool *  s  )  [virtual]

sets externalStore (and updates its current setting)

Definition at line 126 of file ToggleControl.h.

Referenced by WaypointWalkControl::WaypointEditControl::WaypointEditControl().

virtual void ToggleControl::toggleStatus ( char  c1,
char  c2 
) [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  )  [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 (  )  [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().

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 v5.1CVS
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3