diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.cpp b/Source/Core/DolphinWX/Src/CheatsWindow.cpp index dec6648461..63ddced86b 100644 --- a/Source/Core/DolphinWX/Src/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/Src/CheatsWindow.cpp @@ -25,8 +25,6 @@ #include "HW/Memmap.h" #include "Frame.h" -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) - #define MAX_CHEAT_SEARCH_RESULTS_DISPLAY 256 extern std::vector arCodes; @@ -80,8 +78,8 @@ void wxCheatsWindow::Init_ChildControls() m_Tab_Cheats = new wxPanel(m_Notebook_Main, wxID_ANY, wxDefaultPosition, wxDefaultSize); m_CheckListBox_CheatsList = new wxCheckListBox(m_Tab_Cheats, wxID_ANY, wxDefaultPosition, wxSize(300, 0), m_CheatStringList, wxLB_HSCROLL, wxDefaultValidator); - _connect_macro_(m_CheckListBox_CheatsList, wxCheatsWindow::OnEvent_CheatsList_ItemSelected, wxEVT_COMMAND_LISTBOX_SELECTED, this); - _connect_macro_(m_CheckListBox_CheatsList, wxCheatsWindow::OnEvent_CheatsList_ItemToggled, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this); + m_CheckListBox_CheatsList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &wxCheatsWindow::OnEvent_CheatsList_ItemSelected, this); + m_CheckListBox_CheatsList->Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, &wxCheatsWindow::OnEvent_CheatsList_ItemToggled, this); m_Label_Codename = new wxStaticText(m_Tab_Cheats, wxID_ANY, _("Name: "), wxDefaultPosition, wxDefaultSize); m_GroupBox_Info = new wxStaticBox(m_Tab_Cheats, wxID_ANY, _("Code Info"), wxDefaultPosition, wxDefaultSize); @@ -107,10 +105,10 @@ void wxCheatsWindow::Init_ChildControls() m_Tab_Log = new wxPanel(m_Notebook_Main, wxID_ANY, wxDefaultPosition, wxDefaultSize); wxButton* const button_updatelog = new wxButton(m_Tab_Log, wxID_ANY, _("Update")); - _connect_macro_(button_updatelog, wxCheatsWindow::OnEvent_ButtonUpdateLog_Press, wxEVT_COMMAND_BUTTON_CLICKED, this); + button_updatelog->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &wxCheatsWindow::OnEvent_ButtonUpdateLog_Press, this); m_CheckBox_LogAR = new wxCheckBox(m_Tab_Log, wxID_ANY, _("Enable AR Logging")); - _connect_macro_(m_CheckBox_LogAR, wxCheatsWindow::OnEvent_CheckBoxEnableLogging_StateChange, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + m_CheckBox_LogAR->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &wxCheatsWindow::OnEvent_CheckBoxEnableLogging_StateChange, this); m_CheckBox_LogAR->SetValue(ActionReplay::IsSelfLogging()); m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(100, -1), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP); @@ -134,11 +132,11 @@ void wxCheatsWindow::Init_ChildControls() // Button Strip wxButton* const button_apply = new wxButton(panel, wxID_APPLY, _("Apply"), wxDefaultPosition, wxDefaultSize); - _connect_macro_(button_apply, wxCheatsWindow::OnEvent_ApplyChanges_Press, wxEVT_COMMAND_BUTTON_CLICKED, this); + button_apply->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &wxCheatsWindow::OnEvent_ApplyChanges_Press, this); wxButton* const button_cancel = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize); - _connect_macro_(button_cancel, wxCheatsWindow::OnEvent_ButtonClose_Press, wxEVT_COMMAND_BUTTON_CLICKED, this); + button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &wxCheatsWindow::OnEvent_ButtonClose_Press, this); - Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(wxCheatsWindow::OnEvent_Close), (wxObject*)0, this); + Bind(wxEVT_CLOSE_WINDOW, &wxCheatsWindow::OnEvent_Close, this); wxStdDialogButtonSizer* const sButtons = new wxStdDialogButtonSizer(); sButtons->AddButton(button_apply); @@ -160,11 +158,11 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) { // first scan button btnInitScan = new wxButton(this, -1, _("New Scan")); - _connect_macro_(btnInitScan, CheatSearchTab::StartNewSearch, wxEVT_COMMAND_BUTTON_CLICKED, this); + btnInitScan->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CheatSearchTab::StartNewSearch, this); // next scan button btnNextScan = new wxButton(this, -1, _("Next Scan")); - _connect_macro_(btnNextScan, CheatSearchTab::FilterCheatSearchResults, wxEVT_COMMAND_BUTTON_CLICKED, this); + btnNextScan->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CheatSearchTab::FilterCheatSearchResults, this); btnNextScan->Disable(); // data size radio buttons @@ -185,7 +183,7 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) // create AR code button wxButton* const button_cheat_search_copy_address = new wxButton(this, -1, _("Create AR Code")); - _connect_macro_(button_cheat_search_copy_address, CheatSearchTab::CreateARCode, wxEVT_COMMAND_BUTTON_CLICKED, this); + button_cheat_search_copy_address->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CheatSearchTab::CreateARCode, this); // results groupbox wxStaticBoxSizer* const sizer_cheat_search_results = new wxStaticBoxSizer(wxVERTICAL, this, _("Results")); @@ -200,7 +198,7 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) // search value textbox textctrl_value_x = new wxTextCtrl(this, -1, wxT("0x0"), wxDefaultPosition, wxSize(96,-1)); - _connect_macro_(textctrl_value_x, CheatSearchTab::ApplyFocus, wxEVT_SET_FOCUS, this); + textctrl_value_x->Bind(wxEVT_SET_FOCUS, &CheatSearchTab::ApplyFocus, this); wxBoxSizer* const sizer_cheat_filter_text = new wxBoxSizer(wxHORIZONTAL); sizer_cheat_filter_text->Add(value_x_radiobtn.rad_uservalue, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5); @@ -495,7 +493,7 @@ void CheatSearchTab::FilterCheatSearchResults(wxCommandEvent&) UpdateCheatSearchResultsList(); } -void CheatSearchTab::ApplyFocus(wxCommandEvent& ev) +void CheatSearchTab::ApplyFocus(wxEvent& ev) { ev.Skip(true); value_x_radiobtn.rad_uservalue->SetValue(true); @@ -590,9 +588,9 @@ CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address) sizer_main->Add(textctrl_value, 0, wxALL, 5); sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxALL, 5); - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CreateCodeDialog::PressOK)); - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CreateCodeDialog::PressCancel)); - Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(CreateCodeDialog::OnEvent_Close), (wxObject*)0, this); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CreateCodeDialog::PressOK, this, wxID_OK); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CreateCodeDialog::PressCancel, this, wxID_CANCEL); + Bind(wxEVT_CLOSE_WINDOW, &CreateCodeDialog::OnEvent_Close, this); SetSizerAndFit(sizer_main); SetFocus(); diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.h b/Source/Core/DolphinWX/Src/CheatsWindow.h index 9d44e878f3..f1acc1c118 100644 --- a/Source/Core/DolphinWX/Src/CheatsWindow.h +++ b/Source/Core/DolphinWX/Src/CheatsWindow.h @@ -99,7 +99,7 @@ protected: void StartNewSearch(wxCommandEvent& event); void FilterCheatSearchResults(wxCommandEvent& event); void CreateARCode(wxCommandEvent&); - void ApplyFocus(wxCommandEvent&); + void ApplyFocus(wxEvent&); }; class wxCheatsWindow : public wxDialog diff --git a/Source/Core/DolphinWX/Src/Debugger/BreakpointWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/BreakpointWindow.cpp index 7d40e820f2..35f957d71a 100644 --- a/Source/Core/DolphinWX/Src/Debugger/BreakpointWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/BreakpointWindow.cpp @@ -31,13 +31,10 @@ extern "C" { #include "../../resources/toolbar_debugger_delete.c" } -#define _connect_macro_(id, handler) \ - Connect(id, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(handler), (wxObject*)0, (wxEvtHandler*)parent) - class CBreakPointBar : public wxAuiToolBar { public: - CBreakPointBar(wxWindow* parent, const wxWindowID id) + CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id) : wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT) { @@ -51,26 +48,26 @@ public: wxBitmap(wxGetBitmapFromMemory(toolbar_add_memcheck_png).ConvertToImage().Rescale(24, 24)); AddTool(ID_DELETE, wxT("Delete"), m_Bitmaps[Toolbar_Delete]); - _connect_macro_(ID_DELETE, CBreakPointWindow::OnDelete); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnDelete, parent, ID_DELETE); AddTool(ID_CLEAR, wxT("Clear"), m_Bitmaps[Toolbar_Delete]); - _connect_macro_(ID_CLEAR, CBreakPointWindow::OnClear); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnClear, parent, ID_CLEAR); AddTool(ID_ADDBP, wxT("+BP"), m_Bitmaps[Toolbar_Add_BP]); - _connect_macro_(ID_ADDBP, CBreakPointWindow::OnAddBreakPoint); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnAddBreakPoint, parent, ID_ADDBP); // Add memory breakpoints if you can use them if (Memory::AreMemoryBreakpointsActivated()) { AddTool(ID_ADDMC, wxT("+MC"), m_Bitmaps[Toolbar_Add_MC]); - _connect_macro_(ID_ADDMC, CBreakPointWindow::OnAddMemoryCheck); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC); } AddTool(ID_LOAD, wxT("Load"), m_Bitmaps[Toolbar_Delete]); - _connect_macro_(ID_LOAD, CBreakPointWindow::LoadAll); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::LoadAll, parent, ID_LOAD); AddTool(ID_SAVE, wxT("Save"), m_Bitmaps[Toolbar_Delete]); - _connect_macro_(ID_SAVE, CBreakPointWindow::Event_SaveAll); + Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE); } private: diff --git a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp index 160aaf211a..d33f507282 100644 --- a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp +++ b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp @@ -56,24 +56,24 @@ FifoPlayerDlg::FifoPlayerDlg(wxWindow * const parent) : FifoPlayerDlg::~FifoPlayerDlg() { - Disconnect(RECORDING_FINISHED_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnRecordingFinished), NULL, this); - Disconnect(FRAME_WRITTEN_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnFrameWritten), NULL, this); + Unbind(RECORDING_FINISHED_EVENT, &FifoPlayerDlg::OnRecordingFinished, this); + Unbind(FRAME_WRITTEN_EVENT, &FifoPlayerDlg::OnFrameWritten, this); // Disconnect Events - Disconnect(wxEVT_PAINT, wxPaintEventHandler(FifoPlayerDlg::OnPaint), NULL, this); - m_FrameFromCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameFrom), NULL, this); - m_FrameToCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameTo), NULL, this); - m_ObjectFromCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectFrom), NULL, this); - m_ObjectToCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectTo), NULL, this); - m_EarlyMemoryUpdates->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCheckEarlyMemoryUpdates), NULL, this); - m_RecordStop->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnRecordStop), NULL, this); - m_Save->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnSaveFile), NULL, this); - m_FramesToRecordCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnNumFramesToRecord), NULL, this); - m_Close->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCloseClick), NULL, this); + Unbind(wxEVT_PAINT, &FifoPlayerDlg::OnPaint, this); + m_FrameFromCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameFrom, this); + m_FrameToCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameTo, this); + m_ObjectFromCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectFrom, this); + m_ObjectToCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectTo, this); + m_EarlyMemoryUpdates->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &FifoPlayerDlg::OnCheckEarlyMemoryUpdates, this); + m_RecordStop->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnRecordStop, this); + m_Save->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnSaveFile, this); + m_FramesToRecordCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnNumFramesToRecord, this); + m_Close->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnCloseClick, this); - m_framesList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnFrameListSelectionChanged), NULL, this); - m_objectsList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectListSelectionChanged), NULL, this); - m_objectCmdList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectCmdListSelectionChanged), NULL, this); + m_framesList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnFrameListSelectionChanged, this); + m_objectsList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectListSelectionChanged, this); + m_objectCmdList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectCmdListSelectionChanged, this); FifoPlayer::GetInstance().SetFrameWrittenCallback(NULL); @@ -306,37 +306,37 @@ void FifoPlayerDlg::CreateGUIControls() Center(wxBOTH); // Connect Events - Connect(wxEVT_PAINT, wxPaintEventHandler(FifoPlayerDlg::OnPaint)); - m_FrameFromCtrl->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameFrom), NULL, this); - m_FrameToCtrl->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameTo), NULL, this); - m_ObjectFromCtrl->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectFrom), NULL, this); - m_ObjectToCtrl->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectTo), NULL, this); - m_EarlyMemoryUpdates->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCheckEarlyMemoryUpdates), NULL, this); - m_RecordStop->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnRecordStop), NULL, this); - m_Save->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnSaveFile), NULL, this); - m_FramesToRecordCtrl->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnNumFramesToRecord), NULL, this); - Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCloseClick), NULL, this); + Bind(wxEVT_PAINT, &FifoPlayerDlg::OnPaint, this); + m_FrameFromCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameFrom, this); + m_FrameToCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameTo, this); + m_ObjectFromCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectFrom, this); + m_ObjectToCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectTo, this); + m_EarlyMemoryUpdates->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &FifoPlayerDlg::OnCheckEarlyMemoryUpdates, this); + m_RecordStop->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnRecordStop, this); + m_Save->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnSaveFile, this); + m_FramesToRecordCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnNumFramesToRecord, this); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnCloseClick, this); - m_framesList->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnFrameListSelectionChanged), NULL, this); - m_objectsList->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectListSelectionChanged), NULL, this); - m_objectCmdList->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectCmdListSelectionChanged), NULL, this); + m_framesList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnFrameListSelectionChanged, this); + m_objectsList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectListSelectionChanged, this); + m_objectCmdList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectCmdListSelectionChanged, this); - m_beginSearch->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnBeginSearch), NULL, this); - m_findNext->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnFindNextClick), NULL, this); - m_findPrevious->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnFindPreviousClick), NULL, this); + m_beginSearch->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnBeginSearch, this); + m_findNext->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnFindNextClick, this); + m_findPrevious->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnFindPreviousClick, this); - m_searchField->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(FifoPlayerDlg::OnBeginSearch), NULL, this); - m_searchField->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FifoPlayerDlg::OnSearchFieldTextChanged), NULL, this); + m_searchField->Bind(wxEVT_COMMAND_TEXT_ENTER, &FifoPlayerDlg::OnBeginSearch, this); + m_searchField->Bind(wxEVT_COMMAND_TEXT_UPDATED, &FifoPlayerDlg::OnSearchFieldTextChanged, this); // Setup command copying wxAcceleratorEntry entry; entry.Set(wxACCEL_CTRL, (int)'C', wxID_COPY); wxAcceleratorTable accel(1, &entry); m_objectCmdList->SetAcceleratorTable(accel); - m_objectCmdList->Connect(wxID_COPY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectCmdListSelectionCopy), NULL, this); + m_objectCmdList->Bind(wxEVT_COMMAND_MENU_SELECTED, &FifoPlayerDlg::OnObjectCmdListSelectionCopy, this, wxID_COPY); - Connect(RECORDING_FINISHED_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnRecordingFinished), NULL, this); - Connect(FRAME_WRITTEN_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnFrameWritten), NULL, this); + Bind(RECORDING_FINISHED_EVENT, &FifoPlayerDlg::OnRecordingFinished, this); + Bind(FRAME_WRITTEN_EVENT, &FifoPlayerDlg::OnFrameWritten, this); Show(); } @@ -784,7 +784,7 @@ void FifoPlayerDlg::OnCloseClick(wxCommandEvent& WXUNUSED(event)) Hide(); } -void FifoPlayerDlg::OnRecordingFinished(wxCommandEvent& WXUNUSED(event)) +void FifoPlayerDlg::OnRecordingFinished(wxEvent&) { m_RecordStop->SetLabel(_("Record")); m_RecordStop->Enable(); @@ -792,7 +792,7 @@ void FifoPlayerDlg::OnRecordingFinished(wxCommandEvent& WXUNUSED(event)) UpdateRecorderGui(); } -void FifoPlayerDlg::OnFrameWritten(wxCommandEvent& WXUNUSED(event)) +void FifoPlayerDlg::OnFrameWritten(wxEvent&) { m_CurrentFrameLabel->SetLabel(CreateCurrentFrameLabel()); m_NumObjectsLabel->SetLabel(CreateFileObjectCountLabel()); diff --git a/Source/Core/DolphinWX/Src/FifoPlayerDlg.h b/Source/Core/DolphinWX/Src/FifoPlayerDlg.h index eb5f9a33e9..f00af6119b 100644 --- a/Source/Core/DolphinWX/Src/FifoPlayerDlg.h +++ b/Source/Core/DolphinWX/Src/FifoPlayerDlg.h @@ -51,8 +51,8 @@ private: void OnSearchFieldTextChanged(wxCommandEvent& event); void ChangeSearchResult(unsigned int result_idx); - void OnRecordingFinished(wxCommandEvent& event); - void OnFrameWritten(wxCommandEvent& event); + void OnRecordingFinished(wxEvent& event); + void OnFrameWritten(wxEvent& event); void OnFrameListSelectionChanged(wxCommandEvent& event); void OnObjectListSelectionChanged(wxCommandEvent& event); diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 750696f6c7..e45544c5eb 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -424,9 +424,7 @@ CFrame::CFrame(wxFrame* parent, // ------------------------- // Connect event handlers - m_Mgr->Connect(wxID_ANY, wxEVT_AUI_RENDER, // Resize - wxAuiManagerEventHandler(CFrame::OnManagerResize), - (wxObject*)0, this); + m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this); // ---------- // Update controls diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index 503d6994af..0550c5cd39 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -1004,15 +1004,11 @@ wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, m_MainSizer->Add(Child, 1, wxEXPAND); - Frame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, - wxCloseEventHandler(CFrame::OnFloatingPageClosed), - (wxObject*)0, this); + Frame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnFloatingPageClosed, this); if (Id == IDM_CONSOLEWINDOW_PARENT) { - Frame->Connect(wxID_ANY, wxEVT_SIZE, - wxSizeEventHandler(CFrame::OnFloatingPageSize), - (wxObject*)0, this); + Frame->Bind(wxEVT_SIZE, &CFrame::OnFloatingPageSize, this); } // Main sizer diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index d4cf35b121..6846150359 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -958,15 +958,9 @@ void CFrame::StartGame(const std::string& filename) wxSize size(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight); m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight()); - m_RenderFrame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, - wxCloseEventHandler(CFrame::OnRenderParentClose), - (wxObject*)0, this); - m_RenderFrame->Connect(wxID_ANY, wxEVT_ACTIVATE, - wxActivateEventHandler(CFrame::OnActive), - (wxObject*)0, this); - m_RenderFrame->Connect(wxID_ANY, wxEVT_MOVE, - wxMoveEventHandler(CFrame::OnRenderParentMove), - (wxObject*)0, this); + m_RenderFrame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnRenderParentClose, this); + m_RenderFrame->Bind(wxEVT_ACTIVATE, &CFrame::OnActive, this); + m_RenderFrame->Bind(wxEVT_MOVE, &CFrame::OnRenderParentMove, this); m_RenderParent = new CPanel(m_RenderFrame, wxID_ANY); m_RenderFrame->Show(); } @@ -999,30 +993,14 @@ void CFrame::StartGame(const std::string& filename) m_RenderParent->SetFocus(); #endif - wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(CFrame::OnKeyDown), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_KEY_UP, - wxKeyEventHandler(CFrame::OnKeyUp), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, // Mouse - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_RIGHT_UP, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_MIDDLE_DOWN, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_MIDDLE_UP, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Connect(wxID_ANY, wxEVT_MOTION, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - m_RenderParent->Connect(wxID_ANY, wxEVT_SIZE, - wxSizeEventHandler(CFrame::OnRenderParentResize), - (wxObject*)0, this); + wxTheApp->Bind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this); + wxTheApp->Bind(wxEVT_KEY_UP, &CFrame::OnKeyUp, this); + wxTheApp->Bind(wxEVT_RIGHT_DOWN, &CFrame::OnMouse, this); + wxTheApp->Bind(wxEVT_RIGHT_UP, &CFrame::OnMouse, this); + wxTheApp->Bind(wxEVT_MIDDLE_DOWN, &CFrame::OnMouse, this); + wxTheApp->Bind(wxEVT_MIDDLE_UP, &CFrame::OnMouse, this); + wxTheApp->Bind(wxEVT_MOTION, &CFrame::OnMouse, this); + m_RenderParent->Bind(wxEVT_SIZE, &CFrame::OnRenderParentResize, this); } wxEndBusyCursor(); @@ -1125,30 +1103,18 @@ void CFrame::DoStop() m_RenderFrame->SetTitle(wxString::FromAscii(scm_rev_str)); // Destroy the renderer frame when not rendering to main - m_RenderParent->Disconnect(wxID_ANY, wxEVT_SIZE, - wxSizeEventHandler(CFrame::OnRenderParentResize), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(CFrame::OnKeyDown), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_UP, - wxKeyEventHandler(CFrame::OnKeyUp), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_RIGHT_DOWN, // Mouse - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_RIGHT_UP, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_MIDDLE_DOWN, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_MIDDLE_UP, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); - wxTheApp->Disconnect(wxID_ANY, wxEVT_MOTION, - wxMouseEventHandler(CFrame::OnMouse), - (wxObject*)0, this); + m_RenderParent->Unbind(wxEVT_SIZE, &CFrame::OnRenderParentResize, this); + + // Keyboard + wxTheApp->Unbind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this); + wxTheApp->Unbind(wxEVT_KEY_UP, &CFrame::OnKeyUp, this); + + // Mouse + wxTheApp->Unbind(wxEVT_RIGHT_DOWN, &CFrame::OnMouse, this); + wxTheApp->Unbind(wxEVT_RIGHT_UP, &CFrame::OnMouse, this); + wxTheApp->Unbind(wxEVT_MIDDLE_DOWN, &CFrame::OnMouse, this); + wxTheApp->Unbind(wxEVT_MIDDLE_UP, &CFrame::OnMouse, this); + wxTheApp->Unbind(wxEVT_MOTION, &CFrame::OnMouse, this); if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) m_RenderParent->SetCursor(wxNullCursor); DoFullscreen(false); diff --git a/Source/Core/DolphinWX/Src/GCMicDlg.cpp b/Source/Core/DolphinWX/Src/GCMicDlg.cpp index 1cdd166cf5..ddf804b57b 100644 --- a/Source/Core/DolphinWX/Src/GCMicDlg.cpp +++ b/Source/Core/DolphinWX/Src/GCMicDlg.cpp @@ -56,9 +56,7 @@ void GCMicDialog::SaveButtonMapping(int Id, int Key, int Modkey) void GCMicDialog::EndGetButtons(void) { - wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(GCMicDialog::OnKeyDown), - (wxObject*)0, this); + wxTheApp->Unbind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this); m_ButtonMappingTimer->Stop(); GetButtonWaitingTimer = 0; GetButtonWaitingID = 0; @@ -153,9 +151,7 @@ void GCMicDialog::OnButtonClick(wxCommandEvent& event) if (m_ButtonMappingTimer->IsRunning()) return; - wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(GCMicDialog::OnKeyDown), - (wxObject*)0, this); + wxTheApp->Bind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this); // Get the button ClickedButton = (wxButton *)event.GetEventObject(); diff --git a/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp b/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp index cffeb25e7f..e015c55ae8 100644 --- a/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp +++ b/Source/Core/DolphinWX/Src/GeckoCodeDiag.cpp @@ -18,8 +18,6 @@ #include -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) - namespace Gecko { @@ -31,8 +29,8 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize) { m_listbox_gcodes = new wxCheckListBox(this, -1, wxDefaultPosition, wxDefaultSize); - _connect_macro_(m_listbox_gcodes, CodeConfigPanel::UpdateInfoBox, wxEVT_COMMAND_LISTBOX_SELECTED, this); - _connect_macro_(m_listbox_gcodes, CodeConfigPanel::ToggleCode, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this); + m_listbox_gcodes->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &CodeConfigPanel::UpdateInfoBox, this); + m_listbox_gcodes->Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, &CodeConfigPanel::ToggleCode, this); m_infobox.label_name = new wxStaticText(this, -1, wxGetTranslation(wxstr_name)); m_infobox.label_creator = new wxStaticText(this, -1, wxGetTranslation(wxstr_creator)); @@ -53,7 +51,7 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent) // button sizer wxBoxSizer* const sizer_buttons = new wxBoxSizer(wxHORIZONTAL); wxButton* const btn_download = new wxButton(this, -1, _("Download Codes (WiiRD Database)"), wxDefaultPosition, wxSize(128, -1)); - _connect_macro_(btn_download, CodeConfigPanel::DownloadCodes, wxEVT_COMMAND_BUTTON_CLICKED, this); + btn_download->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeConfigPanel::DownloadCodes, this); sizer_buttons->AddStretchSpacer(1); sizer_buttons->Add(btn_download, 1, wxEXPAND); diff --git a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp index ecd4f49ace..c214fac466 100644 --- a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp +++ b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp @@ -56,9 +56,7 @@ void HotkeyConfigDialog::SaveButtonMapping(int Id, int Key, int Modkey) void HotkeyConfigDialog::EndGetButtons(void) { - wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(HotkeyConfigDialog::OnKeyDown), - (wxObject*)0, this); + wxTheApp->Unbind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this); m_ButtonMappingTimer->Stop(); GetButtonWaitingTimer = 0; GetButtonWaitingID = 0; @@ -153,9 +151,7 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event) if (m_ButtonMappingTimer->IsRunning()) return; - wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard - wxKeyEventHandler(HotkeyConfigDialog::OnKeyDown), - (wxObject*)0, this); + wxTheApp->Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this); // Get the button ClickedButton = (wxButton *)event.GetEventObject(); diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 0b75b03d59..f06b3daa8a 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -212,8 +212,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW // Here we set all the info to be shown (be it SJIS or Ascii) + we set the window title ChangeBannerDetails((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage); m_Banner->SetBitmap(OpenGameListItem->GetImage()); - m_Banner->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, - wxMouseEventHandler(CISOProperties::RightClickOnBanner), (wxObject*)NULL, this); + m_Banner->Bind(wxEVT_RIGHT_DOWN, &CISOProperties::RightClickOnBanner, this); // Filesystem browser/dumper // TODO : Should we add a way to browse the wad file ? diff --git a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp index b3d57ae89c..8cdd2e16cb 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp @@ -18,7 +18,6 @@ #include "InputConfigDiag.h" #include "UDPConfigDiag.h" -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) #define WXSTR_FROM_STR(s) (wxString::FromUTF8((s).c_str())) #define WXTSTR_FROM_CSTR(s) (wxGetTranslation(wxString::FromUTF8(s))) #define STR_FROM_WXSTR(w) (std::string((w).ToUTF8())) @@ -123,10 +122,10 @@ ControlDialog::ControlDialog(GamepadPage* const parent, InputPlugin& plugin, Con //device_cbox = new wxComboBox(this, -1, WXSTR_FROM_STR(ref->device_qualifier.ToString()), wxDefaultPosition, wxSize(256,-1), parent->device_cbox->GetStrings(), wxTE_PROCESS_ENTER); device_cbox = new wxComboBox(this, -1, WXSTR_FROM_STR(m_devq.ToString()), wxDefaultPosition, wxSize(256,-1), parent->device_cbox->GetStrings(), wxTE_PROCESS_ENTER); - _connect_macro_(device_cbox, ControlDialog::SetDevice, wxEVT_COMMAND_COMBOBOX_SELECTED, this); - _connect_macro_(device_cbox, ControlDialog::SetDevice, wxEVT_COMMAND_TEXT_ENTER, this); + device_cbox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &ControlDialog::SetDevice, this); + device_cbox->Bind(wxEVT_COMMAND_TEXT_ENTER, &ControlDialog::SetDevice, this); - wxStaticBoxSizer* const control_chooser = CreateControlChooser(this, parent); + wxStaticBoxSizer* const control_chooser = CreateControlChooser(parent); wxStaticBoxSizer* const d_szr = new wxStaticBoxSizer(wxVERTICAL, this, _("Device")); d_szr->Add(device_cbox, 0, wxEXPAND|wxALL, 5); @@ -406,7 +405,7 @@ void GamepadPage::AdjustControlOption(wxCommandEvent&) m_control_dialog->control_reference->range = (ControlState)(m_control_dialog->range_slider->GetValue()) / SLIDER_TICK_COUNT; } -void GamepadPage::ConfigControl(wxCommandEvent& event) +void GamepadPage::ConfigControl(wxEvent& event) { m_control_dialog = new ControlDialog(this, m_plugin, ((ControlButton*)event.GetEventObject())->control_reference); m_control_dialog->ShowModal(); @@ -416,7 +415,7 @@ void GamepadPage::ConfigControl(wxCommandEvent& event) UpdateGUI(); } -void GamepadPage::ClearControl(wxCommandEvent& event) +void GamepadPage::ClearControl(wxEvent& event) { ControlButton* const btn = (ControlButton*)event.GetEventObject(); btn->control_reference->expression.clear(); @@ -480,24 +479,24 @@ void GamepadPage::DetectControl(wxCommandEvent& event) } } -wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wxWindow* const eventsink) +wxStaticBoxSizer* ControlDialog::CreateControlChooser(GamepadPage* const parent) { - wxStaticBoxSizer* const main_szr = new wxStaticBoxSizer(wxVERTICAL, parent, control_reference->is_input ? _("Input") : _("Output")); + wxStaticBoxSizer* const main_szr = new wxStaticBoxSizer(wxVERTICAL, this, control_reference->is_input ? _("Input") : _("Output")); - textctrl = new wxTextCtrl(parent, -1, wxEmptyString, wxDefaultPosition, wxSize(-1, 48), wxTE_MULTILINE); + textctrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxSize(-1, 48), wxTE_MULTILINE); - wxButton* const detect_button = new wxButton(parent, -1, control_reference->is_input ? _("Detect") : _("Test")); + wxButton* const detect_button = new wxButton(this, -1, control_reference->is_input ? _("Detect") : _("Test")); - wxButton* const clear_button = new wxButton(parent, -1, _("Clear")); - wxButton* const set_button = new wxButton(parent, -1, _("Set")); + wxButton* const clear_button = new wxButton(this, -1, _("Clear")); + wxButton* const set_button = new wxButton(this, -1, _("Set")); - wxButton* const select_button = new wxButton(parent, -1, _("Select")); - _connect_macro_(select_button, ControlDialog::SetSelectedControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); + wxButton* const select_button = new wxButton(this, -1, _("Select")); + select_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::SetSelectedControl, this); - wxButton* const or_button = new wxButton(parent, -1, _("| OR"), wxDefaultPosition); - _connect_macro_(or_button, ControlDialog::AppendControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); + wxButton* const or_button = new wxButton(this, -1, _("| OR"), wxDefaultPosition); + or_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::AppendControl, this); - control_lbox = new wxListBox(parent, -1, wxDefaultPosition, wxSize(-1, 64)); + control_lbox = new wxListBox(this, -1, wxDefaultPosition, wxSize(-1, 64)); wxBoxSizer* const button_sizer = new wxBoxSizer(wxVERTICAL); button_sizer->Add(detect_button, 1, 0, 5); @@ -507,30 +506,30 @@ wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wx if (control_reference->is_input) { // TODO: check if && is good on other OS - wxButton* const and_button = new wxButton(parent, -1, _("&& AND"), wxDefaultPosition); - wxButton* const not_button = new wxButton(parent, -1, _("! NOT"), wxDefaultPosition); - wxButton* const add_button = new wxButton(parent, -1, _("^ ADD"), wxDefaultPosition); + wxButton* const and_button = new wxButton(this, -1, _("&& AND"), wxDefaultPosition); + wxButton* const not_button = new wxButton(this, -1, _("! NOT"), wxDefaultPosition); + wxButton* const add_button = new wxButton(this, -1, _("^ ADD"), wxDefaultPosition); - _connect_macro_(and_button, ControlDialog::AppendControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); - _connect_macro_(not_button, ControlDialog::AppendControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); - _connect_macro_(add_button, ControlDialog::AppendControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); + and_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::AppendControl, this); + not_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::AppendControl, this); + add_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::AppendControl, this); button_sizer->Add(and_button, 1, 0, 5); button_sizer->Add(not_button, 1, 0, 5); button_sizer->Add(add_button, 1, 0, 5); } - range_slider = new wxSlider(parent, -1, SLIDER_TICK_COUNT, 0, SLIDER_TICK_COUNT * 5, wxDefaultPosition, wxDefaultSize, wxSL_TOP | wxSL_LABELS /*| wxSL_AUTOTICKS*/); + range_slider = new wxSlider(this, -1, SLIDER_TICK_COUNT, 0, SLIDER_TICK_COUNT * 5, wxDefaultPosition, wxDefaultSize, wxSL_TOP | wxSL_LABELS /*| wxSL_AUTOTICKS*/); range_slider->SetValue((int)(control_reference->range * SLIDER_TICK_COUNT)); - _connect_macro_(detect_button, ControlDialog::DetectControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); - _connect_macro_(clear_button, ControlDialog::ClearControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); - _connect_macro_(set_button, ControlDialog::SetControl, wxEVT_COMMAND_BUTTON_CLICKED, parent); + detect_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::DetectControl, this); + clear_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::ClearControl, this); + set_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ControlDialog::SetControl, this); - _connect_macro_(range_slider, GamepadPage::AdjustControlOption, wxEVT_SCROLL_CHANGED, eventsink); - wxStaticText* const range_label = new wxStaticText(parent, -1, _("Range")); - m_bound_label = new wxStaticText(parent, -1, wxT("")); + range_slider->Bind(wxEVT_SCROLL_CHANGED, &GamepadPage::AdjustControlOption, parent); + wxStaticText* const range_label = new wxStaticText(this, -1, _("Range")); + m_bound_label = new wxStaticText(this, -1, wxT("")); wxBoxSizer* const range_sizer = new wxBoxSizer(wxHORIZONTAL); range_sizer->Add(range_label, 0, wxCENTER|wxLEFT, 5); @@ -668,7 +667,7 @@ ControlGroupBox::~ControlGroupBox() delete *i; } -ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWindow* const parent, wxWindow* const eventsink) +ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWindow* const parent, GamepadPage* const eventsink) : wxBoxSizer(wxVERTICAL) , control_group(group) { @@ -691,16 +690,16 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin if ((*ci)->control_ref->is_input) { control_button->SetToolTip(_("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options.")); - _connect_macro_(control_button, GamepadPage::DetectControl, wxEVT_COMMAND_BUTTON_CLICKED, eventsink); + control_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::DetectControl, eventsink); } else { control_button->SetToolTip(_("Left/Right-click for more options.\nMiddle-click to clear.")); - _connect_macro_(control_button, GamepadPage::ConfigControl, wxEVT_COMMAND_BUTTON_CLICKED, eventsink); + control_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::ConfigControl, eventsink); } - _connect_macro_(control_button, GamepadPage::ClearControl, wxEVT_MIDDLE_DOWN, eventsink); - _connect_macro_(control_button, GamepadPage::ConfigControl, wxEVT_RIGHT_UP, eventsink); + control_button->Bind(wxEVT_MIDDLE_DOWN, &GamepadPage::ClearControl, eventsink); + control_button->Bind(wxEVT_RIGHT_UP, &GamepadPage::ConfigControl, eventsink); wxBoxSizer* const control_sizer = new wxBoxSizer(wxHORIZONTAL); control_sizer->AddStretchSpacer(1); @@ -733,7 +732,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin for (; i!=e; ++i) { PadSettingSpin* setting = new PadSettingSpin(parent, *i); - _connect_macro_(setting->wxcontrol, GamepadPage::AdjustSetting, wxEVT_COMMAND_SPINCTRL_UPDATED, eventsink); + setting->wxcontrol->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &GamepadPage::AdjustSetting, eventsink); options.push_back(setting); szr->Add(new wxStaticText(parent, -1, WXTSTR_FROM_CSTR((*i)->name))); szr->Add(setting->wxcontrol, 0, wxLEFT, 0); @@ -754,7 +753,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin static_bitmap = new wxStaticBitmap(parent, -1, bitmap, wxDefaultPosition, wxDefaultSize, wxBITMAP_TYPE_BMP); PadSettingSpin* const threshold_cbox = new PadSettingSpin(parent, group->settings[0]); - _connect_macro_(threshold_cbox->wxcontrol, GamepadPage::AdjustSetting, wxEVT_COMMAND_SPINCTRL_UPDATED, eventsink); + threshold_cbox->wxcontrol->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &GamepadPage::AdjustSetting, eventsink); threshold_cbox->wxcontrol->SetToolTip(_("Adjust the analog control pressure required to activate buttons.")); @@ -793,7 +792,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin for (; i!=e; ++i) { PadSettingSpin* setting = new PadSettingSpin(parent, *i); - _connect_macro_(setting->wxcontrol, GamepadPage::AdjustSetting, wxEVT_COMMAND_SPINCTRL_UPDATED, eventsink); + setting->wxcontrol->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &GamepadPage::AdjustSetting, eventsink); options.push_back(setting); wxBoxSizer* const szr = new wxBoxSizer(wxHORIZONTAL); szr->Add(new wxStaticText(parent, -1, WXTSTR_FROM_CSTR((*i)->name)), 0, wxCENTER|wxRIGHT, 3); @@ -811,8 +810,8 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin options.push_back(attachments); - _connect_macro_(attachments->wxcontrol, GamepadPage::AdjustSetting, wxEVT_COMMAND_CHOICE_SELECTED, eventsink); - _connect_macro_(configure_btn, GamepadPage::ConfigExtension, wxEVT_COMMAND_BUTTON_CLICKED, eventsink); + attachments->wxcontrol->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &GamepadPage::AdjustSetting, eventsink); + configure_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::ConfigExtension, eventsink); Add(attachments->wxcontrol, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 3); Add(configure_btn, 0, wxALL|wxEXPAND, 3); @@ -821,7 +820,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin case GROUP_TYPE_UDPWII: { wxButton* const btn = new UDPConfigButton(parent, (UDPWrapper*)group); - _connect_macro_(btn, GamepadPage::ConfigUDPWii, wxEVT_COMMAND_BUTTON_CLICKED, eventsink); + btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::ConfigUDPWii, eventsink); Add(btn, 0, wxALL|wxEXPAND, 3); } break; @@ -835,7 +834,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin for (; i!=e; ++i) { PadSettingCheckBox* setting_cbox = new PadSettingCheckBox(parent, (*i)->value, (*i)->name); - _connect_macro_(setting_cbox->wxcontrol, GamepadPage::AdjustSetting, wxEVT_COMMAND_CHECKBOX_CLICKED, eventsink); + setting_cbox->wxcontrol->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &GamepadPage::AdjustSetting, eventsink); options.push_back(setting_cbox); Add(setting_cbox->wxcontrol, 0, wxALL|wxLEFT, 5); @@ -850,7 +849,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin //AddStretchSpacer(0); } -ControlGroupsSizer::ControlGroupsSizer(ControllerEmu* const controller, wxWindow* const parent, wxWindow* const eventsink, std::vector* groups) +ControlGroupsSizer::ControlGroupsSizer(ControllerEmu* const controller, wxWindow* const parent, GamepadPage* const eventsink, std::vector* groups) : wxBoxSizer(wxHORIZONTAL) { size_t col_size = 0; @@ -906,9 +905,9 @@ GamepadPage::GamepadPage(wxWindow* parent, InputPlugin& plugin, const unsigned i wxButton* refresh_button = new wxButton(this, -1, _("Refresh"), wxDefaultPosition, wxSize(60,-1)); - _connect_macro_(device_cbox, GamepadPage::SetDevice, wxEVT_COMMAND_COMBOBOX_SELECTED, this); - _connect_macro_(device_cbox, GamepadPage::SetDevice, wxEVT_COMMAND_TEXT_ENTER, this); - _connect_macro_(refresh_button, GamepadPage::RefreshDevices, wxEVT_COMMAND_BUTTON_CLICKED, this); + device_cbox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &GamepadPage::SetDevice, this); + device_cbox->Bind(wxEVT_COMMAND_TEXT_ENTER, &GamepadPage::SetDevice, this); + refresh_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::RefreshDevices, this); device_sbox->Add(device_cbox, 1, wxLEFT|wxRIGHT, 3); device_sbox->Add(refresh_button, 0, wxRIGHT|wxBOTTOM, 3); @@ -920,8 +919,8 @@ GamepadPage::GamepadPage(wxWindow* parent, InputPlugin& plugin, const unsigned i clear_sbox->Add(default_button, 1, wxLEFT, 3); clear_sbox->Add(clearall_button, 1, wxRIGHT, 3); - _connect_macro_(clearall_button, GamepadPage::ClearAll, wxEVT_COMMAND_BUTTON_CLICKED, this); - _connect_macro_(default_button, GamepadPage::LoadDefaults, wxEVT_COMMAND_BUTTON_CLICKED, this); + clearall_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::ClearAll, this); + default_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::LoadDefaults, this); profile_cbox = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxSize(64,-1)); @@ -929,9 +928,9 @@ GamepadPage::GamepadPage(wxWindow* parent, InputPlugin& plugin, const unsigned i wxButton* const psave_btn = new wxButton(this, -1, _("Save"), wxDefaultPosition, wxSize(48,-1)); wxButton* const pdelete_btn = new wxButton(this, -1, _("Delete"), wxDefaultPosition, wxSize(60,-1)); - _connect_macro_(pload_btn, GamepadPage::LoadProfile, wxEVT_COMMAND_BUTTON_CLICKED, this); - _connect_macro_(psave_btn, GamepadPage::SaveProfile, wxEVT_COMMAND_BUTTON_CLICKED, this); - _connect_macro_(pdelete_btn, GamepadPage::DeleteProfile, wxEVT_COMMAND_BUTTON_CLICKED, this); + pload_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::LoadProfile, this); + psave_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::SaveProfile, this); + pdelete_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GamepadPage::DeleteProfile, this); profile_sbox->Add(profile_cbox, 1, wxLEFT, 3); profile_sbox->Add(pload_btn, 0, wxLEFT, 3); @@ -972,7 +971,7 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin UpdateDeviceComboBox(); UpdateProfileComboBox(); - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(InputConfigDialog::ClickSave)); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &InputConfigDialog::ClickSave, this, wxID_OK); wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL); szr->Add(m_pad_notebook, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5); @@ -983,7 +982,7 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin // live preview update timer m_update_timer = new wxTimer(this, -1); - Connect(wxID_ANY, wxEVT_TIMER, wxTimerEventHandler(InputConfigDialog::UpdateBitmaps), (wxObject*)0, this); + Bind(wxEVT_TIMER, &InputConfigDialog::UpdateBitmaps, this); m_update_timer->Start(PREVIEW_UPDATE_TIME, wxTIMER_CONTINUOUS); } diff --git a/Source/Core/DolphinWX/Src/InputConfigDiag.h b/Source/Core/DolphinWX/Src/InputConfigDiag.h index 53f06a1144..1be97bff14 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiag.h +++ b/Source/Core/DolphinWX/Src/InputConfigDiag.h @@ -100,7 +100,7 @@ class ControlDialog : public wxDialog public: ControlDialog(GamepadPage* const parent, InputPlugin& plugin, ControllerInterface::ControlReference* const ref); - wxStaticBoxSizer* CreateControlChooser(wxWindow* const parent, wxWindow* const eventsink); + wxStaticBoxSizer* CreateControlChooser(GamepadPage* const parent); void DetectControl(wxCommandEvent& event); void ClearControl(wxCommandEvent& event); @@ -159,7 +159,7 @@ public: class ControlGroupBox : public wxBoxSizer { public: - ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWindow* const parent, wxWindow* const eventsink); + ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWindow* const parent, GamepadPage* const eventsink); ~ControlGroupBox(); std::vector options; @@ -172,7 +172,7 @@ public: class ControlGroupsSizer : public wxBoxSizer { public: - ControlGroupsSizer(ControllerEmu* const controller, wxWindow* const parent, wxWindow* const eventsink, std::vector* const groups = NULL); + ControlGroupsSizer(ControllerEmu* const controller, wxWindow* const parent, GamepadPage* const eventsink, std::vector* const groups = NULL); }; class InputConfigDialog; @@ -193,8 +193,8 @@ public: void SaveProfile(wxCommandEvent& event); void DeleteProfile(wxCommandEvent& event); - void ConfigControl(wxCommandEvent& event); - void ClearControl(wxCommandEvent& event); + void ConfigControl(wxEvent& event); + void ClearControl(wxEvent& event); void DetectControl(wxCommandEvent& event); void ConfigExtension(wxCommandEvent& event); diff --git a/Source/Core/DolphinWX/Src/LogConfigWindow.cpp b/Source/Core/DolphinWX/Src/LogConfigWindow.cpp index d771a75c30..162647c64d 100644 --- a/Source/Core/DolphinWX/Src/LogConfigWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogConfigWindow.cpp @@ -21,9 +21,6 @@ #include "LogWindow.h" #include "FileUtil.h" -#define _connect_macro_(b, f, c, s) \ - (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) - LogConfigWindow::LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("Log Configuration")) , m_LogWindow(log_window), enableAll(true) @@ -53,29 +50,29 @@ void LogConfigWindow::CreateGUIControls() m_verbosity = new wxRadioBox(this, wxID_ANY, _("Verbosity"), wxDefaultPosition, wxDefaultSize, wxLevelsUse, 0, wxRA_SPECIFY_ROWS, wxDefaultValidator); - _connect_macro_(m_verbosity, LogConfigWindow::OnVerbosityChange, wxEVT_COMMAND_RADIOBOX_SELECTED, this); + m_verbosity->Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &LogConfigWindow::OnVerbosityChange, this); // Options m_writeFileCB = new wxCheckBox(this, wxID_ANY, _("Write to File")); - _connect_macro_(m_writeFileCB, LogConfigWindow::OnWriteFileChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + m_writeFileCB->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LogConfigWindow::OnWriteFileChecked, this); m_writeConsoleCB = new wxCheckBox(this, wxID_ANY, _("Write to Console")); - _connect_macro_(m_writeConsoleCB, LogConfigWindow::OnWriteConsoleChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + m_writeConsoleCB->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LogConfigWindow::OnWriteConsoleChecked, this); m_writeWindowCB = new wxCheckBox(this, wxID_ANY, _("Write to Window")); - _connect_macro_(m_writeWindowCB, LogConfigWindow::OnWriteWindowChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + m_writeWindowCB->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LogConfigWindow::OnWriteWindowChecked, this); m_writeDebuggerCB = NULL; #ifdef _MSC_VER if (IsDebuggerPresent()) { m_writeDebuggerCB = new wxCheckBox(this, wxID_ANY, _("Write to Debugger")); - _connect_macro_(m_writeDebuggerCB, LogConfigWindow::OnWriteDebuggerChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + m_writeDebuggerCB->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LogConfigWindow::OnWriteDebuggerChecked, this); } #endif wxButton *btn_toggle_all = new wxButton(this, wxID_ANY, _("Toggle All Log Types"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); - _connect_macro_(btn_toggle_all, LogConfigWindow::OnToggleAll, wxEVT_COMMAND_BUTTON_CLICKED, this); + btn_toggle_all->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LogConfigWindow::OnToggleAll, this); m_checks = new wxCheckListBox(this, wxID_ANY); - _connect_macro_(m_checks, LogConfigWindow::OnLogCheck, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this); + m_checks->Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, &LogConfigWindow::OnLogCheck, this); for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) m_checks->Append(wxString::FromAscii(m_LogManager->GetFullName((LogTypes::LOG_TYPE)i))); diff --git a/Source/Core/DolphinWX/Src/MemcardManager.h b/Source/Core/DolphinWX/Src/MemcardManager.h index beff71b671..537b0eb111 100644 --- a/Source/Core/DolphinWX/Src/MemcardManager.h +++ b/Source/Core/DolphinWX/Src/MemcardManager.h @@ -149,13 +149,11 @@ class CMemcardManager : public wxDialog : wxListCtrl(parent, id, pos, size, style) , __mcmSettings(_mcmSetngs) { - Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler( - CMemcardListCtrl::OnRightClick)); + Bind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this); } ~CMemcardListCtrl() { - Disconnect(wxEVT_RIGHT_DOWN, wxMouseEventHandler( - CMemcardListCtrl::OnRightClick)); + Unbind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this); } _mcmSettings & __mcmSettings; bool prevPage, diff --git a/Source/Core/DolphinWX/Src/NetWindow.cpp b/Source/Core/DolphinWX/Src/NetWindow.cpp index 0347385e73..142a7ea00c 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -24,9 +24,6 @@ #include -#define _connect_macro_(b, f, c, s) \ - (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) - #define NETPLAY_TITLEBAR "Dolphin NetPlay" BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame) @@ -86,7 +83,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* m_connect_port_text = new wxTextCtrl(connect_tab, wxID_ANY, wxString::FromAscii(port.c_str())); wxButton* const connect_btn = new wxButton(connect_tab, wxID_ANY, _("Connect")); - _connect_macro_(connect_btn, NetPlaySetupDiag::OnJoin, wxEVT_COMMAND_BUTTON_CLICKED, this); + connect_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnJoin, this); wxStaticText* const alert_lbl = new wxStaticText(connect_tab, wxID_ANY, _("ALERT:\n\nNetPlay will currently only work properly when using the following settings:\n - Dual Core [OFF]\n - Audio Throttle [OFF]\n - DSP-HLE with \"Null Audio\" or DSP-LLE\n - Manually set the exact number of controllers that will be used to [Standard Controller]\n\nAll players should try to use the same Dolphin version and settings.\nDisable all memory cards or send them to all players before starting.\nWiimote support has not been implemented.\n\nYou must forward TCP port to host!!"), @@ -119,10 +116,10 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* m_host_port_text = new wxTextCtrl(host_tab, wxID_ANY, wxString::FromAscii(port.c_str())); wxButton* const host_btn = new wxButton(host_tab, wxID_ANY, _("Host")); - _connect_macro_(host_btn, NetPlaySetupDiag::OnHost, wxEVT_COMMAND_BUTTON_CLICKED, this); + host_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnHost, this); m_game_lbox = new wxListBox(host_tab, wxID_ANY); - _connect_macro_(m_game_lbox, NetPlaySetupDiag::OnHost, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, this); + m_game_lbox->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &NetPlaySetupDiag::OnHost, this); std::istringstream ss(game_list->GetGameNames()); std::string game; @@ -143,7 +140,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* // bottom row wxButton* const quit_btn = new wxButton(panel, wxID_ANY, _("Quit")); - _connect_macro_(quit_btn, NetPlaySetupDiag::OnQuit, wxEVT_COMMAND_BUTTON_CLICKED, this); + quit_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnQuit, this); // main sizer wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL); @@ -257,7 +254,7 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game wxDefaultPosition, wxDefaultSize, wxBU_LEFT); if (is_hosting) - _connect_macro_(m_game_btn, NetPlayDiag::OnChangeGame, wxEVT_COMMAND_BUTTON_CLICKED, this); + m_game_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnChangeGame, this); else m_game_btn->Disable(); @@ -269,10 +266,10 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game m_chat_msg_text = new wxTextCtrl(panel, wxID_ANY, wxEmptyString , wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); - _connect_macro_(m_chat_msg_text, NetPlayDiag::OnChat, wxEVT_COMMAND_TEXT_ENTER, this); + m_chat_msg_text->Bind(wxEVT_COMMAND_TEXT_ENTER, &NetPlayDiag::OnChat, this); wxButton* const chat_msg_btn = new wxButton(panel, wxID_ANY, _("Send")); - _connect_macro_(chat_msg_btn, NetPlayDiag::OnChat, wxEVT_COMMAND_BUTTON_CLICKED, this); + chat_msg_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnChat, this); wxBoxSizer* const chat_msg_szr = new wxBoxSizer(wxHORIZONTAL); chat_msg_szr->Add(m_chat_msg_text, 1); @@ -290,7 +287,7 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game if (is_hosting) { wxButton* const player_config_btn = new wxButton(panel, wxID_ANY, _("Configure Pads")); - _connect_macro_(player_config_btn, NetPlayDiag::OnConfigPads, wxEVT_COMMAND_BUTTON_CLICKED, this); + player_config_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnConfigPads, this); player_szr->Add(player_config_btn, 0, wxEXPAND | wxTOP, 5); } @@ -300,23 +297,23 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game // bottom crap wxButton* const quit_btn = new wxButton(panel, wxID_ANY, _("Quit")); - _connect_macro_(quit_btn, NetPlayDiag::OnQuit, wxEVT_COMMAND_BUTTON_CLICKED, this); + quit_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnQuit, this); wxBoxSizer* const bottom_szr = new wxBoxSizer(wxHORIZONTAL); if (is_hosting) { wxButton* const start_btn = new wxButton(panel, wxID_ANY, _("Start")); - _connect_macro_(start_btn, NetPlayDiag::OnStart, wxEVT_COMMAND_BUTTON_CLICKED, this); + start_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnStart, this); bottom_szr->Add(start_btn); wxButton* const stop_btn = new wxButton(panel, wxID_ANY, _("Stop")); - _connect_macro_(stop_btn, NetPlayDiag::OnStop, wxEVT_COMMAND_BUTTON_CLICKED, this); + stop_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnStop, this); bottom_szr->Add(stop_btn); bottom_szr->Add(new wxStaticText(panel, wxID_ANY, _("Buffer:")), 0, wxLEFT | wxCENTER, 5 ); wxSpinCtrl* const padbuf_spin = new wxSpinCtrl(panel, wxID_ANY, wxT("20") , wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, 20); - _connect_macro_(padbuf_spin, NetPlayDiag::OnAdjustBuffer, wxEVT_COMMAND_SPINCTRL_UPDATED, this); + padbuf_spin->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &NetPlayDiag::OnAdjustBuffer, this); wxButton* const padbuf_btn = new wxButton(panel, wxID_ANY, wxT("?"), wxDefaultPosition, wxSize(22, -1)); - _connect_macro_(padbuf_btn, NetPlayDiag::OnPadBuffHelp, wxEVT_COMMAND_BUTTON_CLICKED, this); + padbuf_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnPadBuffHelp, this); bottom_szr->Add(padbuf_spin, 0, wxCENTER); bottom_szr->Add(padbuf_btn); } @@ -550,7 +547,7 @@ ChangeGameDiag::ChangeGameDiag(wxWindow* const parent, const CGameListCtrl* cons , m_game_name(game_name) { m_game_lbox = new wxListBox(this, wxID_ANY); - _connect_macro_(m_game_lbox, ChangeGameDiag::OnPick, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, this); + m_game_lbox->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &ChangeGameDiag::OnPick, this); // fill list with games std::istringstream ss(game_list->GetGameNames()); @@ -559,7 +556,7 @@ ChangeGameDiag::ChangeGameDiag(wxWindow* const parent, const CGameListCtrl* cons m_game_lbox->Append(wxString(game.c_str(), *wxConvCurrent)); wxButton* const ok_btn = new wxButton(this, wxID_OK, _("Change")); - _connect_macro_(ok_btn, ChangeGameDiag::OnPick, wxEVT_COMMAND_BUTTON_CLICKED, this); + ok_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ChangeGameDiag::OnPick, this); wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL); szr->Add(m_game_lbox, 1, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 5); @@ -604,7 +601,7 @@ PadMapDiag::PadMapDiag(wxWindow* const parent, int map[]) = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 5, pad_names); pad_cbox->Select(m_mapping[i] + 1); - _connect_macro_(pad_cbox, PadMapDiag::OnAdjust, wxEVT_COMMAND_CHOICE_SELECTED, this); + pad_cbox->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &PadMapDiag::OnAdjust, this); wxBoxSizer* const v_szr = new wxBoxSizer(wxVERTICAL); v_szr->Add(new wxStaticText(this,wxID_ANY, pad_names[i + 1]), 1, wxALIGN_CENTER_HORIZONTAL); diff --git a/Source/Core/DolphinWX/Src/TASInputDlg.cpp b/Source/Core/DolphinWX/Src/TASInputDlg.cpp index b4f4c77397..51b340c55a 100644 --- a/Source/Core/DolphinWX/Src/TASInputDlg.cpp +++ b/Source/Core/DolphinWX/Src/TASInputDlg.cpp @@ -54,8 +54,8 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title, wxBoxSizer* const main_stick_box = new wxBoxSizer(wxVERTICAL); static_bitmap_main = new wxStaticBitmap(this, ID_MAIN_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize); - static_bitmap_main->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(TASInputDlg::OnMouseUpL), NULL, this); - static_bitmap_main->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(TASInputDlg::OnMouseUpR), NULL, this); + static_bitmap_main->Bind(wxEVT_LEFT_UP, &TASInputDlg::OnMouseUpL, this); + static_bitmap_main->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this); wx_mainX_s = new wxSlider(this, ID_MAIN_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL); wx_mainX_s->SetMinSize(wxSize(120,-1)); wx_mainX_t = new wxTextCtrl(this, ID_MAIN_X_TEXT, wxT("128"), wxDefaultPosition, wxSize(40, 20)); @@ -80,8 +80,8 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title, wxBoxSizer* const c_stick_box = new wxBoxSizer(wxVERTICAL); static_bitmap_c = new wxStaticBitmap(this, ID_C_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize); - static_bitmap_c->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(TASInputDlg::OnMouseUpL), NULL, this); - static_bitmap_c->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(TASInputDlg::OnMouseUpR), NULL, this); + static_bitmap_c->Bind(wxEVT_LEFT_UP, &TASInputDlg::OnMouseUpL, this); + static_bitmap_c->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this); wx_cX_s = new wxSlider(this, ID_C_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL); wx_cX_s->SetMinSize(wxSize(120,-1)); wx_cX_t = new wxTextCtrl(this, ID_C_X_TEXT, wxT("128"), wxDefaultPosition, wxSize(40, 20)); @@ -120,29 +120,29 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title, wxGridSizer* const buttons_grid = new wxGridSizer(4); wx_a_button = new wxCheckBox(this,ID_A,_T("A"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_a_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_a_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_a_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_a_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_b_button = new wxCheckBox(this,ID_B,_T("B"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_b_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_b_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_b_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_b_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_x_button = new wxCheckBox(this,ID_X,_T("X"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_x_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_x_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_x_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_x_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_y_button = new wxCheckBox(this,ID_Y,_T("Y"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_y_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_y_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_y_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_y_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_l_button = new wxCheckBox(this,ID_L,_T("L"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_l_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_l_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_l_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_l_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_r_button = new wxCheckBox(this,ID_R,_T("R"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_r_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_r_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_r_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_r_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_z_button = new wxCheckBox(this,ID_Z,_T("Z"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_z_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_z_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_z_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_z_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_start_button = new wxCheckBox(this,ID_START,_T("Start"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_start_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_start_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_start_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_start_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); buttons_grid->Add(wx_a_button,false); buttons_grid->Add(wx_b_button,false); @@ -157,17 +157,17 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title, wxGridSizer* const buttons_dpad = new wxGridSizer(3); wx_up_button = new wxCheckBox(this,ID_UP,_T("Up"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_up_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_up_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_up_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_up_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_right_button = new wxCheckBox(this,ID_RIGHT,_T("Right"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_right_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_right_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_right_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_right_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_down_button = new wxCheckBox(this,ID_DOWN,_T("Down"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_down_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_down_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_down_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_down_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); wx_left_button = new wxCheckBox(this,ID_LEFT,_T("Left"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,wxCheckBoxNameStr); - wx_left_button->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurbo), NULL, this); - wx_left_button->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(TASInputDlg::SetTurboFalse), NULL, this); + wx_left_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this); + wx_left_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this); buttons_dpad->AddSpacer(20); buttons_dpad->Add(wx_up_button,false); diff --git a/Source/Core/DolphinWX/Src/UDPConfigDiag.cpp b/Source/Core/DolphinWX/Src/UDPConfigDiag.cpp index d66e6c1fc5..2f31311495 100644 --- a/Source/Core/DolphinWX/Src/UDPConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/UDPConfigDiag.cpp @@ -6,8 +6,6 @@ #include "IniFile.h" #include -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s) - UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) : wxDialog(parent, -1, _("UDP Wiimote"), wxDefaultPosition, wxDefaultSize), wrp(_wrp) @@ -31,13 +29,13 @@ UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) : port_tbox = new wxTextCtrl(this, wxID_ANY, wxString::FromUTF8(wrp->port.c_str())); port_sizer->Add(port_tbox, 1, wxLEFT | wxEXPAND, 5); - _connect_macro_(enable, UDPConfigDiag::ChangeState, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(butt, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(accel, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(point, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(nun, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(nunaccel, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(port_tbox, UDPConfigDiag::ChangeState, wxEVT_COMMAND_TEXT_UPDATED, this); + enable->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeState, this); + butt->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeUpdateFlags, this); + accel->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeUpdateFlags, this); + point->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeUpdateFlags, this); + nun->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeUpdateFlags, this); + nunaccel->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &UDPConfigDiag::ChangeUpdateFlags, this); + port_tbox->Bind(wxEVT_COMMAND_TEXT_UPDATED, &UDPConfigDiag::ChangeState, this); enable->SetValue(wrp->udpEn); butt->SetValue(wrp->updButt); diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index d99bd97e8d..71c4c1ac93 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -11,8 +11,6 @@ #include #endif -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s) - extern CFrame* main_frame; // template instantiation @@ -27,7 +25,7 @@ SettingCheckBox::BoolSetting(wxWindow* parent, const wxString& label, const wxSt { SetToolTip(tooltip); SetValue(m_setting ^ m_reverse); - _connect_macro_(this, SettingCheckBox::UpdateValue, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SettingCheckBox::UpdateValue, this); } template <> @@ -38,7 +36,7 @@ SettingRadioButton::BoolSetting(wxWindow* parent, const wxString& label, const w { SetToolTip(tooltip); SetValue(m_setting ^ m_reverse); - _connect_macro_(this, SettingRadioButton::UpdateValue, wxEVT_COMMAND_RADIOBUTTON_SELECTED, this); + Bind(wxEVT_COMMAND_RADIOBUTTON_SELECTED, &SettingRadioButton::UpdateValue, this); } SettingChoice::SettingChoice(wxWindow* parent, int &setting, const wxString& tooltip, int num, const wxString choices[], long style) @@ -47,7 +45,7 @@ SettingChoice::SettingChoice(wxWindow* parent, int &setting, const wxString& too { SetToolTip(tooltip); Select(m_setting); - _connect_macro_(this, SettingChoice::UpdateValue, wxEVT_COMMAND_CHOICE_SELECTED, this); + Bind(wxEVT_COMMAND_CHOICE_SELECTED, &SettingChoice::UpdateValue, this); } void SettingChoice::UpdateValue(wxCommandEvent& ev) @@ -190,7 +188,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con { vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str()); - Connect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(VideoConfigDiag::OnUpdateUI), NULL, this); + Bind(wxEVT_UPDATE_UI, &VideoConfigDiag::OnUpdateUI, this); wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize); @@ -217,7 +215,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con choice_backend->AppendString(wxGetTranslation(wxString::FromAscii((*it)->GetName().c_str()))); choice_backend->SetStringSelection(wxGetTranslation(wxString::FromAscii(g_video_backend->GetName().c_str()))); - _connect_macro_(choice_backend, VideoConfigDiag::Event_Backend, wxEVT_COMMAND_CHOICE_SELECTED, this); + choice_backend->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_Backend, this); szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5); szr_basic->Add(choice_backend, 1, 0, 0); @@ -259,7 +257,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con wxStaticText* const label_display_resolution = new wxStaticText(page_general, wxID_ANY, _("Fullscreen resolution:")); choice_display_resolution = new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list); RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc)); - _connect_macro_(choice_display_resolution, VideoConfigDiag::Event_DisplayResolution, wxEVT_COMMAND_CHOICE_SELECTED, this); + choice_display_resolution->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_DisplayResolution, this); choice_display_resolution->SetStringSelection(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str())); @@ -389,7 +387,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con else choice_ppshader->SetStringSelection(wxString::FromAscii(vconfig.sPostProcessingShader.c_str())); - _connect_macro_(choice_ppshader, VideoConfigDiag::Event_PPShader, wxEVT_COMMAND_CHOICE_SELECTED, this); + choice_ppshader->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_PPShader, this); szr_enh->Add(new wxStaticText(page_enh, -1, _("Post-Processing Effect:")), 1, wxALIGN_CENTER_VERTICAL, 0); szr_enh->Add(choice_ppshader); @@ -455,7 +453,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con // TODO: Use wxSL_MIN_MAX_LABELS or wxSL_VALUE_LABEL with wx 2.9.1 wxSlider* const stc_slider = new wxSlider(page_hacks, wxID_ANY, 0, 0, 2, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_BOTTOM); - _connect_macro_(stc_slider, VideoConfigDiag::Event_Stc, wxEVT_COMMAND_SLIDER_UPDATED, this); + stc_slider->Bind(wxEVT_COMMAND_SLIDER_UPDATED, &VideoConfigDiag::Event_Stc, this); RegisterControl(stc_slider, wxGetTranslation(stc_desc)); if (vconfig.iSafeTextureCache_ColorSamples == 0) stc_slider->SetValue(0); @@ -556,7 +554,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con { wxCheckBox* const cb_prog_scan = new wxCheckBox(page_advanced, wxID_ANY, _("Enable Progressive Scan")); RegisterControl(cb_prog_scan, wxGetTranslation(prog_scan_desc)); - _connect_macro_(cb_prog_scan, VideoConfigDiag::Event_ProgressiveScan, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + cb_prog_scan->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &VideoConfigDiag::Event_ProgressiveScan, this); if (Core::GetState() != Core::CORE_UNINITIALIZED) cb_prog_scan->Disable(); @@ -579,9 +577,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con } wxButton* const btn_close = new wxButton(this, wxID_OK, _("Close"), wxDefaultPosition); - _connect_macro_(btn_close, VideoConfigDiag::Event_ClickClose, wxEVT_COMMAND_BUTTON_CLICKED, this); + btn_close->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VideoConfigDiag::Event_ClickClose, this); - Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(VideoConfigDiag::Event_Close), (wxObject*)0, this); + Bind(wxEVT_CLOSE_WINDOW, &VideoConfigDiag::Event_Close, this); wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL); szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5); @@ -629,8 +627,8 @@ SettingRadioButton* VideoConfigDiag::CreateRadioButton(wxWindow* parent, const w wxControl* VideoConfigDiag::RegisterControl(wxControl* const control, const wxString& description) { ctrl_descs.insert(std::pair(control, description)); - control->Connect(wxID_ANY, wxEVT_ENTER_WINDOW, wxMouseEventHandler(VideoConfigDiag::Evt_EnterControl), NULL, this); - control->Connect(wxID_ANY, wxEVT_LEAVE_WINDOW, wxMouseEventHandler(VideoConfigDiag::Evt_LeaveControl), NULL, this); + control->Bind(wxEVT_ENTER_WINDOW, &VideoConfigDiag::Evt_EnterControl, this); + control->Bind(wxEVT_LEAVE_WINDOW, &VideoConfigDiag::Evt_LeaveControl, this); return control; } diff --git a/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp b/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp index b232bf6461..22914366b0 100644 --- a/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp @@ -4,8 +4,6 @@ #include "HW/WiimoteReal/WiimoteReal.h" #include "Frame.h" -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s) - const wxString& ConnectedWiimotesString() { static wxString str; @@ -42,9 +40,9 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin wiimote_label[i] = new wxStaticText(this, wxID_ANY, str); wiimote_source_ch[i] = new wxChoice(this, source_ctrl_id, wxDefaultPosition, wxDefaultSize, sizeof(src_choices)/sizeof(*src_choices), src_choices); - _connect_macro_(wiimote_source_ch[i], WiimoteConfigDiag::SelectSource, wxEVT_COMMAND_CHOICE_SELECTED, this); + wiimote_source_ch[i]->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &WiimoteConfigDiag::SelectSource, this); wiimote_configure_bt[i] = new wxButton(this, config_bt_id, _("Configure")); - _connect_macro_(wiimote_configure_bt[i], WiimoteConfigDiag::ConfigEmulatedWiimote, wxEVT_COMMAND_BUTTON_CLICKED, this); + wiimote_configure_bt[i]->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::ConfigEmulatedWiimote, this); m_orig_wiimote_sources[i] = g_wiimote_sources[i]; wiimote_source_ch[i]->Select(m_orig_wiimote_sources[i]); @@ -69,11 +67,11 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin connected_wiimotes_txt = new wxStaticText(this, -1, ConnectedWiimotesString()); wxButton* const refresh_btn = new wxButton(this, -1, _("Refresh"), wxDefaultPosition); - _connect_macro_(refresh_btn, WiimoteConfigDiag::RefreshRealWiimotes, wxEVT_COMMAND_BUTTON_CLICKED, this); + refresh_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::RefreshRealWiimotes, this); #ifdef _WIN32 wxButton* const pairup_btn = new wxButton(this, -1, _("Pair Up"), wxDefaultPosition); - _connect_macro_(pairup_btn, WiimoteConfigDiag::PairUpRealWiimotes, wxEVT_COMMAND_BUTTON_CLICKED, this); + pairup_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::PairUpRealWiimotes, this); #endif @@ -133,11 +131,11 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin WiimoteMotor->SetValue(SConfig::GetInstance().m_SYSCONF->GetData("BT.MOT")); WiimoteReconnectOnLoad->SetValue(SConfig::GetInstance().m_WiimoteReconnectOnLoad); - _connect_macro_(WiiSensBarPos, WiimoteConfigDiag::OnSensorBarPos, wxEVT_COMMAND_CHOICE_SELECTED, this); - _connect_macro_(WiiSensBarSens, WiimoteConfigDiag::OnSensorBarSensitivity, wxEVT_COMMAND_SLIDER_UPDATED, this); - _connect_macro_(WiimoteSpkVolume, WiimoteConfigDiag::OnSpeakerVolume, wxEVT_COMMAND_SLIDER_UPDATED, this); - _connect_macro_(WiimoteMotor, WiimoteConfigDiag::OnMotor, wxEVT_COMMAND_CHECKBOX_CLICKED, this); - _connect_macro_(WiimoteReconnectOnLoad, WiimoteConfigDiag::OnReconnectOnLoad, wxEVT_COMMAND_CHECKBOX_CLICKED, this); + WiiSensBarPos->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &WiimoteConfigDiag::OnSensorBarPos, this); + WiiSensBarSens->Bind(wxEVT_COMMAND_SLIDER_UPDATED, &WiimoteConfigDiag::OnSensorBarSensitivity, this); + WiimoteSpkVolume->Bind(wxEVT_COMMAND_SLIDER_UPDATED, &WiimoteConfigDiag::OnSpeakerVolume, this); + WiimoteMotor->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &WiimoteConfigDiag::OnMotor, this); + WiimoteReconnectOnLoad->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &WiimoteConfigDiag::OnReconnectOnLoad, this); // "General Settings" layout @@ -175,8 +173,8 @@ WiimoteConfigDiag::WiimoteConfigDiag(wxWindow* const parent, InputPlugin& plugin main_sizer->Add(general_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5); main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5); - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(WiimoteConfigDiag::Save)); - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(WiimoteConfigDiag::Cancel)); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::Save, this, wxID_OK); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::Cancel, this, wxID_CANCEL); SetSizerAndFit(main_sizer); Center(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp index 792d90e61c..bd085a3edf 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp @@ -21,8 +21,6 @@ #include "FileUtil.h" #include "Core.h" -#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s) - template IntegerSetting::IntegerSetting(wxWindow* parent, const wxString& label, T& setting, int minVal, int maxVal, long style) : wxSpinCtrl(parent, -1, label, wxDefaultPosition, wxDefaultSize, style), @@ -30,7 +28,7 @@ IntegerSetting::IntegerSetting(wxWindow* parent, const wxString& label, T& se { SetRange(minVal, maxVal); SetValue(m_setting); - _connect_macro_(this, IntegerSetting::UpdateValue, wxEVT_COMMAND_SPINCTRL_UPDATED, this); + Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &IntegerSetting::UpdateValue, this); } @@ -70,7 +68,7 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title, // TODO: How to get the translated plugin name? choice_backend->SetStringSelection(wxString::FromAscii(g_video_backend->GetName().c_str())); - _connect_macro_(choice_backend, VideoConfigDialog::Event_Backend, wxEVT_COMMAND_CHOICE_SELECTED, this); + choice_backend->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDialog::Event_Backend, this); szr_rendering->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5); szr_rendering->Add(choice_backend, 1, 0, 0);