diff --git a/Source/Core/DolphinWX/Debugger/BreakpointDlg.cpp b/Source/Core/DolphinWX/Debugger/BreakpointDlg.cpp index 91da5e92b2..a91145f873 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointDlg.cpp +++ b/Source/Core/DolphinWX/Debugger/BreakpointDlg.cpp @@ -21,14 +21,12 @@ #include "DolphinWX/Debugger/BreakpointDlg.h" #include "DolphinWX/Debugger/BreakpointWindow.h" -BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog) - EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK) -END_EVENT_TABLE() - BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent) : wxDialog(_Parent, wxID_ANY, _("Add Breakpoint")) , Parent(_Parent) { + Bind(wxEVT_BUTTON, &BreakPointDlg::OnOK, this, wxID_OK); + m_pEditAddress = new wxTextCtrl(this, wxID_ANY, "80000000"); wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL); diff --git a/Source/Core/DolphinWX/Debugger/BreakpointDlg.h b/Source/Core/DolphinWX/Debugger/BreakpointDlg.h index 7e4312a350..38670696e7 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointDlg.h +++ b/Source/Core/DolphinWX/Debugger/BreakpointDlg.h @@ -20,6 +20,4 @@ private: wxTextCtrl *m_pEditAddress; void OnOK(wxCommandEvent& event); - - DECLARE_EVENT_TABLE(); }; diff --git a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp index 4e22b8fbdf..e45a172e8f 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp @@ -96,21 +96,19 @@ private: wxBitmap m_Bitmaps[Num_Bitmaps]; }; -BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel) - EVT_CLOSE(CBreakPointWindow::OnClose) - EVT_LIST_ITEM_SELECTED(wxID_ANY, CBreakPointWindow::OnSelectBP) -END_EVENT_TABLE() - CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style) : wxPanel(parent, id, position, size, style, title) , m_pCodeWindow(_pCodeWindow) { + Bind(wxEVT_CLOSE_WINDOW, &CBreakPointWindow::OnClose, this); + m_mgr.SetManagedWindow(this); m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_BreakPointListView = new CBreakPointView(this, wxID_ANY); + m_BreakPointListView->Bind(wxEVT_LIST_ITEM_SELECTED, &CBreakPointWindow::OnSelectBP, this); m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top(). LeftDockable(true).RightDockable(true).BottomDockable(false).Floatable(false)); diff --git a/Source/Core/DolphinWX/Debugger/BreakpointWindow.h b/Source/Core/DolphinWX/Debugger/BreakpointWindow.h index 03549a241c..eea93964e6 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointWindow.h +++ b/Source/Core/DolphinWX/Debugger/BreakpointWindow.h @@ -43,8 +43,6 @@ public: void LoadAll(); private: - DECLARE_EVENT_TABLE(); - wxAuiManager m_mgr; CBreakPointView* m_BreakPointListView; CCodeWindow* m_pCodeWindow; diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 5abd5f606f..2a6f53fe5c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -58,19 +58,6 @@ enum IDM_ADDFUNCTION, }; -BEGIN_EVENT_TABLE(CCodeView, wxControl) - EVT_ERASE_BACKGROUND(CCodeView::OnErase) - EVT_PAINT(CCodeView::OnPaint) - EVT_MOUSEWHEEL(CCodeView::OnScrollWheel) - EVT_LEFT_DOWN(CCodeView::OnMouseDown) - EVT_LEFT_UP(CCodeView::OnMouseUpL) - EVT_MOTION(CCodeView::OnMouseMove) - EVT_RIGHT_DOWN(CCodeView::OnMouseDown) - EVT_RIGHT_UP(CCodeView::OnMouseUpR) - EVT_MENU(-1, CCodeView::OnPopupMenu) - EVT_SIZE(CCodeView::OnResize) -END_EVENT_TABLE() - CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, wxWindow* parent, wxWindowID Id) : wxControl(parent, Id), @@ -86,6 +73,16 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, m_lx(-1), m_ly(-1) { + Bind(wxEVT_ERASE_BACKGROUND, &CCodeView::OnErase, this); + Bind(wxEVT_PAINT, &CCodeView::OnPaint, this); + Bind(wxEVT_MOUSEWHEEL, &CCodeView::OnScrollWheel, this); + Bind(wxEVT_LEFT_DOWN, &CCodeView::OnMouseDown, this); + Bind(wxEVT_LEFT_UP, &CCodeView::OnMouseUpL, this); + Bind(wxEVT_MOTION, &CCodeView::OnMouseMove, this); + Bind(wxEVT_RIGHT_DOWN, &CCodeView::OnMouseDown, this); + Bind(wxEVT_RIGHT_UP, &CCodeView::OnMouseUpR, this); + Bind(wxEVT_MENU, &CCodeView::OnPopupMenu, this); + Bind(wxEVT_SIZE, &CCodeView::OnResize, this); } int CCodeView::YToAddress(int y) diff --git a/Source/Core/DolphinWX/Debugger/CodeView.h b/Source/Core/DolphinWX/Debugger/CodeView.h index 018d664122..7c200e854c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.h +++ b/Source/Core/DolphinWX/Debugger/CodeView.h @@ -95,6 +95,4 @@ private: bool m_selecting; int m_lx, m_ly; - - DECLARE_EVENT_TABLE() }; diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 4989cecff0..debf26345d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -60,35 +60,6 @@ extern "C" // Bitmaps #include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT } -class DebugInterface; - -// ------- -// Main - -BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) - - // Menu bar - EVT_MENU_RANGE(IDM_INTERPRETER, IDM_JITSROFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) - EVT_MENU_RANGE(IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) - EVT_MENU_RANGE(IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) - EVT_MENU_RANGE(IDM_PROFILEBLOCKS, IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) - - // Toolbar - EVT_MENU_RANGE(IDM_STEP, IDM_GOTOPC, CCodeWindow::OnCodeStep) - EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) - - // Other - EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) - EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) - EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) - EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) - - EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) - -END_EVENT_TABLE() - -// Class CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) : wxPanel(parent, id, position, size, style, name) @@ -109,23 +80,40 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter DebugInterface* di = &PowerPC::debug_interface; - codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW); + codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY); sizerBig->Add(sizerLeft, 2, wxEXPAND); sizerBig->Add(codeview, 5, wxEXPAND); - sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, - wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); - sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, - wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); - sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, - wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); - sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, - wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + sizerLeft->Add(callstack = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); + callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this); + + sizerLeft->Add(symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); + symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this); + + sizerLeft->Add(calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this); + + sizerLeft->Add(callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); SetSizer(sizerBig); sizerLeft->Fit(this); sizerBig->Fit(this); + + // Menu + Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JITSROFF); + Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONTPICKER); + Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION); + Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS); + Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILEBLOCKS, IDM_WRITEPROFILE); + + // Toolbar + Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC); + Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this, IDM_ADDRBOX); + + // Other + Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); } wxMenuBar *CCodeWindow::GetMenuBar() diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.h b/Source/Core/DolphinWX/Debugger/CodeWindow.h index c0ac8650ca..cdf82dcfb6 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.h +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.h @@ -108,16 +108,6 @@ public: int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1]; private: - enum - { - // Debugger GUI Objects - ID_CODEVIEW, - ID_CALLSTACKLIST, - ID_CALLERSLIST, - ID_CALLSLIST, - ID_SYMBOLLIST - }; - void OnSymbolListChange(wxCommandEvent& event); void OnSymbolListContextMenu(wxContextMenuEvent& event); void OnCallstackListChange(wxCommandEvent& event); @@ -143,6 +133,4 @@ private: wxListBox* callers; wxListBox* calls; Common::Event sync_event; - - DECLARE_EVENT_TABLE() }; diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 917945522e..830bfe97a3 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -33,23 +33,16 @@ #include "DolphinWX/Debugger/DSPRegisterView.h" #include "DolphinWX/Debugger/MemoryView.h" -class wxWindow; - static DSPDebuggerLLE* m_DebuggerFrame = nullptr; -BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) - EVT_CLOSE(DSPDebuggerLLE::OnClose) - EVT_MENU_RANGE(ID_RUNTOOL, ID_SHOWPCTOOL, DSPDebuggerLLE::OnChangeState) - EVT_TEXT_ENTER(ID_ADDRBOX, DSPDebuggerLLE::OnAddrBoxChange) - EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange) -END_EVENT_TABLE() - - DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("DSP LLE Debugger")) , m_CachedStepCounter(-1) { + Bind(wxEVT_CLOSE_WINDOW, &DSPDebuggerLLE::OnClose, this); + Bind(wxEVT_MENU, &DSPDebuggerLLE::OnChangeState, this, ID_RUNTOOL, ID_SHOWPCTOOL); + m_DebuggerFrame = this; // notify wxAUI which frame to use @@ -65,12 +58,16 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_Toolbar->AddTool(ID_SHOWPCTOOL, _("Show PC"), wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10))); m_Toolbar->AddSeparator(); - m_Toolbar->AddControl(new wxTextCtrl(m_Toolbar, ID_ADDRBOX, wxEmptyString, - wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER)); + + m_addr_txtctrl = new wxTextCtrl(m_Toolbar, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); + m_addr_txtctrl->Bind(wxEVT_TEXT_ENTER, &DSPDebuggerLLE::OnAddrBoxChange, this); + + m_Toolbar->AddControl(m_addr_txtctrl); m_Toolbar->Realize(); - m_SymbolList = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, + m_SymbolList = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(140, 100), 0, nullptr, wxLB_SORT); + m_SymbolList->Bind(wxEVT_LISTBOX, &DSPDebuggerLLE::OnSymbolListChange, this); m_MainNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -253,8 +250,7 @@ void DSPDebuggerLLE::UpdateRegisterFlags() void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) { - wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX); - wxString txt = pAddrCtrl->GetValue(); + wxString txt = m_addr_txtctrl->GetValue(); auto text = StripSpaces(WxStrToStr(txt)); if (text.size()) @@ -262,9 +258,9 @@ void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) u32 addr; sscanf(text.c_str(), "%04x", &addr); if (JumpToAddress(addr)) - pAddrCtrl->SetBackgroundColour(*wxWHITE); + m_addr_txtctrl->SetBackgroundColour(*wxWHITE); else - pAddrCtrl->SetBackgroundColour(*wxRED); + m_addr_txtctrl->SetBackgroundColour(*wxRED); } event.Skip(); } diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h index 65751f093c..148914109d 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h @@ -30,16 +30,12 @@ public: void Update() override; private: - DECLARE_EVENT_TABLE(); - enum { ID_TOOLBAR = 1000, ID_RUNTOOL, ID_STEPTOOL, ID_SHOWPCTOOL, - ID_ADDRBOX, - ID_SYMBOLLIST, ID_DSP_REGS }; @@ -59,6 +55,7 @@ private: CMemoryView* m_MemView; DSPRegisterView* m_Regs; wxListBox* m_SymbolList; + wxTextCtrl* m_addr_txtctrl; wxAuiNotebook* m_MainNotebook; void OnClose(wxCloseEvent& event); diff --git a/Source/Core/DolphinWX/Debugger/JitWindow.cpp b/Source/Core/DolphinWX/Debugger/JitWindow.cpp index 052f38cf04..71a9840af4 100644 --- a/Source/Core/DolphinWX/Debugger/JitWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/JitWindow.cpp @@ -170,43 +170,24 @@ std::string HostDisassemblerX86::DisassembleHostBlock(const u8* code_start, cons return x86_disasm.str(); } -enum -{ - IDM_REFRESH_LIST = 23350, - IDM_PPC_BOX, - IDM_X86_BOX, - IDM_NEXT, - IDM_PREV, - IDM_BLOCKLIST, -}; - -BEGIN_EVENT_TABLE(CJitWindow, wxPanel) - //EVT_TEXT(IDM_ADDRBOX, CJitWindow::OnAddrBoxChange) - //EVT_LISTBOX(IDM_SYMBOLLIST, CJitWindow::OnSymbolListChange) - //EVT_HOST_COMMAND(wxID_ANY, CJitWindow::OnHostMessage) - EVT_BUTTON(IDM_REFRESH_LIST, CJitWindow::OnRefresh) -END_EVENT_TABLE() - CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxPanel(parent, id, pos, size, style, name) { wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL); - sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, "(ppc)", + sizerSplit->Add(ppc_box = new wxTextCtrl(this, wxID_ANY, "(ppc)", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND); - sizerSplit->Add(x86_box = new wxTextCtrl(this, IDM_X86_BOX, "(x86)", + sizerSplit->Add(x86_box = new wxTextCtrl(this, wxID_ANY, "(x86)", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND); - sizerBig->Add(block_list = new JitBlockList(this, IDM_BLOCKLIST, + sizerBig->Add(block_list = new JitBlockList(this, wxID_ANY, wxDefaultPosition, wxSize(100, 140), wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING), 0, wxEXPAND); sizerBig->Add(sizerSplit, 2, wxEXPAND); - // sizerBig->Add(memview, 5, wxEXPAND); - // sizerBig->Add(sizerRight, 0, wxEXPAND | wxALL, 3); - sizerBig->Add(button_refresh = new wxButton(this, IDM_REFRESH_LIST, _("&Refresh"))); - // sizerRight->Add(addrbox = new wxTextCtrl(this, IDM_ADDRBOX, "")); - // sizerRight->Add(new wxButton(this, IDM_SETPC, _("S&et PC"))); + + sizerBig->Add(button_refresh = new wxButton(this, wxID_ANY, _("&Refresh"))); + button_refresh->Bind(wxEVT_BUTTON, &CJitWindow::OnRefresh, this); SetSizer(sizerBig); diff --git a/Source/Core/DolphinWX/Debugger/JitWindow.h b/Source/Core/DolphinWX/Debugger/JitWindow.h index d7d36de7cd..3e3632cf22 100644 --- a/Source/Core/DolphinWX/Debugger/JitWindow.h +++ b/Source/Core/DolphinWX/Debugger/JitWindow.h @@ -77,8 +77,6 @@ private: wxTextCtrl* x86_box; wxListBox* top_instructions; - DECLARE_EVENT_TABLE() - void OnSymbolListChange(wxCommandEvent& event); void OnCallstackListChange(wxCommandEvent& event); void OnAddrBoxChange(wxCommandEvent& event); diff --git a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp index ca2d9a812e..c1cc1dedb5 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp @@ -25,14 +25,12 @@ #define TEXT_BOX(text) new wxStaticText(this, wxID_ANY, _(text)) -BEGIN_EVENT_TABLE(MemoryCheckDlg, wxDialog) - EVT_BUTTON(wxID_OK, MemoryCheckDlg::OnOK) -END_EVENT_TABLE() - MemoryCheckDlg::MemoryCheckDlg(CBreakPointWindow *parent) : wxDialog(parent, wxID_ANY, _("Memory Check")) , m_parent(parent) { + Bind(wxEVT_BUTTON, &MemoryCheckDlg::OnOK, this); + m_pEditStartAddress = new wxTextCtrl(this, wxID_ANY, ""); m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY, ""); m_pWriteFlag = new wxCheckBox(this, wxID_ANY, _("Write")); diff --git a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.h b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.h index 3a725f9717..f6ff3c258d 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.h +++ b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.h @@ -26,6 +26,4 @@ private: wxTextCtrl* m_pEditStartAddress; void OnOK(wxCommandEvent& event); - - DECLARE_EVENT_TABLE(); }; diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 4effea6520..d690f1f56d 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -48,17 +48,6 @@ enum IDM_VIEWASHEX, }; -BEGIN_EVENT_TABLE(CMemoryView, wxControl) - EVT_PAINT(CMemoryView::OnPaint) - EVT_LEFT_DOWN(CMemoryView::OnMouseDownL) - EVT_LEFT_UP(CMemoryView::OnMouseUpL) - EVT_MOTION(CMemoryView::OnMouseMove) - EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR) - EVT_MOUSEWHEEL(CMemoryView::OnScrollWheel) - EVT_MENU(-1, CMemoryView::OnPopupMenu) - EVT_SIZE(CMemoryView::OnResize) -END_EVENT_TABLE() - CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent) : wxControl(parent, wxID_ANY) , curAddress(debuginterface->GetPC()) @@ -71,6 +60,14 @@ CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent) , memory(0) , viewAsType(VIEWAS_FP) { + Bind(wxEVT_PAINT, &CMemoryView::OnPaint, this); + Bind(wxEVT_LEFT_DOWN, &CMemoryView::OnMouseDownL, this); + Bind(wxEVT_LEFT_UP, &CMemoryView::OnMouseUpL, this); + Bind(wxEVT_MOTION, &CMemoryView::OnMouseMove, this); + Bind(wxEVT_RIGHT_DOWN, &CMemoryView::OnMouseDownR, this); + Bind(wxEVT_MOUSEWHEEL, &CMemoryView::OnScrollWheel, this); + Bind(wxEVT_MENU, &CMemoryView::OnPopupMenu, this); + Bind(wxEVT_SIZE, &CMemoryView::OnResize, this); } int CMemoryView::YToAddress(int y) diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.h b/Source/Core/DolphinWX/Debugger/MemoryView.h index 4541f9e1b8..a098d2d291 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.h +++ b/Source/Core/DolphinWX/Debugger/MemoryView.h @@ -58,6 +58,4 @@ private: }; EViewAsType viewAsType; - - DECLARE_EVENT_TABLE() }; diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.cpp b/Source/Core/DolphinWX/Debugger/RegisterView.cpp index 928a709f88..cb5594a487 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.cpp +++ b/Source/Core/DolphinWX/Debugger/RegisterView.cpp @@ -255,6 +255,9 @@ CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id) SetColLabelSize(0); DisableDragRowSize(); + Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CRegisterView::OnMouseDownR, this); + Bind(wxEVT_MENU, &CRegisterView::OnPopupMenu, this); + AutoSizeColumns(); } diff --git a/Source/Core/DolphinWX/Debugger/RegisterWindow.cpp b/Source/Core/DolphinWX/Debugger/RegisterWindow.cpp index 2e3d2611dd..581ba0ed91 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/RegisterWindow.cpp @@ -15,14 +15,6 @@ #include "DolphinWX/Debugger/RegisterView.h" #include "DolphinWX/Debugger/RegisterWindow.h" -class wxWindow; - -BEGIN_EVENT_TABLE(CRegisterWindow, wxPanel) -EVT_GRID_CELL_RIGHT_CLICK(CRegisterView::OnMouseDownR) -EVT_MENU(-1, CRegisterView::OnPopupMenu) -END_EVENT_TABLE() - - CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) diff --git a/Source/Core/DolphinWX/Debugger/RegisterWindow.h b/Source/Core/DolphinWX/Debugger/RegisterWindow.h index f0b38b84b7..6bd4b0c73e 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterWindow.h +++ b/Source/Core/DolphinWX/Debugger/RegisterWindow.h @@ -15,8 +15,7 @@ class CRegisterView; class wxWindow; -class CRegisterWindow - : public wxPanel +class CRegisterWindow : public wxPanel { public: CRegisterWindow(wxWindow* parent, @@ -28,10 +27,7 @@ public: void NotifyUpdate(); - private: - DECLARE_EVENT_TABLE(); - enum { ID_GPR = 1002 diff --git a/Source/Core/DolphinWX/Debugger/WatchView.cpp b/Source/Core/DolphinWX/Debugger/WatchView.cpp index cc59c57a52..34c427579d 100644 --- a/Source/Core/DolphinWX/Debugger/WatchView.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchView.cpp @@ -221,6 +221,9 @@ CWatchView::CWatchView(wxWindow* parent, wxWindowID id) SetRowLabelSize(0); SetColLabelSize(0); DisableDragRowSize(); + + Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CWatchView::OnMouseDownR, this); + Bind(wxEVT_MENU, &CWatchView::OnPopupMenu, this); } void CWatchView::Update() diff --git a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp index ef192b7419..9d5b7191bf 100644 --- a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp @@ -26,13 +26,6 @@ extern "C" { #include "DolphinWX/resources/toolbar_debugger_delete.c" } -class wxWindow; - -BEGIN_EVENT_TABLE(CWatchWindow, wxPanel) -EVT_GRID_CELL_RIGHT_CLICK(CWatchView::OnMouseDownR) -EVT_MENU(-1, CWatchView::OnPopupMenu) -END_EVENT_TABLE() - class CWatchToolbar : public wxAuiToolBar { public: diff --git a/Source/Core/DolphinWX/Debugger/WatchWindow.h b/Source/Core/DolphinWX/Debugger/WatchWindow.h index 8c070768cd..fe5b3ef2a5 100644 --- a/Source/Core/DolphinWX/Debugger/WatchWindow.h +++ b/Source/Core/DolphinWX/Debugger/WatchWindow.h @@ -16,8 +16,7 @@ class CWatchView; class wxWindow; -class CWatchWindow - : public wxPanel +class CWatchWindow : public wxPanel { public: CWatchWindow(wxWindow* parent, @@ -35,8 +34,6 @@ public: void LoadAll(); private: - DECLARE_EVENT_TABLE(); - wxAuiManager m_mgr; enum diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index d3a1afd011..371161abc1 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -229,7 +229,7 @@ bool CRenderFrame::ShowFullScreen(bool show, long style) // Notice that wxID_HELP will be processed for the 'About' menu and the toolbar // help button. -const wxEventType wxEVT_HOST_COMMAND = wxNewEventType(); +wxDEFINE_EVENT(wxEVT_HOST_COMMAND, wxCommandEvent); BEGIN_EVENT_TABLE(CFrame, CRenderFrame) diff --git a/Source/Core/DolphinWX/Globals.h b/Source/Core/DolphinWX/Globals.h index d8b83bd400..68902eede5 100644 --- a/Source/Core/DolphinWX/Globals.h +++ b/Source/Core/DolphinWX/Globals.h @@ -292,4 +292,4 @@ enum (wxObject*) nullptr \ ), -extern const wxEventType wxEVT_HOST_COMMAND; +wxDECLARE_EVENT(wxEVT_HOST_COMMAND, wxCommandEvent);