Merge pull request #2245 from lioncash/tables

DolphinWX: Get rid of wxGrid-based casts in the debugger.
This commit is contained in:
skidau
2015-03-30 12:20:20 +11:00
7 changed files with 23 additions and 7 deletions

View File

@ -77,7 +77,9 @@ wxGridCellAttr *CDSPRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKi
DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id) DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id)
: wxGrid(parent, id, wxDefaultPosition, wxSize(130, 120)) : wxGrid(parent, id, wxDefaultPosition, wxSize(130, 120))
{ {
SetTable(new CDSPRegTable(), true); m_register_table = new CDSPRegTable();
SetTable(m_register_table, true);
SetRowLabelSize(0); SetRowLabelSize(0);
SetColLabelSize(0); SetColLabelSize(0);
DisableDragRowSize(); DisableDragRowSize();
@ -87,6 +89,6 @@ DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id)
void DSPRegisterView::Update() void DSPRegisterView::Update()
{ {
((CDSPRegTable *)GetTable())->UpdateCachedRegs(); m_register_table->UpdateCachedRegs();
ForceRefresh(); ForceRefresh();
} }

View File

@ -44,4 +44,8 @@ class DSPRegisterView : public wxGrid
public: public:
DSPRegisterView(wxWindow* parent, wxWindowID id = wxID_ANY); DSPRegisterView(wxWindow* parent, wxWindowID id = wxID_ANY);
void Update() override; void Update() override;
private:
// Owned by wx. Deleted implicitly upon destruction.
CDSPRegTable* m_register_table;
}; };

View File

@ -248,7 +248,9 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id) CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id)
: wxGrid(parent, id) : wxGrid(parent, id)
{ {
SetTable(new CRegTable(), true); m_register_table = new CRegTable();
SetTable(m_register_table, true);
SetRowLabelSize(0); SetRowLabelSize(0);
SetColLabelSize(0); SetColLabelSize(0);
DisableDragRowSize(); DisableDragRowSize();
@ -262,7 +264,7 @@ CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id)
void CRegisterView::Update() void CRegisterView::Update()
{ {
ForceRefresh(); ForceRefresh();
((CRegTable *)GetTable())->UpdateCachedRegs(); m_register_table->UpdateCachedRegs();
} }
void CRegisterView::OnMouseDownR(wxGridEvent& event) void CRegisterView::OnMouseDownR(wxGridEvent& event)

View File

@ -76,4 +76,7 @@ public:
private: private:
u32 m_selectedAddress = 0; u32 m_selectedAddress = 0;
// Owned by wx. Deleted implicitly upon destruction.
CRegTable* m_register_table;
}; };

View File

@ -215,7 +215,9 @@ wxGridCellAttr* CWatchTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKin
CWatchView::CWatchView(wxWindow* parent, wxWindowID id) CWatchView::CWatchView(wxWindow* parent, wxWindowID id)
: wxGrid(parent, id) : wxGrid(parent, id)
{ {
SetTable(new CWatchTable(), false); m_watch_table = new CWatchTable();
SetTable(m_watch_table, true);
SetRowLabelSize(0); SetRowLabelSize(0);
SetColLabelSize(0); SetColLabelSize(0);
DisableDragRowSize(); DisableDragRowSize();
@ -229,7 +231,7 @@ void CWatchView::Update()
if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN) if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
{ {
ForceRefresh(); ForceRefresh();
((CWatchTable *)GetTable())->UpdateWatch(); m_watch_table->UpdateWatch();
} }
} }

View File

@ -52,4 +52,5 @@ public:
private: private:
u32 m_selectedAddress = 0; u32 m_selectedAddress = 0;
u32 m_selectedRow = 0; u32 m_selectedRow = 0;
CWatchTable* m_watch_table;
}; };

View File

@ -34,8 +34,10 @@ public:
void LoadAll(); void LoadAll();
private: private:
void CreateGUIControls();
wxAuiManager m_mgr; wxAuiManager m_mgr;
// Owned by wx. Deleted implicitly upon destruction.
CWatchView* m_GPRGridView; CWatchView* m_GPRGridView;
void CreateGUIControls();
}; };