chiliui
chiliui copied to clipboard
editbox lacks a single listener for all text changes
Text in editbox can be changed by at least three different ways:
- Manually setting it with SetText - which doesn't invoke a listener
- Text deletion, copy, paste - which invokes an OnKeyPress
- Unicode text input - which invokes OnTextInput
OnKeyPress and OnTextInput can also be invoked in some cases where no text has been changed. I suggest we add a new, "OnTextChanged" event that will be invoked for all changes of text, otherwise we'll have ugly code: https://github.com/gajop/Scenario-Editor-Core/blob/master/scen_edit/view/unit_defs_view.lua#L4-L21