gui: Use Bind instead of Connect for panels and dialogs

This commit is contained in:
Jonathan Li 2016-06-16 20:40:48 +01:00
parent 3904c67e6e
commit 2436480d9b
22 changed files with 81 additions and 87 deletions

View File

@ -108,7 +108,7 @@ wxString BaseApplicableDialog::GetDialogName() const
void BaseApplicableDialog::Init() void BaseApplicableDialog::Init()
{ {
Connect( pxEvt_ApplySettings, wxCommandEventHandler (BaseApplicableDialog::OnSettingsApplied) ); Bind(pxEvt_ApplySettings, &BaseApplicableDialog::OnSettingsApplied, this);
wxCommandEvent applyEvent( pxEvt_ApplySettings ); wxCommandEvent applyEvent( pxEvt_ApplySettings );
applyEvent.SetId( GetId() ); applyEvent.SetId( GetId() );
@ -135,34 +135,31 @@ Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, con
m_listbook = NULL; m_listbook = NULL;
m_allowApplyActivation = true; m_allowApplyActivation = true;
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseConfigurationDialog::OnOk_Click ) ); Bind(wxEVT_BUTTON, &BaseConfigurationDialog::OnOk_Click, this, wxID_OK);
Connect( wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseConfigurationDialog::OnCancel_Click ) ); Bind(wxEVT_BUTTON, &BaseConfigurationDialog::OnCancel_Click, this, wxID_CANCEL);
Connect( wxID_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseConfigurationDialog::OnApply_Click ) ); Bind(wxEVT_BUTTON, &BaseConfigurationDialog::OnApply_Click, this, wxID_APPLY);
Connect( wxID_SAVE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseConfigurationDialog::OnScreenshot_Click ) ); Bind(wxEVT_BUTTON, &BaseConfigurationDialog::OnScreenshot_Click, this, wxID_SAVE);
Connect( pxEvt_SetSettingsPage, wxCommandEventHandler( BaseConfigurationDialog::OnSetSettingsPage ) ); Bind(pxEvt_SetSettingsPage, &BaseConfigurationDialog::OnSetSettingsPage, this);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Bind a variety of standard "something probably changed" events. If the user invokes // Bind a variety of standard "something probably changed" events. If the user invokes
// any of these, we'll automatically de-gray the Apply button for this dialog box. :) // any of these, we'll automatically de-gray the Apply button for this dialog box. :)
#define ConnectSomethingChanged( command ) \ Bind(wxEVT_TEXT, &BaseConfigurationDialog::OnSomethingChanged, this);
Connect( wxEVT_COMMAND_##command, wxCommandEventHandler( BaseConfigurationDialog::OnSomethingChanged ) ); Bind(wxEVT_TEXT_ENTER, &BaseConfigurationDialog::OnSomethingChanged, this);
ConnectSomethingChanged( TEXT_UPDATED ); Bind(wxEVT_RADIOBUTTON, &BaseConfigurationDialog::OnSomethingChanged, this);
ConnectSomethingChanged( TEXT_ENTER ); Bind(wxEVT_COMBOBOX, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_CHECKBOX, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_BUTTON, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_CHOICE, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_LISTBOX, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_SPINCTRL, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_SLIDER, &BaseConfigurationDialog::OnSomethingChanged, this);
Bind(wxEVT_DIRPICKER_CHANGED, &BaseConfigurationDialog::OnSomethingChanged, this);
ConnectSomethingChanged( RADIOBUTTON_SELECTED ); Bind(pxEvt_SomethingChanged, &BaseConfigurationDialog::OnSomethingChanged, this);
ConnectSomethingChanged( COMBOBOX_SELECTED );
ConnectSomethingChanged( CHECKBOX_CLICKED );
ConnectSomethingChanged( BUTTON_CLICKED );
ConnectSomethingChanged( CHOICE_SELECTED );
ConnectSomethingChanged( LISTBOX_SELECTED );
ConnectSomethingChanged( SPINCTRL_UPDATED );
ConnectSomethingChanged( SLIDER_UPDATED );
ConnectSomethingChanged( DIRPICKER_CHANGED );
Connect( pxEvt_SomethingChanged, wxCommandEventHandler( BaseConfigurationDialog::OnSomethingChanged ) );
} }
void Dialogs::BaseConfigurationDialog::AddListbook( wxSizer* sizer ) void Dialogs::BaseConfigurationDialog::AddListbook( wxSizer* sizer )

