107 wxBoxSizer* sizer =
new wxBoxSizer(wxVERTICAL);
119 wxSizer* sizer = GetSizer();
121 if (codeGrid_ != NULL) {
122 sizer->Detach(codeGrid_);
124 codeGrid_->Destroy();
127 codeGrid_ =
new wxGrid(
this, -1, wxDefaultPosition, wxDefaultSize);
128 codeGrid_->SetTable(codeTable_);
130 codeGrid_->EnableEditing(
false);
131 codeGrid_->DisableCellEditControl();
132 codeGrid_->SetSelectionMode(wxGrid::wxGridSelectRows);
133 codeGrid_->DisableDragGridSize();
134 codeGrid_->DisableDragRowSize();
135 codeGrid_->EnableGridLines(
false);
136 codeGrid_->SetDefaultColSize(200);
138 codeGrid_->SetColSize(0, 100);
139 codeGrid_->SetColSize(1, 80);
141 codeGrid_->SetDefaultCellFont(*wxSMALL_FONT);
142 codeGrid_->SetGridCursor(0, 0);
144 sizer->Add(codeGrid_, 1, wxGROW);
157 wxSizer* sizer = GetSizer();
159 if (codeGrid_ != NULL) {
160 sizer->Detach(codeGrid_);
162 codeGrid_->Destroy();
166 if (codeTable_ != NULL) {
180 assert(codeTable_ == NULL);
183 codeTable_->loadProgram(
program);
185 codeTable_->setCurrentInstruction(0);
186 codeTable_->showPCArrow();
189 codeTable_->setStopPointManager(bpManager);
211 codeGrid_->SelectRow(event.GetRow());
213 wxMenu* contextMenu =
new wxMenu();
214 Word address = codeTable_->addressOfRow(event.GetRow());
215 contextMenu->Append(MENU_ID_SET_BP, _T(
"Set breakpoint"));
217 MENU_ID_SET_TEMP_BP, _T(
"Set temporary breakpoint"));
219 contextMenu->AppendSeparator();
220 contextMenu->Append(MENU_ID_RUN_UNTIL, _T(
"Run until"));
221 contextMenu->AppendSeparator();
223 menuCommand_.clear();
237 unsigned bpAddress = bp->
address();
238 if (bpAddress == address) {
240 wxMenu* bpSubMenu =
new wxMenu();
244 menuCommand_[itemID] =
"info breakpoints " + handleStr;
245 wxString infoLabel = _T(
"info");
246 bpSubMenu->Append(itemID, infoLabel);
251 menuCommand_[itemID] =
"deletebp " + handleStr;
252 wxString deleteLabel = _T(
"delete");
253 bpSubMenu->Append(itemID, deleteLabel);
258 menuCommand_[itemID] =
259 "disablebp " + handleStr;
260 wxString disableLabel = _T(
"disable");
261 bpSubMenu->Append(itemID, disableLabel);
263 menuCommand_[itemID] =
264 "enablebp " + handleStr;
265 wxString enableLabel = _T(
"enable");
266 bpSubMenu->Append(itemID, enableLabel);
272 contextMenu->Append(0, menuLabel, bpSubMenu);
277 PopupMenu(contextMenu, event.GetPosition());
288 codeTable_->addressOfRow(codeGrid_->GetSelectedRows().Item(0));
292 wxGetApp().simulation()->lineReader().input(command);
302 codeTable_->addressOfRow(codeGrid_->GetSelectedRows().Item(0));
306 wxGetApp().simulation()->lineReader().input(command);
316 codeTable_->addressOfRow(codeGrid_->GetSelectedRows().Item(0));
320 wxGetApp().simulation()->lineReader().input(command);
329 Word pc = wxGetApp().simulation()->frontend()->programCounter();
330 if (codeTable_->moveCellAttrProvider() != NULL) {
331 codeTable_->moveCellAttrProvider()->update();
333 codeTable_->setCurrentInstruction(pc);
334 codeGrid_->SelectRow(pc);
335 codeGrid_->MakeCellVisible(pc, 1);
336 codeGrid_->ForceRefresh();
347 if (codeGrid_ != NULL) {
348 codeGrid_->ForceRefresh();
360 unsigned row = codeTable_->rowOfAddress(address);
361 codeGrid_->SelectRow(row);
362 codeGrid_->MakeCellVisible(row, 0);
380 string command = menuCommand_[
event.GetId()];
381 wxGetApp().simulation()->lineReader().input(command);
394 codeTable_->setMoveCellAttrProvider(attrProvider);