Open gajop opened 10 years ago
Text in editbox can be changed by at least three different ways: 1) Manually setting it with SetText - which doesn't invoke a listener 2) Text deletion, copy, paste - which invokes an OnKeyPress 3) 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
Text in editbox can be changed by at least three different ways: 1) Manually setting it with SetText - which doesn't invoke a listener 2) Text deletion, copy, paste - which invokes an OnKeyPress 3) 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