jk3064 / chiliui

a lua-based opengl GUI
GNU General Public License v2.0
15 stars 9 forks source link

editbox lacks a single listener for all text changes #28

Open gajop opened 10 years ago

gajop commented 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