OpenASIP
2.0
|
#include <ConsoleWindow.hh>
Classes | |
class | ConsoleWindowInputCtrl |
Public Member Functions | |
ConsoleWindow (ProximMainFrame *parent, wxWindowID id) | |
virtual | ~ConsoleWindow () |
virtual void | reset () |
void | write (std::string text) |
void | clear () |
Private Types | |
enum | { ID_INPUT = 20000, ID_OUTPUT } |
IDs for the window widgets. More... | |
Private Member Functions | |
virtual void | onSimulatorBusy (SimulatorEvent &event) |
virtual void | onSimulatorDone (SimulatorEvent &event) |
void | createContents () |
void | onSimulatorOutput (const SimulatorEvent &event) |
void | onError (const SimulatorEvent &event) |
void | textEntered (wxCommandEvent &event) |
void | onInputKey (wxKeyEvent &event) |
Private Attributes | |
wxTextCtrl * | outTextCtrl_ |
Output text control. More... | |
wxTextCtrl * | inTextCtrl_ |
Input text control. More... | |
ProximLineReader * | lineReader_ |
Linereader to send the user input to. More... | |
int | historyIterator_ |
Stores the command history iterator, used for command history browsing. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ProximSimulatorWindow | |
ProximSimulatorWindow (ProximMainFrame *mainFrame, wxWindowID id=-1, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, long style=wxTAB_TRAVERSAL) | |
virtual | ~ProximSimulatorWindow () |
Simulator console window class.
ConsoleWindow is a console with a multiline textual output window, and a singleline textual input widget. Commands are requested from the console window using SimulatorEvents.
Definition at line 51 of file ConsoleWindow.hh.
|
private |
IDs for the window widgets.
Enumerator | |
---|---|
ID_INPUT | |
ID_OUTPUT |
Definition at line 78 of file ConsoleWindow.hh.
ConsoleWindow::ConsoleWindow | ( | ProximMainFrame * | parent, |
wxWindowID | id | ||
) |
The Constructor.
parent | Parent window of the console window. |
id | Window identifier. |
Definition at line 101 of file ConsoleWindow.cc.
References createContents(), and lineReader_.
|
virtual |
void ConsoleWindow::clear | ( | ) |
Clears text from the output text widget.
Definition at line 269 of file ConsoleWindow.cc.
References outTextCtrl_.
Referenced by ProximClearConsoleCmd::Do().
|
private |
Creates the window widgets.
Definition at line 164 of file ConsoleWindow.cc.
References ID_OUTPUT, inTextCtrl_, and outTextCtrl_.
Referenced by ConsoleWindow().
|
private |
Handles simulator error events.
The error text is printed in the console.
event | Simulator interpreter command event. |
Definition at line 211 of file ConsoleWindow.cc.
References outTextCtrl_, and WxConversion::toWxString().
|
private |
Handles special keypresses in the input widget.
event | Keypress event to handle. |
Definition at line 226 of file ConsoleWindow.cc.
References historyIterator_, LineReader::inputHistoryEntry(), LineReader::inputsInHistory(), inTextCtrl_, lineReader_, and WxConversion::toWxString().
Referenced by ConsoleWindow::ConsoleWindowInputCtrl::onKeyDown().
|
privatevirtual |
An event handler for the event of the simulator to start processing a command.
The Console window must stay enabled when the simulator is busy, so this method is overloaded to not to lock the window.
Reimplemented from ProximSimulatorWindow.
Definition at line 281 of file ConsoleWindow.cc.
|
privatevirtual |
An event handler for the event of the simulator to complete command processing.
The Console window is not locked during simulator processing, so there's no need to do anything.
Reimplemented from ProximSimulatorWindow.
Definition at line 293 of file ConsoleWindow.cc.
|
private |
Handles simulator text output events.
The event data contains the simulator interpreter output, which is appended to the text output widget.
event | Simulator interpreter text output event. |
Definition at line 195 of file ConsoleWindow.cc.
References outTextCtrl_, and WxConversion::toWxString().
|
virtual |
Called when the simulator program, machine and memory models are deleted.
Reimplemented from ProximSimulatorWindow.
Definition at line 124 of file ConsoleWindow.cc.
|
private |
Event handler for the user input to the text input widget.
The text is passed to the linereader as input.
Definition at line 135 of file ConsoleWindow.cc.
References historyIterator_, ProximLineReader::input(), inTextCtrl_, lineReader_, and WxConversion::toString().
void ConsoleWindow::write | ( | std::string | text | ) |
Appends text to the output window.
text | Text to append to the output window. |
Definition at line 150 of file ConsoleWindow.cc.
References outTextCtrl_, and WxConversion::toWxString().
|
private |
Stores the command history iterator, used for command history browsing.
Definition at line 75 of file ConsoleWindow.hh.
Referenced by onInputKey(), and textEntered().
|
private |
Input text control.
Definition at line 71 of file ConsoleWindow.hh.
Referenced by createContents(), onInputKey(), and textEntered().
|
private |
Linereader to send the user input to.
Definition at line 73 of file ConsoleWindow.hh.
Referenced by ConsoleWindow(), onInputKey(), and textEntered().
|
private |
Output text control.
Definition at line 69 of file ConsoleWindow.hh.
Referenced by clear(), createContents(), onError(), onSimulatorOutput(), and write().