mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-18 02:12:18 -07: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:
parent
c2a91c613d
commit
16a32d0cc4
1 changed files with 6 additions and 1 deletions
|
|
@ -93,6 +93,8 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||
SetFinish();
|
||||
});
|
||||
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();
|
||||
auto temp = text_ctrl->GetValue();
|
||||
if (temp.ToStdString().empty()) return;
|
||||
|
|
@ -103,10 +105,13 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||
if (tempint > max_temp) {
|
||||
Warning(true, WARNING_TOO_HIGH);
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Warning(false, WARNING_TOO_LOW);
|
||||
}
|
||||
SetFinish();
|
||||
#endif
|
||||
|
||||
Slic3r::GUI::wxGetApp().GetMainTopWindow()->SetFocus();
|
||||
});
|
||||
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue