chiliui icon indicating copy to clipboard operation
chiliui copied to clipboard

editbox lacks a single listener for all text changes

Open gajop opened this issue 10 years ago • 0 comments

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

gajop avatar Jun 29 '14 14:06 gajop