[Gambas-user] CheckBox_MouseUp huge PB
Benoît Minisini
gambas at ...1...
Sun Aug 23 22:59:03 CEST 2009
> Benoît Minisini a écrit :
> >> Fabien Bodard a écrit :
> >>> it seem that the click event is send after the .value setting... but
> >>> the MouseUp before.
> >>>
> >>> why did you not use the click event ?
> >>
> >> I don't use it because it is raised after the .Value has changed and I
> >> need to be able to forbid any change in some conditions.
> >
> > - You can't assume any relationship between Mouse events and the Click
> > event raised when the value has changed.
>
> That's NOW obvious, but not @ first glance and without a test to see
> exactly which order is given to events.
>
And because you can raise the Click event by code, or by using only the
keyboard.
> > - If the checkbox should not be changed, then it must be disabled before
> > the user tries to change it.
>
> That doesn't prevent MouseDown/Up etc events to be raised
Why should it?
> (remember, I use
> it for 2 purposes: display and set/unset; BTW, Fabien, that remember me why
> I didn't used the Click event: it is also raised when the application
> change the .Value of the CheckBox)
>
If you really have to make a difference between a change coming from the
application and a change coming from the user, then use a boolean flag, like
"bIgnoreClickEvent", that you set explicitely when needed.
Regards,
--
Benoît
More information about the User
mailing list