Replace all of Connect/Disconnect with Bind/Unbind.

This commit is contained in:
Jordan Woyak 2013-01-13 12:07:45 -06:00
parent 60a73bcd77
commit 70427b3f35
13 changed files with 68 additions and 119 deletions

View File

@ -136,7 +136,7 @@ void wxCheatsWindow::Init_ChildControls()
wxButton* const button_cancel = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize); wxButton* const button_cancel = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize);
button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &wxCheatsWindow::OnEvent_ButtonClose_Press, 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(); wxStdDialogButtonSizer* const sButtons = new wxStdDialogButtonSizer();
sButtons->AddButton(button_apply); 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(textctrl_value, 0, wxALL, 5);
sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxALL, 5); sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxALL, 5);
Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CreateCodeDialog::PressOK)); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CreateCodeDialog::PressOK, this, wxID_OK);
Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CreateCodeDialog::PressCancel)); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CreateCodeDialog::PressCancel, this, wxID_CANCEL);
Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(CreateCodeDialog::OnEvent_Close), (wxObject*)0, this); Bind(wxEVT_CLOSE_WINDOW, &CreateCodeDialog::OnEvent_Close, this);
SetSizerAndFit(sizer_main); SetSizerAndFit(sizer_main);
SetFocus(); SetFocus();

View File

