Update text input handling based on focus event
dev-time-step
Krzysztof Dermont 2016-02-10 17:03:37 +01:00
parent 1fc9186aaf
commit a611ef3d50
2 changed files with 11 additions and 2 deletions

View File

@ -484,10 +484,12 @@ bool CEdit::EventProcess(const Event &event)
if ( event.customParam == m_eventType )
{
m_bFocus = true;
UpdateFocus();
}
else
{
m_bFocus = false;
UpdateFocus();
}
}
@ -504,10 +506,12 @@ bool CEdit::EventProcess(const Event &event)
if ( m_bEdit || m_bHilite ) m_bCapture = true;
}
m_bFocus = true;
UpdateFocus();
}
else
{
m_bFocus = false;
UpdateFocus();
}
}
@ -3229,9 +3233,13 @@ void CEdit::SetFocus(CControl* control)
if (oldFocus != m_bFocus)
{
// Start/stop text input mode, this toggles the on-screen keyboard
CApplication::GetInstancePointer()->SetTextInput(m_bFocus);
UpdateFocus();
}
}
void CEdit::UpdateFocus()
{
CApplication::GetInstancePointer()->SetTextInput(m_bFocus);
}
}

View File

@ -228,6 +228,7 @@ protected:
void UpdateScroll();
void SetFocus(CControl* control) override;
void UpdateFocus(); // Start/stop text input mode, this toggles the on-screen keyboard
protected:
std::unique_ptr<CScroll> m_scroll; // vertical scrollbar on the right