mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-25 21:36:05 +03:00
feat(ui): add Tab button handler for CSimpleEditBox
This commit is contained in:
parent
6030a75530
commit
c4a516c44d
@ -878,6 +878,11 @@ int32_t CSimpleEditBox::OnLayerKeyDown(const CKeyEvent& evt) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case KEY_TAB: {
|
||||||
|
this->RunOnTabPressedScript();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// - remaining keys
|
// - remaining keys
|
||||||
|
|
||||||
@ -1001,6 +1006,13 @@ void CSimpleEditBox::RunOnEnterPressedScript() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleEditBox::RunOnTabPressedScript() {
|
||||||
|
if (this->m_onTabPressed.luaRef) {
|
||||||
|
this->RunScript(this->m_onTabPressed, 0, 0);
|
||||||
|
}
|
||||||
|
// TODO: virtual call of CSimpleEditBox::DispatchAction ?
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleEditBox::RunOnTextChangedScript(int32_t changed) {
|
void CSimpleEditBox::RunOnTextChangedScript(int32_t changed) {
|
||||||
if (this->m_onTextChanged.luaRef) {
|
if (this->m_onTextChanged.luaRef) {
|
||||||
auto L = FrameScript_GetContext();
|
auto L = FrameScript_GetContext();
|
||||||
|
|||||||
@ -99,6 +99,7 @@ class CSimpleEditBox : public CSimpleFrame, CSimpleFontedFrame {
|
|||||||
void RunOnEditFocusGainedScript();
|
void RunOnEditFocusGainedScript();
|
||||||
void RunOnEditFocusLostScript();
|
void RunOnEditFocusLostScript();
|
||||||
void RunOnEnterPressedScript();
|
void RunOnEnterPressedScript();
|
||||||
|
void RunOnTabPressedScript();
|
||||||
void RunOnTextChangedScript(int32_t changed);
|
void RunOnTextChangedScript(int32_t changed);
|
||||||
void SetCursorPosition(int32_t position);
|
void SetCursorPosition(int32_t position);
|
||||||
void SetHistoryLines(int32_t a2);
|
void SetHistoryLines(int32_t a2);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user