View File

@ -310,7 +310,7 @@ void ModalButtonPanel::OnActionButtonClicked( wxCommandEvent& evt )
void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label ) void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label )
{ {
*this += new wxButton( this, id, label ) | StdButton().Proportion(6); *this += new wxButton( this, id, label ) | StdButton().Proportion(6);
Connect( id, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModalButtonPanel::OnActionButtonClicked ) ); Bind(wxEVT_BUTTON, &ModalButtonPanel::OnActionButtonClicked, this, id);
} }
// This is for buttons that are defined internally by wxWidgets, such as wxID_CANCEL, wxID_ABORT, etc. // This is for buttons that are defined internally by wxWidgets, such as wxID_CANCEL, wxID_ABORT, etc.
@ -318,6 +318,5 @@ void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label )
void ModalButtonPanel::AddActionButton( wxWindowID id ) void ModalButtonPanel::AddActionButton( wxWindowID id )
{ {
*this += new wxButton( this, id ) | StdButton().Proportion(6); *this += new wxButton( this, id ) | StdButton().Proportion(6);
Connect( id, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModalButtonPanel::OnActionButtonClicked ) ); Bind(wxEVT_BUTTON, &ModalButtonPanel::OnActionButtonClicked, this, id);
} }

View File

@ -72,8 +72,8 @@ Dialogs::ConvertMemoryCardDialog::ConvertMemoryCardDialog( wxWindow* parent, con
*this += s_padding | pxSizerFlags::StdExpand(); *this += s_padding | pxSizerFlags::StdExpand();
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvertMemoryCardDialog::OnOk_Click ) ); Bind(wxEVT_BUTTON, &ConvertMemoryCardDialog::OnOk_Click, this, wxID_OK);
Connect( m_text_filenameInput->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ConvertMemoryCardDialog::OnOk_Click ) ); Bind(wxEVT_TEXT_ENTER, &ConvertMemoryCardDialog::OnOk_Click, this, m_text_filenameInput->GetId());
SetSizerAndFit(GetSizer()); SetSizerAndFit(GetSizer());

View File

@ -92,8 +92,8 @@ Dialogs::CreateMemoryCardDialog::CreateMemoryCardDialog( wxWindow* parent, const
*this += s_padding | StdExpand(); *this += s_padding | StdExpand();
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CreateMemoryCardDialog::OnOk_Click ) ); Bind(wxEVT_BUTTON, &CreateMemoryCardDialog::OnOk_Click, this, wxID_OK);
Connect( m_text_filenameInput->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CreateMemoryCardDialog::OnOk_Click ) ); Bind(wxEVT_TEXT_ENTER, &CreateMemoryCardDialog::OnOk_Click, this, m_text_filenameInput->GetId());
// ...Typical solution to everything? Or are we doing something weird? // ...Typical solution to everything? Or are we doing something weird?
SetSizerAndFit(GetSizer()); SetSizerAndFit(GetSizer());

View File

@ -156,11 +156,11 @@ FirstTimeWizard::FirstTimeWizard( wxWindow* parent )
// this doesn't descent from wxDialogWithHelpers, so we need to explicitly // this doesn't descent from wxDialogWithHelpers, so we need to explicitly
// fit and center it. :( // fit and center it. :(
Connect( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler (FirstTimeWizard::OnPageChanged) ); Bind(wxEVT_WIZARD_PAGE_CHANGED, &FirstTimeWizard::OnPageChanged, this);
Connect( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler (FirstTimeWizard::OnPageChanging) ); Bind(wxEVT_WIZARD_PAGE_CHANGING, &FirstTimeWizard::OnPageChanging, this);
Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler (FirstTimeWizard::OnDoubleClicked) ); Bind(wxEVT_LISTBOX_DCLICK, &FirstTimeWizard::OnDoubleClicked, this);
Connect( pxID_RestartWizard, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FirstTimeWizard::OnRestartWizard ) ); Bind(wxEVT_BUTTON, &FirstTimeWizard::OnRestartWizard, this, pxID_RestartWizard);
} }
FirstTimeWizard::~FirstTimeWizard() throw() FirstTimeWizard::~FirstTimeWizard() throw()

View File

