mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 03:13:39 +00:00
ENH: Navigate while enter valid number
jira: [STUDIO-11440] Change-Id: I01a0b2fdb67b76cbea4c17539951c8d57dc2cd31 (cherry picked from commit d6b5bbf84b75447737bde91961305be522eaf47d)
This commit is contained in:
@@ -79,18 +79,6 @@ bool TempInput::CheckIsValidVal(bool show_warning)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TempInput::OnEdit()
|
|
||||||
{
|
|
||||||
/*clear previous status*/
|
|
||||||
ResetWaringDlg();
|
|
||||||
|
|
||||||
/*check the value is valid or not*/
|
|
||||||
if (CheckIsValidVal(true))
|
|
||||||
{
|
|
||||||
SetFinish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString normal_icon, wxString actice_icon, const wxPoint &pos, const wxSize &size, long style)
|
void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString normal_icon, wxString actice_icon, const wxPoint &pos, const wxSize &size, long style)
|
||||||
{
|
{
|
||||||
StaticBox::Create(parent, wxID_ANY, pos, size, style);
|
StaticBox::Create(parent, wxID_ANY, pos, size, style);
|
||||||
@@ -132,7 +120,18 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||||||
{
|
{
|
||||||
if (!m_on_changing) /*the wxCUSTOMEVT_SET_TEMP_FINISH event may popup a dialog, which may generate dead loop*/
|
if (!m_on_changing) /*the wxCUSTOMEVT_SET_TEMP_FINISH event may popup a dialog, which may generate dead loop*/
|
||||||
{
|
{
|
||||||
OnEdit();
|
/*clear previous status*/
|
||||||
|
ResetWaringDlg();
|
||||||
|
|
||||||
|
/*check the value is valid or not*/
|
||||||
|
if (CheckIsValidVal(true))
|
||||||
|
{
|
||||||
|
SetFinish();
|
||||||
|
|
||||||
|
SetOnChanging();// filter in wxEVT_KILL_FOCUS while navigating
|
||||||
|
text_ctrl->Navigate(); // quit edit mode
|
||||||
|
ReSetOnChanging();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
|
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
|
||||||
|
|||||||
@@ -127,8 +127,6 @@ public:
|
|||||||
void ReSetOnChanging() { m_on_changing = false; }
|
void ReSetOnChanging() { m_on_changing = false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnEdit();
|
|
||||||
|
|
||||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
void DoSetToolTipText(wxString const &tip) override;
|
void DoSetToolTipText(wxString const &tip) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user