FIX: tempinput popup focus event

Change-Id: I6973d9f23267265ec91ab04a3b7d53e3bf20c3d4
This commit is contained in:
chunmao.guo 2022-08-12 15:16:38 +08:00 committed by Lane.Wei
parent c0b0249194
commit 22c71f7884
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,8 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
text_ctrl->SetMaxLength(3);
state_handler.attach_child(text_ctrl);
text_ctrl->Bind(wxEVT_SET_FOCUS, [this](auto &e) {
e.SetId(GetId());
ProcessEventLocally(e);
e.Skip();
if (m_read_only) return;
// enter input mode
@ -62,6 +64,9 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
if (m_read_only) { SetCursor(wxCURSOR_ARROW); }
});
text_ctrl->Bind(wxEVT_KILL_FOCUS, [this](auto &e) {
e.SetId(GetId());
ProcessEventLocally(e);
e.Skip();
OnEdit();
auto temp = text_ctrl->GetValue();
if (temp.ToStdString().empty()) {