@ -50,8 +50,8 @@ Dialogs::ImportSettingsDialog::ImportSettingsDialog( wxWindow* parent )
*this += 12; *this += 12;
*this += &s_buttons | StdCenter(); *this += &s_buttons | StdCenter();
Connect( b_import->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ImportSettingsDialog::OnImport_Click) ); Bind(wxEVT_BUTTON, &ImportSettingsDialog::OnImport_Click, this, b_import->GetId());
Connect( b_over->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ImportSettingsDialog::OnOverwrite_Click) ); Bind(wxEVT_BUTTON, &ImportSettingsDialog::OnOverwrite_Click, this, b_over->GetId());
} }
void Dialogs::ImportSettingsDialog::OnImport_Click( wxCommandEvent& /* evt */ ) void Dialogs::ImportSettingsDialog::OnImport_Click( wxCommandEvent& /* evt */ )

View File

@ -131,7 +131,7 @@ Dialogs::McdConfigDialog::McdConfigDialog( wxWindow* parent )
for( uint i=0; i<2; ++i ) for( uint i=0; i<2; ++i )
{ {
if( pxCheckBox* check = (pxCheckBox*)FindWindow(pxsFmt( L"CheckBox::Multitap%u", i )) ) if( pxCheckBox* check = (pxCheckBox*)FindWindow(pxsFmt( L"CheckBox::Multitap%u", i )) )
Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(McdConfigDialog::OnMultitapClicked) ); Bind(wxEVT_CHECKBOX, &McdConfigDialog::OnMultitapClicked, this, check->GetId());
} }
*/ */
AddOkCancel(s_bottom); AddOkCancel(s_bottom);

View File

@ -32,7 +32,7 @@ Dialogs::PickUserModeDialog::PickUserModeDialog( wxWindow* parent )
AddOkCancel( *GetSizer() ); AddOkCancel( *GetSizer() );
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PickUserModeDialog::OnOk_Click ) ); Bind(wxEVT_BUTTON, &PickUserModeDialog::OnOk_Click, this, wxID_OK);
// TODO : Add a command event handler for language changes, that dynamically re-update contents of this window. // TODO : Add a command event handler for language changes, that dynamically re-update contents of this window.
} }

View File

@ -157,9 +157,9 @@ void Dialogs::SysConfigDialog::AddPresetsControl()
*m_extraButtonSizer += 5; *m_extraButtonSizer += 5;
*m_extraButtonSizer += m_msg_preset | pxMiddle; *m_extraButtonSizer += m_msg_preset | pxMiddle;
Connect( m_slider_presets->GetId(), wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( Dialogs::SysConfigDialog::Preset_Scroll ) ); Bind(wxEVT_SCROLL_THUMBTRACK, &Dialogs::SysConfigDialog::Preset_Scroll, this, m_slider_presets->GetId());
Connect( m_slider_presets->GetId(), wxEVT_SCROLL_CHANGED, wxScrollEventHandler( Dialogs::SysConfigDialog::Preset_Scroll ) ); Bind(wxEVT_SCROLL_CHANGED, &Dialogs::SysConfigDialog::Preset_Scroll, this, m_slider_presets->GetId());
Connect( m_check_presets->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( Dialogs::SysConfigDialog::Presets_Toggled ) ); Bind(wxEVT_CHECKBOX, &Dialogs::SysConfigDialog::Presets_Toggled, this, m_check_presets->GetId());
} }

View File