@ -56,24 +56,24 @@ FifoPlayerDlg::FifoPlayerDlg(wxWindow * const parent) :
FifoPlayerDlg::~FifoPlayerDlg() FifoPlayerDlg::~FifoPlayerDlg()
{ {
Disconnect(RECORDING_FINISHED_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnRecordingFinished), NULL, this); Unbind(RECORDING_FINISHED_EVENT, &FifoPlayerDlg::OnRecordingFinished, this);
Disconnect(FRAME_WRITTEN_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnFrameWritten), NULL, this); Unbind(FRAME_WRITTEN_EVENT, &FifoPlayerDlg::OnFrameWritten, this);
// Disconnect Events // Disconnect Events
Disconnect(wxEVT_PAINT, wxPaintEventHandler(FifoPlayerDlg::OnPaint), NULL, this); Unbind(wxEVT_PAINT, &FifoPlayerDlg::OnPaint, this);
m_FrameFromCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameFrom), NULL, this); m_FrameFromCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameFrom, this);
m_FrameToCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnFrameTo), NULL, this); m_FrameToCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameTo, this);
m_ObjectFromCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectFrom), NULL, this); m_ObjectFromCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectFrom, this);
m_ObjectToCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnObjectTo), NULL, this); m_ObjectToCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectTo, this);
m_EarlyMemoryUpdates->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCheckEarlyMemoryUpdates), NULL, this); m_EarlyMemoryUpdates->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &FifoPlayerDlg::OnCheckEarlyMemoryUpdates, this);
m_RecordStop->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnRecordStop), NULL, this); m_RecordStop->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnRecordStop, this);
m_Save->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnSaveFile), NULL, this); m_Save->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnSaveFile, this);
m_FramesToRecordCtrl->Disconnect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(FifoPlayerDlg::OnNumFramesToRecord), NULL, this); m_FramesToRecordCtrl->Unbind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnNumFramesToRecord, this);
m_Close->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FifoPlayerDlg::OnCloseClick), NULL, this); m_Close->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &FifoPlayerDlg::OnCloseClick, this);
m_framesList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnFrameListSelectionChanged), NULL, this); m_framesList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnFrameListSelectionChanged, this);
m_objectsList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectListSelectionChanged), NULL, this); m_objectsList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectListSelectionChanged, this);
m_objectCmdList->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectCmdListSelectionChanged), NULL, this); m_objectCmdList->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &FifoPlayerDlg::OnObjectCmdListSelectionChanged, this);
FifoPlayer::GetInstance().SetFrameWrittenCallback(NULL); FifoPlayer::GetInstance().SetFrameWrittenCallback(NULL);
@ -306,7 +306,7 @@ void FifoPlayerDlg::CreateGUIControls()
Center(wxBOTH); Center(wxBOTH);
// Connect Events // 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_FrameFromCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameFrom, this);
m_FrameToCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameTo, this); m_FrameToCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnFrameTo, this);
m_ObjectFromCtrl->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &FifoPlayerDlg::OnObjectFrom, 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); entry.Set(wxACCEL_CTRL, (int)'C', wxID_COPY);
wxAcceleratorTable accel(1, &entry); wxAcceleratorTable accel(1, &entry);
m_objectCmdList->SetAcceleratorTable(accel); 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); Bind(RECORDING_FINISHED_EVENT, &FifoPlayerDlg::OnRecordingFinished, this);
Connect(FRAME_WRITTEN_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnFrameWritten), NULL, this); Bind(FRAME_WRITTEN_EVENT, &FifoPlayerDlg::OnFrameWritten, this);
Show(); Show();
} }
@ -784,7 +784,7 @@ void FifoPlayerDlg::OnCloseClick(wxCommandEvent& WXUNUSED(event))
Hide(); Hide();
} }
void FifoPlayerDlg::OnRecordingFinished(wxCommandEvent& WXUNUSED(event)) void FifoPlayerDlg::OnRecordingFinished(wxEvent&)
{ {
m_RecordStop->SetLabel(_("Record")); m_RecordStop->SetLabel(_("Record"));
m_RecordStop->Enable(); m_RecordStop->Enable();
@ -792,7 +792,7 @@ void FifoPlayerDlg::OnRecordingFinished(wxCommandEvent& WXUNUSED(event))
UpdateRecorderGui(); UpdateRecorderGui();
} }
void FifoPlayerDlg::OnFrameWritten(wxCommandEvent& WXUNUSED(event)) void FifoPlayerDlg::OnFrameWritten(wxEvent&)
{ {
m_CurrentFrameLabel->SetLabel(CreateCurrentFrameLabel()); m_CurrentFrameLabel->SetLabel(CreateCurrentFrameLabel());
m_NumObjectsLabel->SetLabel(CreateFileObjectCountLabel()); m_NumObjectsLabel->SetLabel(CreateFileObjectCountLabel());

View File

@ -51,8 +51,8 @@ private:
void OnSearchFieldTextChanged(wxCommandEvent& event); void OnSearchFieldTextChanged(wxCommandEvent& event);
void ChangeSearchResult(unsigned int result_idx); void ChangeSearchResult(unsigned int result_idx);
void OnRecordingFinished(wxCommandEvent& event); void OnRecordingFinished(wxEvent& event);
void OnFrameWritten(wxCommandEvent& event); void OnFrameWritten(wxEvent& event);
void OnFrameListSelectionChanged(wxCommandEvent& event); void OnFrameListSelectionChanged(wxCommandEvent& event);
void OnObjectListSelectionChanged(wxCommandEvent& event); void OnObjectListSelectionChanged(wxCommandEvent& event);

View File

@ -424,9 +424,7 @@ CFrame::CFrame(wxFrame* parent,
// ------------------------- // -------------------------
// Connect event handlers // Connect event handlers
m_Mgr->Connect(wxID_ANY, wxEVT_AUI_RENDER, // Resize m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this);
wxAuiManagerEventHandler(CFrame::OnManagerResize),
(wxObject*)0, this);
// ---------- // ----------
// Update controls // Update controls

View File

@ -1004,15 +1004,11 @@ wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title,
m_MainSizer->Add(Child, 1, wxEXPAND); m_MainSizer->Add(Child, 1, wxEXPAND);
Frame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, Frame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnFloatingPageClosed, this);
wxCloseEventHandler(CFrame::OnFloatingPageClosed),
(wxObject*)0, this);
if (Id == IDM_CONSOLEWINDOW_PARENT) if (Id == IDM_CONSOLEWINDOW_PARENT)
{ {
Frame->Connect(wxID_ANY, wxEVT_SIZE, Frame->Bind(wxEVT_SIZE, &CFrame::OnFloatingPageSize, this);
wxSizeEventHandler(CFrame::OnFloatingPageSize),
(wxObject*)0, this);
} }
// Main sizer // Main sizer

View File

@ -958,15 +958,9 @@ void CFrame::StartGame(const std::string& filename)
wxSize size(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, wxSize size(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth,
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight); SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight);
m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight()); m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight());
m_RenderFrame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, m_RenderFrame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnRenderParentClose, this);
wxCloseEventHandler(CFrame::OnRenderParentClose), m_RenderFrame->Bind(wxEVT_ACTIVATE, &CFrame::OnActive, this);
(wxObject*)0, this); m_RenderFrame->Bind(wxEVT_MOVE, &CFrame::OnRenderParentMove, 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_RenderParent = new CPanel(m_RenderFrame, wxID_ANY); m_RenderParent = new CPanel(m_RenderFrame, wxID_ANY);
m_RenderFrame->Show(); m_RenderFrame->Show();
} }
@ -999,30 +993,14 @@ void CFrame::StartGame(const std::string& filename)
m_RenderParent->SetFocus(); m_RenderParent->SetFocus();
#endif #endif
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Bind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this);
wxKeyEventHandler(CFrame::OnKeyDown), wxTheApp->Bind(wxEVT_KEY_UP, &CFrame::OnKeyUp, this);
(wxObject*)0, this); wxTheApp->Bind(wxEVT_RIGHT_DOWN, &CFrame::OnMouse, this);
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_UP, wxTheApp->Bind(wxEVT_RIGHT_UP, &CFrame::OnMouse, this);
wxKeyEventHandler(CFrame::OnKeyUp), wxTheApp->Bind(wxEVT_MIDDLE_DOWN, &CFrame::OnMouse, this);
(wxObject*)0, this); wxTheApp->Bind(wxEVT_MIDDLE_UP, &CFrame::OnMouse, this);
wxTheApp->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, // Mouse wxTheApp->Bind(wxEVT_MOTION, &CFrame::OnMouse, this);
wxMouseEventHandler(CFrame::OnMouse), m_RenderParent->Bind(wxEVT_SIZE, &CFrame::OnRenderParentResize, this);
(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);
} }
wxEndBusyCursor(); wxEndBusyCursor();
@ -1125,30 +1103,18 @@ void CFrame::DoStop()
m_RenderFrame->SetTitle(wxString::FromAscii(scm_rev_str)); m_RenderFrame->SetTitle(wxString::FromAscii(scm_rev_str));
// Destroy the renderer frame when not rendering to main // Destroy the renderer frame when not rendering to main
m_RenderParent->Disconnect(wxID_ANY, wxEVT_SIZE, m_RenderParent->Unbind(wxEVT_SIZE, &CFrame::OnRenderParentResize, this);
wxSizeEventHandler(CFrame::OnRenderParentResize),
(wxObject*)0, this); // Keyboard
wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Unbind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this);
wxKeyEventHandler(CFrame::OnKeyDown), wxTheApp->Unbind(wxEVT_KEY_UP, &CFrame::OnKeyUp, this);
(wxObject*)0, this);
wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_UP, // Mouse
wxKeyEventHandler(CFrame::OnKeyUp), wxTheApp->Unbind(wxEVT_RIGHT_DOWN, &CFrame::OnMouse, this);
(wxObject*)0, this); wxTheApp->Unbind(wxEVT_RIGHT_UP, &CFrame::OnMouse, this);
wxTheApp->Disconnect(wxID_ANY, wxEVT_RIGHT_DOWN, // Mouse wxTheApp->Unbind(wxEVT_MIDDLE_DOWN, &CFrame::OnMouse, this);
wxMouseEventHandler(CFrame::OnMouse), wxTheApp->Unbind(wxEVT_MIDDLE_UP, &CFrame::OnMouse, this);
(wxObject*)0, this); wxTheApp->Unbind(wxEVT_MOTION, &CFrame::OnMouse, 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);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
m_RenderParent->SetCursor(wxNullCursor); m_RenderParent->SetCursor(wxNullCursor);
DoFullscreen(false); DoFullscreen(false);

