gui: Use Bind instead of Connect for everything else

This commit is contained in:
Jonathan Li 2016-06-18 17:03:13 +01:00
parent 1c398c2b77
commit b8ac54052c
3 changed files with 9 additions and 12 deletions

View File

@ -440,11 +440,8 @@ bool Pcsx2App::OnInit()
i18n_SetLanguagePath(); i18n_SetLanguagePath();
#define pxAppMethodEventHandler(func) \ Bind(wxEVT_KEY_DOWN, &Pcsx2App::OnEmuKeyDown, this, pxID_PadHandler_Keydown);
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(pxInvokeAppMethodEventFunction, &func ) Bind(wxEVT_DESTROY, &Pcsx2App::OnDestroyWindow, this);
Connect( pxID_PadHandler_Keydown, wxEVT_KEY_DOWN, wxKeyEventHandler (Pcsx2App::OnEmuKeyDown) );
Connect( wxEVT_DESTROY, wxWindowDestroyEventHandler (Pcsx2App::OnDestroyWindow) );
// User/Admin Mode Dual Setup: // User/Admin Mode Dual Setup:
// PCSX2 now supports two fundamental modes of operation. The default is Classic mode, // PCSX2 now supports two fundamental modes of operation. The default is Classic mode,
@ -474,7 +471,7 @@ bool Pcsx2App::OnInit()
// loop termination code. We have a much safer system in place that continues to process messages // loop termination code. We have a much safer system in place that continues to process messages
// until all "important" threads are closed out -- not just until the main frame is closed(-ish). // until all "important" threads are closed out -- not just until the main frame is closed(-ish).
m_timer_Termination = std::unique_ptr<wxTimer>(new wxTimer( this, wxID_ANY )); m_timer_Termination = std::unique_ptr<wxTimer>(new wxTimer( this, wxID_ANY ));
Connect( m_timer_Termination->GetId(), wxEVT_TIMER, wxTimerEventHandler(Pcsx2App::OnScheduledTermination) ); Bind(wxEVT_TIMER, &Pcsx2App::OnScheduledTermination, this, m_timer_Termination->GetId());
SetExitOnFrameDelete( false ); SetExitOnFrameDelete( false );

View File

@ -528,10 +528,10 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
m_MenuItem_Console.Check( g_Conf->ProgLogBox.Visible ); m_MenuItem_Console.Check( g_Conf->ProgLogBox.Visible );
ConnectMenus(); ConnectMenus();
Connect( wxEVT_MOVE, wxMoveEventHandler (MainEmuFrame::OnMoveAround) ); Bind(wxEVT_MOVE, &MainEmuFrame::OnMoveAround, this);
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler (MainEmuFrame::OnCloseWindow) ); Bind(wxEVT_CLOSE_WINDOW, &MainEmuFrame::OnCloseWindow, this);
Connect( wxEVT_SET_FOCUS, wxFocusEventHandler (MainEmuFrame::OnFocus) ); Bind(wxEVT_SET_FOCUS, &MainEmuFrame::OnFocus, this);
Connect( wxEVT_ACTIVATE, wxActivateEventHandler (MainEmuFrame::OnActivate) ); Bind(wxEVT_ACTIVATE, &MainEmuFrame::OnActivate, this);
PushEventHandler( &wxGetApp().GetRecentIsoManager() ); PushEventHandler( &wxGetApp().GetRecentIsoManager() );
SetDropTarget( new IsoDropTarget( this ) ); SetDropTarget( new IsoDropTarget( this ) );

View File

@ -39,12 +39,12 @@ RecentIsoManager::RecentIsoManager( wxMenu* menu, int firstIdForMenuItems_or_wxI
IniLoader loader; IniLoader loader;
LoadListFrom(loader); LoadListFrom(loader);
Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RecentIsoManager::OnChangedSelection) ); Bind(wxEVT_MENU, &RecentIsoManager::OnChangedSelection, this);
} }
RecentIsoManager::~RecentIsoManager() throw() RecentIsoManager::~RecentIsoManager() throw()
{ {
Disconnect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RecentIsoManager::OnChangedSelection) ); Unbind(wxEVT_MENU, &RecentIsoManager::OnChangedSelection, this);
} }
void RecentIsoManager::OnChangedSelection( wxCommandEvent& evt ) void RecentIsoManager::OnChangedSelection( wxCommandEvent& evt )