@ -180,8 +180,8 @@ void BaseApplicableConfigPanel::Init()
// is immediate, and depends on the platform for how it "works", and thus // is immediate, and depends on the platform for how it "works", and thus
// useless. Solution: Create our own! :) // useless. Solution: Create our own! :)
//Connect( wxEVT_CREATE, wxWindowCreateEventHandler (BaseApplicableConfigPanel::OnCreateWindow) ); //Bind( wxEVT_CREATE, &BaseApplicableConfigPanel::OnCreateWindow, this);
Connect( pxEvt_ApplySettings, wxCommandEventHandler (BaseApplicableConfigPanel::OnSettingsApplied) ); Bind(pxEvt_ApplySettings, &BaseApplicableConfigPanel::OnSettingsApplied, this);
if( IApplyState* iapp = FindApplyStateManager() ) if( IApplyState* iapp = FindApplyStateManager() )
{ {

View File

@ -44,8 +44,8 @@ using namespace pxSizerFlags;
Panels::BaseSelectorPanel::BaseSelectorPanel( wxWindow* parent ) Panels::BaseSelectorPanel::BaseSelectorPanel( wxWindow* parent )
: BaseApplicableConfigPanel( parent, wxVERTICAL ) : BaseApplicableConfigPanel( parent, wxVERTICAL )
{ {
Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler (BaseSelectorPanel::OnFolderChanged) ); Bind(wxEVT_DIRPICKER_CHANGED, &BaseSelectorPanel::OnFolderChanged, this);
Connect( wxEVT_SHOW, wxShowEventHandler (BaseSelectorPanel::OnShow) ); Bind(wxEVT_SHOW, &BaseSelectorPanel::OnShow, this);
} }
Panels::BaseSelectorPanel::~BaseSelectorPanel() throw() Panels::BaseSelectorPanel::~BaseSelectorPanel() throw()
@ -119,7 +119,7 @@ Panels::BiosSelectorPanel::BiosSelectorPanel( wxWindow* parent )
*this += 8; *this += 8;
*this += m_FolderPicker | StdExpand(); *this += m_FolderPicker | StdExpand();
Connect( refreshButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BiosSelectorPanel::OnRefreshSelections) ); Bind(wxEVT_BUTTON, &BiosSelectorPanel::OnRefreshSelections, this, refreshButton->GetId());
} }
Panels::BiosSelectorPanel::~BiosSelectorPanel() throw () Panels::BiosSelectorPanel::~BiosSelectorPanel() throw ()

View File

@ -170,8 +170,8 @@ Panels::CpuPanelEE::CpuPanelEE( wxWindow* parent )
m_button_RestoreDefaults = new wxButton(this, wxID_DEFAULT, _("Restore Defaults")); m_button_RestoreDefaults = new wxButton(this, wxID_DEFAULT, _("Restore Defaults"));
*this += m_button_RestoreDefaults | StdButton(); *this += m_button_RestoreDefaults | StdButton();
Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CpuPanelEE::OnRestoreDefaults ) ); Bind(wxEVT_BUTTON, &CpuPanelEE::OnRestoreDefaults, this, wxID_DEFAULT);
Bind(wxEVT_COMMAND_RADIOBUTTON_SELECTED, &CpuPanelEE::EECache_Event, this); Bind(wxEVT_RADIOBUTTON, &CpuPanelEE::EECache_Event, this);
} }
Panels::CpuPanelVU::CpuPanelVU( wxWindow* parent ) Panels::CpuPanelVU::CpuPanelVU( wxWindow* parent )
@ -226,7 +226,7 @@ Panels::CpuPanelVU::CpuPanelVU( wxWindow* parent )
m_button_RestoreDefaults = new wxButton(this, wxID_DEFAULT, _("Restore Defaults")); m_button_RestoreDefaults = new wxButton(this, wxID_DEFAULT, _("Restore Defaults"));
*this += m_button_RestoreDefaults | StdButton(); *this += m_button_RestoreDefaults | StdButton();
Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CpuPanelVU::OnRestoreDefaults ) ); Bind(wxEVT_BUTTON, &CpuPanelVU::OnRestoreDefaults, this, wxID_DEFAULT);
} }
void Panels::CpuPanelEE::Apply() void Panels::CpuPanelEE::Apply()

View File

@ -157,7 +157,7 @@ void Panels::DirPickerPanel::InitForRegisteredMode( const wxString& normalized,
pxSetToolTip( m_checkCtrl, pxEt( L"When checked this folder will automatically reflect the default associated with PCSX2's current usermode setting. " ) pxSetToolTip( m_checkCtrl, pxEt( L"When checked this folder will automatically reflect the default associated with PCSX2's current usermode setting. " )
); );
Connect( m_checkCtrl->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DirPickerPanel::UseDefaultPath_Click ) ); Bind(wxEVT_CHECKBOX, &DirPickerPanel::UseDefaultPath_Click, this, m_checkCtrl->GetId());
} }
// Force the Dir Picker to use a text control. This isn't standard on Linux/GTK but it's much // Force the Dir Picker to use a text control. This isn't standard on Linux/GTK but it's much
@ -173,7 +173,7 @@ void Panels::DirPickerPanel::InitForRegisteredMode( const wxString& normalized,
wxButton* b_explore( new wxButton( this, wxID_ANY, _("Open in Explorer") ) ); wxButton* b_explore( new wxButton( this, wxID_ANY, _("Open in Explorer") ) );
pxSetToolTip( b_explore, _("Open an explorer window to this folder.") ); pxSetToolTip( b_explore, _("Open an explorer window to this folder.") );
Connect( b_explore->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DirPickerPanel::Explore_Click ) ); Bind(wxEVT_BUTTON, &DirPickerPanel::Explore_Click, this, b_explore->GetId());
#endif #endif
if (isCompact) if (isCompact)