View File

@ -56,9 +56,7 @@ void GCMicDialog::SaveButtonMapping(int Id, int Key, int Modkey)
void GCMicDialog::EndGetButtons(void) void GCMicDialog::EndGetButtons(void)
{ {
wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Unbind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this);
wxKeyEventHandler(GCMicDialog::OnKeyDown),
(wxObject*)0, this);
m_ButtonMappingTimer->Stop(); m_ButtonMappingTimer->Stop();
GetButtonWaitingTimer = 0; GetButtonWaitingTimer = 0;
GetButtonWaitingID = 0; GetButtonWaitingID = 0;
@ -153,9 +151,7 @@ void GCMicDialog::OnButtonClick(wxCommandEvent& event)
if (m_ButtonMappingTimer->IsRunning()) return; if (m_ButtonMappingTimer->IsRunning()) return;
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Bind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this);
wxKeyEventHandler(GCMicDialog::OnKeyDown),
(wxObject*)0, this);
// Get the button // Get the button
ClickedButton = (wxButton *)event.GetEventObject(); ClickedButton = (wxButton *)event.GetEventObject();

View File

@ -56,9 +56,7 @@ void HotkeyConfigDialog::SaveButtonMapping(int Id, int Key, int Modkey)
void HotkeyConfigDialog::EndGetButtons(void) void HotkeyConfigDialog::EndGetButtons(void)
{ {
wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Unbind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
wxKeyEventHandler(HotkeyConfigDialog::OnKeyDown),
(wxObject*)0, this);
m_ButtonMappingTimer->Stop(); m_ButtonMappingTimer->Stop();
GetButtonWaitingTimer = 0; GetButtonWaitingTimer = 0;
GetButtonWaitingID = 0; GetButtonWaitingID = 0;
@ -153,9 +151,7 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
if (m_ButtonMappingTimer->IsRunning()) return; if (m_ButtonMappingTimer->IsRunning()) return;
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
wxKeyEventHandler(HotkeyConfigDialog::OnKeyDown),
(wxObject*)0, this);
// Get the button // Get the button
ClickedButton = (wxButton *)event.GetEventObject(); ClickedButton = (wxButton *)event.GetEventObject();

