From d570691c1da2d3d3c3779cd628544c61829b7209 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 14 Feb 2025 19:48:17 +0800 Subject: [PATCH] FIX:Use wxEVT_COMMAND_BUTTON_CLICKED to replace wxEVT_LEFT_DOWN jira: none Change-Id: Id839e22d7625031635e974e440e3400f0a4003e0 --- src/slic3r/GUI/BaseTransparentDPIFrame.cpp | 4 ++-- src/slic3r/GUI/SyncAmsInfoDialog.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp index 2fdce0b90..04547449c 100644 --- a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp +++ b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp @@ -71,7 +71,7 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame( m_button_ok->SetCornerRadius(FromDIP(6)); 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->SetBackgroundColor(btn_bg_white); @@ -83,7 +83,7 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame( m_button_cancel->SetCornerRadius(FromDIP(6)); 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)); diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index 6918bfa65..f155ada07 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -1345,7 +1345,7 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) : m_button_ok->SetCornerRadius(FromDIP(12)); 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(); EndModal(wxID_YES); SetFocusIgnoringChildren(); @@ -1363,7 +1363,7 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) : m_button_cancel->SetCornerRadius(FromDIP(12)); 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); });