View File

@ -377,7 +377,7 @@ Panels::GameDatabasePanel::GameDatabasePanel( wxWindow* parent )
*this += sizer1 | pxCenter; *this += sizer1 | pxCenter;
*this += sizer2 | pxCenter; *this += sizer2 | pxCenter;
Connect(searchBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GameDatabasePanel::Search_Click)); Bind(wxEVT_BUTTON, &GameDatabasePanel::Search_Click, this, searchBtn->GetId());
PopulateFields(); PopulateFields();
} }

View File

@ -127,8 +127,7 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
*this += m_check_Enable | StdExpand(); *this += m_check_Enable | StdExpand();
*this += groupSizer | pxCenter; *this += groupSizer | pxCenter;
Bind(wxEVT_CHECKBOX, &GameFixesPanel::OnEnable_Toggled, this, m_check_Enable->GetId());
Connect( m_check_Enable->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GameFixesPanel::OnEnable_Toggled ) );
EnableStuff(); EnableStuff();
} }

View File

@ -264,7 +264,7 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent )
*this += topSizer | StdExpand(); *this += topSizer | StdExpand();
*this += s_misc | StdSpace().Centre(); *this += s_misc | StdSpace().Centre();
Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(LogOptionsPanel::OnCheckBoxClicked) ); Bind(wxEVT_CHECKBOX, &LogOptionsPanel::OnCheckBoxClicked, this);
} }
Panels::BaseCpuLogOptionsPanel* Panels::LogOptionsPanel::GetCpuPanel( const wxString& token ) const Panels::BaseCpuLogOptionsPanel* Panels::LogOptionsPanel::GetCpuPanel( const wxString& token ) const
@ -346,4 +346,3 @@ void Panels::iopLogOptionsPanel::Apply()
conf.m_EnableRegisters = m_hwPanel->GetValue(); conf.m_EnableRegisters = m_hwPanel->GetValue();
conf.m_EnableEvents = m_evtPanel->GetValue(); conf.m_EnableEvents = m_evtPanel->GetValue();
} }

View File

