mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(CSimpleEditBox): implement OnEscapePressed event handler
This commit is contained in:
parent
9cac949796
commit
06d63cdab8
@ -765,7 +765,8 @@ void CSimpleEditBox::OnEnterPressed() {
|
||||
}
|
||||
|
||||
void CSimpleEditBox::OnEscapePressed() {
|
||||
// TODO
|
||||
this->RunOnEscapePressedScript();
|
||||
// TODO this->DispatchAction(EVENT_ESCAPE);
|
||||
}
|
||||
|
||||
void CSimpleEditBox::OnFrameSizeChanged(float width, float height) {
|
||||
@ -1019,6 +1020,12 @@ void CSimpleEditBox::RunOnEnterPressedScript() {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleEditBox::RunOnEscapePressedScript() {
|
||||
if (this->m_onEscapePressed.luaRef) {
|
||||
this->RunScript(this->m_onEscapePressed, 0, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleEditBox::RunOnTextChangedScript(int32_t changed) {
|
||||
if (this->m_onTextChanged.luaRef) {
|
||||
auto L = FrameScript_GetContext();
|
||||
|
||||
@ -99,6 +99,7 @@ class CSimpleEditBox : public CSimpleFrame, CSimpleFontedFrame {
|
||||
void RunOnEditFocusGainedScript();
|
||||
void RunOnEditFocusLostScript();
|
||||
void RunOnEnterPressedScript();
|
||||
void RunOnEscapePressedScript();
|
||||
void RunOnTextChangedScript(int32_t changed);
|
||||
void SetCursorPosition(int32_t position);
|
||||
void SetHistoryLines(int32_t a2);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user