From 70427b3f3583ee2588a007a3ac62b929bdb89325 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 13 Jan 2013 12:07:45 -0600 Subject: [PATCH] Replace all of Connect/Disconnect with Bind/Unbind. --- Source/Core/DolphinWX/Src/CheatsWindow.cpp | 8 +- Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp | 42 +++++----- Source/Core/DolphinWX/Src/FifoPlayerDlg.h | 4 +- Source/Core/DolphinWX/Src/Frame.cpp | 4 +- Source/Core/DolphinWX/Src/FrameAui.cpp | 8 +- Source/Core/DolphinWX/Src/FrameTools.cpp | 80 ++++++------------- Source/Core/DolphinWX/Src/GCMicDlg.cpp | 8 +- Source/Core/DolphinWX/Src/HotkeyDlg.cpp | 8 +- Source/Core/DolphinWX/Src/ISOProperties.cpp | 3 +- Source/Core/DolphinWX/Src/InputConfigDiag.cpp | 4 +- Source/Core/DolphinWX/Src/MemcardManager.h | 6 +- Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 8 +- .../Core/DolphinWX/Src/WiimoteConfigDiag.cpp | 4 +- 13 files changed, 68 insertions(+), 119 deletions(-) diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.cpp b/Source/Core/DolphinWX/Src/CheatsWindow.cpp index b07d9d9571..63ddced86b 100644 --- a/Source/Core/DolphinWX/Src/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/Src/CheatsWindow.cpp @@ -136,7 +136,7 @@ void wxCheatsWindow::Init_ChildControls() wxButton* const button_cancel = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize); 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); @@ -588,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/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp index b1ed09c139..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,7 +306,7 @@ void FifoPlayerDlg::CreateGUIControls() Center(wxBOTH); // Connect Events - Connect(wxEVT_PAINT, wxPaintEventHandler(FifoPlayerDlg::OnPaint)); + 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); @@ -333,10 +333,10 @@ void FifoPlayerDlg::CreateGUIControls() 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/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 3994660686..8cdd2e16cb 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp @@ -971,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); @@ -982,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/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/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index f099272686..71c4c1ac93 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -188,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); @@ -579,7 +579,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con wxButton* const btn_close = new wxButton(this, wxID_OK, _("Close"), wxDefaultPosition); 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); @@ -627,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 d94c099531..22914366b0 100644 --- a/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/WiimoteConfigDiag.cpp @@ -173,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();