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

StringInputControl Class Reference

#include <StringInputControl.h>

Inheritance diagram for StringInputControl:

Inheritance graph
[legend]
List of all members.

Detailed Description

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

Definition at line 10 of file StringInputControl.h.

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 ControlBaseactivate (MotionManager::MC_ID disp_id, Socket *gui)
 Called when the control is activated (or the control system is reactivating).

virtual void refresh ()
 called when the child has died and this control should refresh its display

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 not have been prompted by doReadStdIn()!)

virtual std::string getLastInput ()
 returns last call to takeInput()

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
[inline]
 

Constructor.

Definition at line 13 of file StringInputControl.h.

References lastInput, and userPrompt.

StringInputControl::StringInputControl const std::string &  n,
const std::string &  desc,
const std::string &  prompt
[inline]
 

Constructor.

Definition at line 15 of file StringInputControl.h.

References lastInput, and userPrompt.


Member Function Documentation

ControlBase * StringInputControl::activate MotionManager::MC_ID  disp_id,
Socket gui
[virtual]
 

Called when the control is activated (or the control system is reactivating).

Takes the id number of a LedMC which the control should use, maintained by Controller. Controls share the display which is passed, and may use the socket gui to communicate with the GUI controller, if it is connected.

Returns:
a ControlBase pointer. Return:
  • this if the control should stay active (if it's not a one-shot command)
  • NULL to return to parent
  • other address to spawn a child control

Reimplemented from ControlBase.

Reimplemented in ValueEditControl< T >.

Definition at line 7 of file StringInputControl.cc.

References ControlBase::display_id, doReadStdIn(), ControlBase::gui_comm, and userPrompt.

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)

Reimplemented from ControlBase.

Definition at line 17 of file StringInputControl.cc.

References ControlBase::doReadStdIn(), and userPrompt.

virtual std::string StringInputControl::getLastInput  )  [inline, virtual]
 

returns last call to takeInput()

Definition at line 29 of file StringInputControl.h.

References lastInput.

void StringInputControl::refresh  )  [virtual]
 

called when the child has died and this control should refresh its display

Reimplemented from ControlBase.

Definition at line 13 of file StringInputControl.cc.

References ControlBase::doReadStdIn(), and userPrompt.

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

sets the prompt to give to the user

Definition at line 32 of file StringInputControl.h.

References userPrompt.

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

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

Reimplemented from ControlBase.

Reimplemented in SavePostureControl, and ValueEditControl< T >.

Definition at line 23 of file StringInputControl.h.

References lastInput.


Member Data Documentation

std::string StringInputControl::lastInput [protected]
 

stores the last input to takeInput()

Definition at line 35 of file StringInputControl.h.

std::string StringInputControl::userPrompt [protected]
 

stores the prompt to send out

Definition at line 36 of file StringInputControl.h.


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