mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
FIX: wxCUSTOMEVT_SET_TEMP_FINISH triggered twice while press enter
jira: [none] Change-Id: I356fc4c6649dfe332fcb419bde0339d340d89242 (cherry picked from commit 541f91acec10eb7813c3a2c43411407252ca7d63)
This commit is contained in:
@@ -93,6 +93,8 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||||||
SetFinish();
|
SetFinish();
|
||||||
});
|
});
|
||||||
text_ctrl->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent &e) {
|
text_ctrl->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent &e) {
|
||||||
|
/*the wxEVT_KILL_FOCUS will be triggered in Slic3r::GUI::wxGetApp().GetMainTopWindow()->SetFocus() for win or linux, but not APPLE*/
|
||||||
|
#ifdef __APPLE__
|
||||||
OnEdit();
|
OnEdit();
|
||||||
auto temp = text_ctrl->GetValue();
|
auto temp = text_ctrl->GetValue();
|
||||||
if (temp.ToStdString().empty()) return;
|
if (temp.ToStdString().empty()) return;
|
||||||
@@ -103,10 +105,13 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||||||
if (tempint > max_temp) {
|
if (tempint > max_temp) {
|
||||||
Warning(true, WARNING_TOO_HIGH);
|
Warning(true, WARNING_TOO_HIGH);
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Warning(false, WARNING_TOO_LOW);
|
Warning(false, WARNING_TOO_LOW);
|
||||||
}
|
}
|
||||||
SetFinish();
|
SetFinish();
|
||||||
|
#endif
|
||||||
|
|
||||||
Slic3r::GUI::wxGetApp().GetMainTopWindow()->SetFocus();
|
Slic3r::GUI::wxGetApp().GetMainTopWindow()->SetFocus();
|
||||||
});
|
});
|
||||||
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
|
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
|
||||||
|
|||||||
Reference in New Issue
Block a user