00001
00002 #ifndef INCLUDED_StringInputControl_h_
00003 #define INCLUDED_StringInputControl_h_
00004
00005 #include "ControlBase.h"
00006 #include "Motion/PostureEngine.h"
00007 #include <string>
00008
00009
00010 class StringInputControl : public ControlBase {
00011 public:
00012
00013 StringInputControl(const std::string& n, const std::string& prompt) : ControlBase(n,prompt), lastInput(), userPrompt(prompt) {}
00014
00015 StringInputControl(const std::string& n, const std::string& desc, const std::string& prompt) : ControlBase(n,desc), lastInput(), userPrompt(prompt) {}
00016
00017 virtual ControlBase* activate(MotionManager::MC_ID disp_id, Socket* gui);
00018
00019 virtual void refresh();
00020
00021 virtual ControlBase* doReadStdIn(const std::string& prompt);
00022
00023 virtual ControlBase * takeInput(const std::string& msg) {
00024 lastInput=msg;
00025 return NULL;
00026 }
00027
00028
00029 virtual std::string getLastInput() { return lastInput; }
00030
00031
00032 virtual void setPrompt(const std::string& prompt) { userPrompt=prompt; }
00033
00034 protected:
00035 std::string lastInput;
00036 std::string userPrompt;
00037 };
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #endif