@ -194,7 +194,7 @@ Panels::BaseMcdListPanel::BaseMcdListPanel( wxWindow* parent )
m_btn_Refresh = new wxButton( this, wxID_ANY, _("Refresh list") ); m_btn_Refresh = new wxButton( this, wxID_ANY, _("Refresh list") );
Connect( m_btn_Refresh->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BaseMcdListPanel::OnRefreshSelections) ); Bind(wxEVT_BUTTON, &BaseMcdListPanel::OnRefreshSelections, this, m_btn_Refresh->GetId());
} }
void Panels::BaseMcdListPanel::RefreshMcds() const void Panels::BaseMcdListPanel::RefreshMcds() const
@ -418,31 +418,31 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent
parent->SetWindowStyle(parent->GetWindowStyle() | wxRESIZE_BORDER); parent->SetWindowStyle(parent->GetWindowStyle() | wxRESIZE_BORDER);
Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEventHandler(MemoryCardListPanel_Simple::OnListDrag)); Bind(wxEVT_LIST_BEGIN_DRAG, &MemoryCardListPanel_Simple::OnListDrag, this, m_listview->GetId());
Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(MemoryCardListPanel_Simple::OnListSelectionChanged)); Bind(wxEVT_LIST_ITEM_SELECTED, &MemoryCardListPanel_Simple::OnListSelectionChanged, this, m_listview->GetId());
Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(MemoryCardListPanel_Simple::OnItemActivated));//enter or double click Bind(wxEVT_LIST_ITEM_ACTIVATED, &MemoryCardListPanel_Simple::OnItemActivated, this, m_listview->GetId()); //enter or double click
//Deselected is not working for some reason (e.g. when clicking an empty row at the table?) - avih //Deselected is not working for some reason (e.g. when clicking an empty row at the table?) - avih
Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(MemoryCardListPanel_Simple::OnListSelectionChanged)); Bind(wxEVT_LIST_ITEM_DESELECTED, &MemoryCardListPanel_Simple::OnListSelectionChanged, this, m_listview->GetId());
Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler(MemoryCardListPanel_Simple::OnOpenItemContextMenu) ); Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &MemoryCardListPanel_Simple::OnOpenItemContextMenu, this, m_listview->GetId());
// Connect( m_button_Mount->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard)); //Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnMountCard, this, m_button_Mount->GetId());
Connect( m_button_Create->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateOrDeleteCard)); Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnCreateOrDeleteCard, this, m_button_Create->GetId());
Connect( m_button_Convert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnConvertCard)); Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnConvertCard, this, m_button_Convert->GetId());
Connect( m_button_Rename->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRenameFile)); Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnRenameFile, this, m_button_Rename->GetId());
Connect( m_button_Duplicate->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnDuplicateFile)); Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnDuplicateFile, this, m_button_Duplicate->GetId());
Connect( m_button_AssignUnassign->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnAssignUnassignFile)); Bind(wxEVT_BUTTON, &MemoryCardListPanel_Simple::OnAssignUnassignFile, this, m_button_AssignUnassign->GetId());
// Popup Menu Connections! // Popup Menu Connections!
Connect( McdMenuId_Create, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateOrDeleteCard) ); //Bind(McdMenuId_Mount, &MemoryCardListPanel_Simple::OnMountCard, this, McdMenuId_Mount);
Connect( McdMenuId_Convert, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnConvertCard) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnCreateOrDeleteCard, this, McdMenuId_Create);
//Connect( McdMenuId_Mount, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnConvertCard, this, McdMenuId_Convert);
Connect( McdMenuId_Rename, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRenameFile) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnRenameFile, this, McdMenuId_Rename);
Connect( McdMenuId_AssignUnassign, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnAssignUnassignFile) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnDuplicateFile, this, McdMenuId_Duplicate);
Connect( McdMenuId_Duplicate, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnDuplicateFile) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnAssignUnassignFile, this, McdMenuId_AssignUnassign);
Connect( McdMenuId_RefreshList, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRefreshSelections) ); Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnRefreshSelections, this, McdMenuId_RefreshList);
//because the wxEVT_COMMAND_LIST_ITEM_DESELECTED doesn't work (buttons stay enabled when clicking an empty area of the list), //because the wxEVT_COMMAND_LIST_ITEM_DESELECTED doesn't work (buttons stay enabled when clicking an empty area of the list),
// m_listview can send us an event that indicates a change at the list. Ugly, but works. // m_listview can send us an event that indicates a change at the list. Ugly, but works.

View File

@ -112,7 +112,7 @@ public:
: _parent( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_VIRTUAL ) : _parent( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_VIRTUAL )
{ {
m_externHandler=NULL; m_externHandler=NULL;
Connect( this->GetId(), wxEVT_LEFT_UP, wxEventHandler(BaseMcdListView::OnChanged)); Bind(wxEVT_LEFT_UP, &BaseMcdListView::OnChanged, this, this->GetId());
m_CardProvider = NULL; m_CardProvider = NULL;
} }

View File

@ -65,7 +65,7 @@ Panels::DocsFolderPickerPanel::DocsFolderPickerPanel( wxWindow* parent, bool isF
*this += m_dirpicker_custom | pxExpand.Border( wxLEFT, StdPadding + m_radio_UserMode->GetIndentation() ); *this += m_dirpicker_custom | pxExpand.Border( wxLEFT, StdPadding + m_radio_UserMode->GetIndentation() );
*this += 4; *this += 4;
Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(DocsFolderPickerPanel::OnRadioChanged) ); Bind(wxEVT_RADIOBUTTON, &DocsFolderPickerPanel::OnRadioChanged, this);
} }
DocsModeType Panels::DocsFolderPickerPanel::GetDocsMode() const DocsModeType Panels::DocsFolderPickerPanel::GetDocsMode() const
@ -129,7 +129,7 @@ Panels::LanguageSelectionPanel::LanguageSelectionPanel( wxWindow* parent, bool s
*this += 5; *this += 5;
} }
Connect( pxID_RestartWizard, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LanguageSelectionPanel::OnApplyLanguage_Clicked ) ); Bind(wxEVT_BUTTON, &LanguageSelectionPanel::OnApplyLanguage_Clicked, this, pxID_RestartWizard);
m_picker->SetSelection( 0 ); // always default to System Default m_picker->SetSelection( 0 ); // always default to System Default
} }

