[lazarus] Bug: Setting checkbox.checked triggers onclick

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Mar 25 10:32:49 EST 2003

On Mon, 24 Mar 2003 09:28:05 +0100 (W. Europe Standard Time)
Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:

> On 23 Mar 2003, Tony Maro wrote:
> > It's not _supposed_ to do that is it?
> Let's say that it doesn't do that in Delphi.

I just tried under Delphi 6: Yes it does. (changing TCustomCheckBox.Checked
via program calls OnClick).

> > I'm trying to detect when a user checks the box so I can enable a save
> > button, but if I change from one record to another and programmatically
> > set the .enabled property it triggers the onclick event for the
> > checkbox.
> This is a good point, which depends actually on the toolkit used.
> Personally, I think that the event 'OnClick' should be separated out in
> 'OnClick' (clicked by user) and 'OnChange' (State of checkbox changed)
> But this will give compatibility problems.

I vote for this OnChange/OnClick separation.
Should I add a boolean property 'UseOnChange'?
What should be the default?


> If I recall correctly, Kylix has the same problem because Qt handles
> it differently from native Win32.
> Michael.
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives

More information about the Lazarus mailing list