Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

StringInputControl Class Reference

Upon activation, prompts the user for a string and stores it. More...

#include <StringInputControl.h>

Inheritance diagram for StringInputControl:

Detailed Description

Upon activation, prompts the user for a string and stores it.

Definition at line 9 of file StringInputControl.h.

List of all members.

Public Member Functions

 StringInputControl (const std::string &n, const std::string &prompt)
 Constructor.
 StringInputControl (const std::string &n, const std::string &desc, const std::string &prompt)
 Constructor.
virtual void refresh ()
 called when the child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed
virtual ControlBasedoReadStdIn (const std::string &prompt)
 prompt the user for text input on the current input device (cin, tekkotsu console (sout), or GUI)
virtual ControlBasetakeInput (const std::string &msg)
 called when the user has supplied a text string (may or may not have been prompted by doReadStdIn()! May not even be active yet - the user can direct the same input to a set of hilighted menus)
virtual const std::string & getLastInput () const
 returns last call to takeInput()
virtual void clearLastInput ()
 clears the last input (i.e. so you can easily tell later if new input is entered)
virtual void setPrompt (const std::string &prompt)
 sets the prompt to give to the user

Protected Attributes

std::string lastInput
 stores the last input to takeInput()
std::string userPrompt
 stores the prompt to send out

Constructor & Destructor Documentation

StringInputControl::StringInputControl ( const std::string &  n,
const std::string &  prompt 
)

Constructor.

Definition at line 12 of file StringInputControl.h.

StringInputControl::StringInputControl ( const std::string &  n,
const std::string &  desc,
const std::string &  prompt 
)

Constructor.

Definition at line 14 of file StringInputControl.h.


Member Function Documentation

virtual void StringInputControl::clearLastInput (  )  [virtual]

clears the last input (i.e. so you can easily tell later if new input is entered)

Definition at line 31 of file StringInputControl.h.

Referenced by ConfigurationEditor::NamedEnumerationEditor::doSelect(), WaypointWalkControl::refresh(), SensorObserverControl::refresh(), and MoCapLogger::refresh().

ControlBase * StringInputControl::doReadStdIn ( const std::string &  prompt  )  [virtual]

prompt the user for text input on the current input device (cin, tekkotsu console (sout), or GUI)

The value which is returned is then activate()ed and pushed on the Controller's stack, so you probably want to return this

Reimplemented from ControlBase.

Definition at line 19 of file StringInputControl.cc.

Referenced by refresh().

virtual const std::string& StringInputControl::getLastInput (  )  const [virtual]
void StringInputControl::refresh (  )  [virtual]

called when the child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed

Reimplemented from ControlBase.

Reimplemented in ConfigurationEditor::NamedEnumerationEditor, and ValueEditControl< T >.

Definition at line 14 of file StringInputControl.cc.

virtual void StringInputControl::setPrompt ( const std::string &  prompt  )  [virtual]

sets the prompt to give to the user

Definition at line 34 of file StringInputControl.h.

virtual ControlBase* StringInputControl::takeInput ( const std::string &  msg  )  [virtual]

called when the user has supplied a text string (may or may not have been prompted by doReadStdIn()! May not even be active yet - the user can direct the same input to a set of hilighted menus)

The value which is returned is then activate()ed and pushed on the Controller's stack

Reimplemented from ControlBase.

Reimplemented in SavePostureControl, SaveWalkControl, and ValueEditControl< T >.

Definition at line 22 of file StringInputControl.h.

Referenced by clearLastInput(), WalkCalibration::refresh(), PostureEditor::refresh(), and ConfigurationEditor::NewCollectionEntry::refresh().


Member Data Documentation

std::string StringInputControl::lastInput [protected]

stores the last input to takeInput()

Definition at line 37 of file StringInputControl.h.

Referenced by getLastInput(), and takeInput().

std::string StringInputControl::userPrompt [protected]

stores the prompt to send out

Definition at line 38 of file StringInputControl.h.

Referenced by doReadStdIn(), refresh(), ConfigurationEditor::NamedEnumerationEditor::refresh(), and setPrompt().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3