Display memory view page when setting its position

This commit is contained in:
Kingcom 2014-03-08 13:04:39 +01:00
parent 10c3928eef
commit c25020765c
3 changed files with 19 additions and 1 deletions

View File

@ -47,7 +47,7 @@ GenericListViewColumn breakpointColumns[BPL_COLUMNCOUNT] = {
};
BreakpointList::BreakpointList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly)
: wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL), cpu(_cpu), disasm(_disassembly)
: wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL|wxNO_BORDER), cpu(_cpu), disasm(_disassembly)
{
insertListViewColumns(this,breakpointColumns,BPL_COLUMNCOUNT);
}

View File

@ -83,6 +83,18 @@ CpuTabPage::CpuTabPage(wxWindow* parent, DebugInterface* _cpu)
mainSizer->Layout();
}
void CpuTabPage::setBottomTabPage(wxWindow* win)
{
for (size_t i = 0; i < bottomTabs->GetPageCount(); i++)
{
if (bottomTabs->GetPage(i) == win)
{
bottomTabs->SetSelection(i);
break;
}
}
}
void CpuTabPage::update()
{
breakpointList->reloadBreakpoints();
@ -335,7 +347,11 @@ void DisassemblyDialog::onDebuggerEvent(wxCommandEvent& evt)
} else if (type == debEVT_GOTOINMEMORYVIEW)
{
if (currentCpu != NULL)
{
currentCpu->showMemoryView();
currentCpu->getMemoryView()->gotoAddress(evt.GetInt());
currentCpu->getDisassembly()->SetFocus();
}
} else if (type == debEVT_RUNTOPOS)
{
// todo: breakpoints for iop

View File

@ -25,7 +25,9 @@ public:
CtrlMemView* getMemoryView() { return memory; };
wxNotebook* getBottomTabs() { return bottomTabs; };
void update();
void showMemoryView() { setBottomTabPage(memory); };
private:
void setBottomTabPage(wxWindow* win);
DebugInterface* cpu;
CtrlDisassemblyView* disassembly;
CtrlRegisterList* registerList;