View File

@ -429,14 +429,14 @@ Panels::PluginSelectorPanel::PluginSelectorPanel( wxWindow* parent )
// refresh button used for diagnostics... (don't think there's a point to having one otherwise) --air // refresh button used for diagnostics... (don't think there's a point to having one otherwise) --air
//wxButton* refresh = new wxButton( this, wxID_ANY, L"Refresh" ); //wxButton* refresh = new wxButton( this, wxID_ANY, L"Refresh" );
//s_main.Add( refresh ); //s_main.Add( refresh );
//Connect( refresh->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PluginSelectorPanel::OnRefresh ) ); //Bind(wxEVT_BUTTON, &PluginSelectorPanel::OnRefresh, this, refresh->GetId());
Connect( pxEvt_EnumeratedNext, wxCommandEventHandler( PluginSelectorPanel::OnProgress ) ); Bind(pxEvt_EnumeratedNext, &PluginSelectorPanel::OnProgress, this);
Connect( pxEvt_EnumerationFinished, wxCommandEventHandler( PluginSelectorPanel::OnEnumComplete ) ); Bind(pxEvt_EnumerationFinished, &PluginSelectorPanel::OnEnumComplete, this);
Connect( pxEVT_ShowStatusBar, wxCommandEventHandler( PluginSelectorPanel::OnShowStatusBar ) ); Bind(pxEVT_ShowStatusBar, &PluginSelectorPanel::OnShowStatusBar, this);
Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( PluginSelectorPanel::OnPluginSelected ) ); Bind(wxEVT_COMBOBOX, &PluginSelectorPanel::OnPluginSelected, this);
Connect( ButtonId_Configure, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PluginSelectorPanel::OnConfigure_Clicked ) ); Bind(wxEVT_BUTTON, &PluginSelectorPanel::OnConfigure_Clicked, this, ButtonId_Configure);
} }
Panels::PluginSelectorPanel::~PluginSelectorPanel() throw() Panels::PluginSelectorPanel::~PluginSelectorPanel() throw()

View File

@ -242,10 +242,10 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow* parent )
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Connect( m_slider_eecycle->GetId(), wxEVT_SCROLL_CHANGED, wxScrollEventHandler( SpeedHacksPanel::EECycleRate_Scroll ) ); Bind(wxEVT_SCROLL_CHANGED, &SpeedHacksPanel::EECycleRate_Scroll, this, m_slider_eecycle->GetId());
Connect( m_slider_vustealer->GetId(), wxEVT_SCROLL_CHANGED, wxScrollEventHandler( SpeedHacksPanel::VUCycleRate_Scroll ) ); Bind(wxEVT_SCROLL_CHANGED, &SpeedHacksPanel::VUCycleRate_Scroll, this, m_slider_vustealer->GetId());
Connect( m_check_Enable->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SpeedHacksPanel::OnEnable_Toggled ) ); Bind(wxEVT_CHECKBOX, &SpeedHacksPanel::OnEnable_Toggled, this, m_check_Enable->GetId());
Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SpeedHacksPanel::Defaults_Click ) ); Bind(wxEVT_BUTTON, &SpeedHacksPanel::Defaults_Click, this, wxID_DEFAULT);
} }
// Doesn't modify values - only locks(gray out)/unlocks as necessary. // Doesn't modify values - only locks(gray out)/unlocks as necessary.

View File

@ -53,7 +53,7 @@ Panels::ThemeSelectorPanel::ThemeSelectorPanel( wxWindow* parent )
*this += 8; *this += 8;
*this += m_FolderPicker | StdExpand(); *this += m_FolderPicker | StdExpand();
Connect( refreshButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ThemeSelectorPanel::OnRefreshSelections) ); Bind(wxEVT_BUTTON, &ThemeSelectorPanel::OnRefreshSelections, this, refreshButton->GetId());
} }
Panels::ThemeSelectorPanel::~ThemeSelectorPanel() throw () Panels::ThemeSelectorPanel::~ThemeSelectorPanel() throw ()