33#include <wx/textctrl.h>
34#include <wx/valtext.h>
50BEGIN_EVENT_TABLE(
ConsoleWindow::ConsoleWindowInputCtrl, wxTextCtrl)
51 EVT_KEY_DOWN(ConsoleWindowInputCtrl::onKeyDown)
68 wxTextCtrl(console, ID_INPUT, _T(""), wxDefaultPosition,
69 wxSize(500,30), wxTE_PROCESS_ENTER),
110 lineReader_ = &wxGetApp().simulation()->lineReader();
168 this,
ID_OUTPUT, _T(
""), wxDefaultPosition, wxDefaultSize,
169 wxTE_MULTILINE | wxTE_READONLY);
175 wxFlexGridSizer* sizer =
new wxFlexGridSizer(1, 0, 0);
176 sizer->AddGrowableCol(0);
177 sizer->AddGrowableRow(0);
180 sizer->Add(
inTextCtrl_, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
182 sizer->SetSizeHints(
this);
197 std::string text =
event.data();
212 std::string error =
event.data();
228 if (event.GetKeyCode() == WXK_UP) {
235 }
else if (event.GetKeyCode() == WXK_DOWN) {
END_EVENT_TABLE() using namespace IDF
#define EVT_SIMULATOR_RUNTIME_WARNING(id, fn)
#define EVT_SIMULATOR_OUTPUT(id, fn)
#define EVT_SIMULATOR_RUNTIME_ERROR(id, fn)
#define EVT_SIMULATOR_COMMAND(id, fn)
#define EVT_SIMULATOR_ERROR(id, fn)
virtual void onSimulatorDone(SimulatorEvent &event)
virtual void onSimulatorBusy(SimulatorEvent &event)
void onSimulatorOutput(const SimulatorEvent &event)
ProximLineReader * lineReader_
Linereader to send the user input to.
ConsoleWindow(ProximMainFrame *parent, wxWindowID id)
void textEntered(wxCommandEvent &event)
wxTextCtrl * inTextCtrl_
Input text control.
void onInputKey(wxKeyEvent &event)
int historyIterator_
Stores the command history iterator, used for command history browsing.
void write(std::string text)
wxTextCtrl * outTextCtrl_
Output text control.
void onError(const SimulatorEvent &event)
virtual std::size_t inputsInHistory() const
virtual std::string inputHistoryEntry(std::size_t age) const
void input(std::string command)
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)