[Lazarus] Weird Edit events

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jul 13 04:24:40 CEST 2011


I came across some weird behaviour of TDirectoryEdit events, and traced 
these down into the behaviour of the more basic components. IMO the 
events, related to Edit fields, deserve reconsideration.

 From the user VP, an Edit field should *not* trigger events while or 
immediately after it has been loaded. In contrast it should raise an 
event when changed programmatically, at least on demand. Every event 
handler should have a chance to check for *unmodified* Text, when the 
event was not caused by user editing.

The documentation is a bit thin WRT the occurence of events. E.g. what's 
the *intended* difference between OnExit and OnEditingDone? Of course 
it's not easy to cover all user actions, which should signal the end of 
user editing, but we should find a *useful* solution for all typical use 
cases. Then the implementation should be updated to implement the 
(re)defined behaviour, even if it may break legacy code. When this is 
not acceptable, new events have to be implemented, what IMO is not 
desireable.

The basic events OnExit and OnChange IMO are well defined, no need to 
change anything here. More complicated are events like OnEditDone, which 
depend on many more parameters. Here I feel an urgent need to specify 
the conditions, which can (or should not) lead to such an event.

DoDi





More information about the Lazarus mailing list