mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): handle escape key events in CSimpleEditBox (#103)
Co-authored-by: fallenoak <git@fallenoak.me>
This commit is contained in:
parent
5055e03f65
commit
66ffd99696
@ -765,7 +765,8 @@ void CSimpleEditBox::OnEnterPressed() {
|
||||
}
|
||||
|
||||
void CSimpleEditBox::OnEscapePressed() {
|
||||
// TODO
|
||||
this->RunOnEscapePressedScript();
|
||||
// TODO this->DispatchAction(EVENT_ESCAPE);
|
||||
}
|
||||
|
||||
void CSimpleEditBox::OnTabPressed() {
|
||||
@ -1028,6 +1029,12 @@ void CSimpleEditBox::RunOnEnterPressedScript() {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleEditBox::RunOnEscapePressedScript() {
|
||||
if (this->m_onEscapePressed.luaRef) {
|
||||
this->RunScript(this->m_onEscapePressed, 0, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleEditBox::RunOnTabPressedScript() {
|
||||
if (this->m_onTabPressed.luaRef) {
|
||||
this->RunScript(this->m_onTabPressed, 0, nullptr);
|
||||
|
||||
@ -100,6 +100,7 @@ class CSimpleEditBox : public CSimpleFrame, CSimpleFontedFrame {
|
||||
void RunOnEditFocusGainedScript();
|
||||
void RunOnEditFocusLostScript();
|
||||
void RunOnEnterPressedScript();
|
||||
void RunOnEscapePressedScript();
|
||||
void RunOnTabPressedScript();
|
||||
void RunOnTextChangedScript(int32_t changed);
|
||||
void SetCursorPosition(int32_t position);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user