FIX:Use wxEVT_COMMAND_BUTTON_CLICKED to replace wxEVT_LEFT_DOWN

jira: none
Change-Id: Id839e22d7625031635e974e440e3400f0a4003e0
This commit is contained in:
zhou.xu 2025-02-14 19:48:17 +08:00 committed by lane.wei
parent b0a8dd1014
commit d570691c1d
2 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame(
m_button_ok->SetCornerRadius(FromDIP(6)); m_button_ok->SetCornerRadius(FromDIP(6));
bSizer_button->Add(m_button_ok, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10)); bSizer_button->Add(m_button_ok, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { deal_ok(); }); m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) { deal_ok(); });
m_button_cancel = new Button(this, cancel_text); m_button_cancel = new Button(this, cancel_text);
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetBackgroundColor(btn_bg_white);
@ -83,7 +83,7 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame(
m_button_cancel->SetCornerRadius(FromDIP(6)); m_button_cancel->SetCornerRadius(FromDIP(6));
bSizer_button->Add(m_button_cancel, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10)); bSizer_button->Add(m_button_cancel, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { deal_cancel(); }); m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) { deal_cancel(); });
m_sizer_main->Add(bSizer_button, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(20)); m_sizer_main->Add(bSizer_button, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(20));

View File

@ -1345,7 +1345,7 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
m_button_ok->SetCornerRadius(FromDIP(12)); m_button_ok->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_ok, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10)); bSizer_button->Add(m_button_ok, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) {
deal_ok(); deal_ok();
EndModal(wxID_YES); EndModal(wxID_YES);
SetFocusIgnoringChildren(); SetFocusIgnoringChildren();
@ -1363,7 +1363,7 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
m_button_cancel->SetCornerRadius(FromDIP(12)); m_button_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_cancel, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10)); bSizer_button->Add(m_button_cancel, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) {
EndModal(wxID_CANCEL); EndModal(wxID_CANCEL);
}); });