Tiziano - Mekar Srl - ha scritto:

Hope this is enlightening for your question. I made some tests with Delphi7 and Delphi5, and looked in the online
help:

Ttrackbar onchange:
-----------------------------------------
Occurs immediately after the value of Position changes (user and
program). I noted that on user input onchange event is fired twice

Tmemo/Tedit onchange:
-----------------------------------------
Occurs when the text for the edit control may have changed.
TCustomedit has a "modified" property that becomes true if the user
changed the text value so in the onchange event we can choose the action
to do in this case, if application changed the value the modified
property is false.

example:
procedure TForm1.Edit1Change(Sender: TObject);
begin
 if edit1.modified
        then {user input}
        else {app change}
end;

It seems a good solution. I've adopted it immediately, for Qt interface.

Note that in lazarus, (vers. 0.9.14 beta, 02/04/06, SVN rev. 9061 for
windows) not only {app change} never occurr (and this is IMO is a bug) Please also note that the onchange event is also fired on form creation
(or activation, don't know exactly).

The OnChange Event is fired when the Tmemo/Tedit is filled up for the first time.

Tcustomcombo onchange:
-----------------------------------------
Occurs when the user changes the text displayed in the edit region.
Note: OnChange only occurs in response to user actions. Changing the
Text property programmatically does not trigger an OnChange event.

The matter is interesting and should be examined eve with other
controls.
Looking into Delphi/Kylix sources, OnChange events are both taken as signals coming from Qt widgets, and locally generated. Maybe we may take some good ideas, or maybe we may find some bad ones to avoid.

Giuliano

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to