Hey Look, Register window in Linux works now! Maybe we should use the same method for Windows, instead of the OS specific one? Also, I will probably make a window similar to this for video registers, so I can debug them. Fun for all!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1403 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-12-05 06:01:53 +00:00
parent bc3a7bdce3
commit be3094b6b3
4 changed files with 32 additions and 3 deletions

View File

@ -23,7 +23,6 @@ extern const char* GetGRPName(unsigned int index);
BEGIN_EVENT_TABLE(CRegisterView, wxListCtrl)
END_EVENT_TABLE()
CRegisterView::CRegisterView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
@ -90,6 +89,29 @@ CRegisterView::Update()
Refresh();
}
void CRegisterView::Refresh()
{
for (size_t i = 0; i < 16; i++)
{
wxListItem item;
item.SetId(i);
item.SetColumn(1);
char temp[16];
sprintf(temp, "0x%08x",m_CachedRegs[i]);
item.SetText(wxString::FromAscii(temp));
SetItem(item);
}
for (size_t i = 0; i < 16; i++)
{
wxListItem item;
item.SetId(i);
item.SetColumn(3);
char temp[16];
sprintf(temp, "0x%08x",m_CachedRegs[16 + i]);
item.SetText(wxString::FromAscii(temp));
SetItem(item);
}
}
#ifdef _WIN32
bool
CRegisterView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem)

View File

@ -30,6 +30,7 @@ class CRegisterView
CRegisterView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
void Update();
void Refresh();
private:
@ -38,7 +39,6 @@ class CRegisterView
u32 m_CachedRegs[32];
bool m_CachedRegHasChanged[32];
#ifdef _WIN32
virtual bool MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem);
#endif

View File

@ -25,6 +25,7 @@ extern const char* GetGRPName(unsigned int index);
BEGIN_EVENT_TABLE(CRegisterWindow, wxDialog)
EVT_CLOSE(CRegisterWindow::OnClose)
EVT_MENU(wxID_REFRESH, CRegisterWindow::OnRefresh)
END_EVENT_TABLE()
CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
@ -78,6 +79,12 @@ void CRegisterWindow::OnClose(wxCloseEvent& /*event*/)
Hide();
}
void CRegisterWindow::OnRefresh(wxCommandEvent& WXUNUSED (event))
{
m_GPRListView->Refresh();
m_GPRListView->Update();
}
void CRegisterWindow::NotifyUpdate()
{

View File

@ -50,7 +50,7 @@ class CRegisterWindow
};
CRegisterView* m_GPRListView;
void OnRefresh(wxCommandEvent& WXUNUSED (event));
void OnClose(wxCloseEvent& event);
void CreateGUIControls();
};