From eca93c4c195963f4bd235692d2f0b584f6495d12 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 13 Jan 2013 02:28:12 -0600 Subject: Eliminate nearly all the _connect_macro_ ugliness by using wxw's newish Bind functions. Unlike Connect, Bind is quite type-safe. I also seem to have fixed some errors in the input config dialog. --- Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp') diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp index 792d90e61c..c18ac28d33 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); + 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); -- cgit v1.2.3 From 5dbc3b32197bdac2037f7ba261adbf15303c98a0 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 13 Jan 2013 03:33:11 -0600 Subject: replace this->Bind with Bind --- Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp') diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp index c18ac28d33..bd085a3edf 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp @@ -28,7 +28,7 @@ IntegerSetting::IntegerSetting(wxWindow* parent, const wxString& label, T& se { SetRange(minVal, maxVal); SetValue(m_setting); - this->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &IntegerSetting::UpdateValue, this); + Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &IntegerSetting::UpdateValue, this); } -- cgit v1.2.3