ENH: Navigate while enter valid number
jira: [STUDIO-11440] Change-Id: I01a0b2fdb67b76cbea4c17539951c8d57dc2cd31
This commit is contained in:
parent
1fd5340417
commit
d6b5bbf84b
|
@ -79,18 +79,6 @@ bool TempInput::CheckIsValidVal(bool show_warning)
|
|||
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)
|
||||
{
|
||||
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*/
|
||||
{
|
||||
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
|
||||
|
|
|
@ -127,8 +127,6 @@ public:
|
|||
void ReSetOnChanging() { m_on_changing = false; }
|
||||
|
||||
protected:
|
||||
virtual void OnEdit();
|
||||
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
void DoSetToolTipText(wxString const &tip) override;
|
||||
|
|
Loading…
Reference in New Issue