[lazarus] Bug: Setting checkbox.checked triggers onclick

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Mar 25 11:37:44 EST 2003


On Tue, 25 Mar 2003 17:22:48 +0100 (W. Europe Standard Time)
Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:

> > > > 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'?
> 
> I think this is a good idea. It should be used consistently to separate
> user events from state changing events.
> 
> > What should be the default?
> 
> Make a global var, which is used as default when creating a combobox.
> The default value should maybe be 'False' for Delphi compatibility.

It's done.
The global variable is named DefaultButtonControlUseOnChange. Long names for
seldom used things.


Mattias






More information about the Lazarus mailing list