To let the program do actions after events I have seen there are two options in Upp:
- To use "virtual" functions
For example to get the "enter" key in an EditField it is necessary to do a derived class
that catches virtual bool Key(dword key, int rep);
- To use callback
For example to do something after clicking in an ArrayCtrl it could be done by assigning a callback function to "WhenLeftClick".
From the user (programmer) point of view it seems better callback functions as you do not need to do derived classes every time you need a certain response after a Ctrl event.
Personally I stronger prefer callback but, what do you think about it ?
Best regards
Koldo
In my upp sources EditField has WhenEnter callback. I guess it could be added to the main tree as now I can see I'm not the only one who needs it
Just to be sure, if callback is empty, Enter is ignored and passed to the parent?