35 #include <wx/textctrl.h>
63 createContents(
this,
true,
true);
78 sourceFileList_->Clear();
79 sourceCodeText_->Clear();
81 currentLineNums_.clear();
93 for (
int i = 0; i <
program.moveCount(); i++) {
100 if (sourceFileList_->FindString(sourceFile) == -1) {
101 sourceFileList_->Append(sourceFile);
107 if (sourceFileList_->GetCount() > 0) {
108 loadSourceCode(sourceFileList_->GetString(0));
112 this, _T(
"No debugging information available."));
125 Word pc = wxGetApp().simulation()->frontend()->programCounter();
131 for (
int i = 0; i < instruction.
moveCount(); i++) {
136 if (sourceFile == currentFile_) {
142 if (currentLineNums_.size() > 0) {
143 showLine(currentLineNums_.back());
157 sourceCodeText_->LoadFile(sourceFile);
158 currentFile_ = sourceFile;
159 sourceFileList_->SetSelection(sourceFileList_->FindString(sourceFile));
172 long lineStart = sourceCodeText_->XYToPosition(0, lineNum - 1);
173 long lineEnd = lineStart + sourceCodeText_->GetLineLength(lineNum - 1);
175 sourceCodeText_->SetStyle(lineStart, lineEnd, style);
187 if (std::find(currentLineNums_.begin(), currentLineNums_.end(), lineNum) ==
188 currentLineNums_.end()) {
190 currentLineNums_.push_back(lineNum);
191 setLineAttributes(lineNum, wxTextAttr(*wxWHITE, *wxBLUE));
203 sourceCodeText_->ShowPosition(sourceCodeText_->XYToPosition(0,lineNum - 1));
222 for (
int lineNum : currentLineNums_) {
223 setLineAttributes(lineNum, wxTextAttr(*wxBLACK, *wxWHITE));
225 currentLineNums_.clear();
238 loadSourceCode(sourceFileList_->GetString(sourceFileList_->GetSelection()));
239 currentLineNums_.clear();
251 wxWindow *parent,
bool call_fit,
bool set_sizer) {
253 wxBoxSizer *mainSizer =
new wxBoxSizer(wxVERTICAL);
255 wxBoxSizer *upperSizer =
new wxBoxSizer(wxHORIZONTAL);
256 sourceFileList_ =
new wxChoice(
257 parent, ID_SOURCEFILE_CHOICE, wxDefaultPosition, wxDefaultSize);
259 upperSizer->Add(sourceFileList_, 1, wxGROW|wxALL, 5);
260 mainSizer->Add(upperSizer, 0, wxGROW|wxALL, 5);
262 sourceCodeText_ =
new wxTextCtrl(
263 parent, ID_SOURCECODE, wxEmptyString, wxDefaultPosition,
264 wxSize(640, 600), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
266 mainSizer->Add(sourceCodeText_, 1, wxGROW|wxALL, 5);
270 parent->SetSizer( mainSizer );
272 mainSizer->SetSizeHints( parent );