View File

@ -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 // 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); ChangeBannerDetails((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
m_Banner->SetBitmap(OpenGameListItem->GetImage()); m_Banner->SetBitmap(OpenGameListItem->GetImage());
m_Banner->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, m_Banner->Bind(wxEVT_RIGHT_DOWN, &CISOProperties::RightClickOnBanner, this);
wxMouseEventHandler(CISOProperties::RightClickOnBanner), (wxObject*)NULL, this);
// Filesystem browser/dumper // Filesystem browser/dumper
// TODO : Should we add a way to browse the wad file ? // TODO : Should we add a way to browse the wad file ?

View File

@ -971,7 +971,7 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin
UpdateDeviceComboBox(); UpdateDeviceComboBox();
UpdateProfileComboBox(); 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); wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL);
szr->Add(m_pad_notebook, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5); 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 // live preview update timer
m_update_timer = new wxTimer(this, -1); 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); m_update_timer->Start(PREVIEW_UPDATE_TIME, wxTIMER_CONTINUOUS);
} }

View File

@ -149,13 +149,11 @@ class CMemcardManager : public wxDialog
: wxListCtrl(parent, id, pos, size, style) : wxListCtrl(parent, id, pos, size, style)
, __mcmSettings(_mcmSetngs) , __mcmSettings(_mcmSetngs)
{ {
Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler( Bind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this);
CMemcardListCtrl::OnRightClick));
} }
~CMemcardListCtrl() ~CMemcardListCtrl()
{ {
Disconnect(wxEVT_RIGHT_DOWN, wxMouseEventHandler( Unbind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this);
CMemcardListCtrl::OnRightClick));
} }
_mcmSettings & __mcmSettings; _mcmSettings & __mcmSettings;
bool prevPage, bool prevPage,

View File

@ -188,7 +188,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
{ {
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str()); 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); 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); wxButton* const btn_close = new wxButton(this, wxID_OK, _("Close"), wxDefaultPosition);
btn_close->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VideoConfigDiag::Event_ClickClose, 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); wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL);
szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5); 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) wxControl* VideoConfigDiag::RegisterControl(wxControl* const control, const wxString& description)
{ {
ctrl_descs.insert(std::pair<wxWindow*,wxString>(control, description)); ctrl_descs.insert(std::pair<wxWindow*,wxString>(control, description));
control->Connect(wxID_ANY, wxEVT_ENTER_WINDOW, wxMouseEventHandler(VideoConfigDiag::Evt_EnterControl), NULL, this); control->Bind(wxEVT_ENTER_WINDOW, &VideoConfigDiag::Evt_EnterControl, this);
control->Connect(wxID_ANY, wxEVT_LEAVE_WINDOW, wxMouseEventHandler(VideoConfigDiag::Evt_LeaveControl), NULL, this); control->Bind(wxEVT_LEAVE_WINDOW, &VideoConfigDiag::Evt_LeaveControl, this);
return control; return control;
} }

View File

@ -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(general_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 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)); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::Save, this, wxID_OK);
Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(WiimoteConfigDiag::Cancel)); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &WiimoteConfigDiag::Cancel, this, wxID_CANCEL);
SetSizerAndFit(main_sizer); SetSizerAndFit(main_sizer);
Center(); Center();