Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

New behavior - RadioGroup

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha gmail
to Unknown author

kirjoitti tiistai, 5. huhtikuuta 2011 23:16:29:

Show quoted text 6 lines
Hi, since rev. 30161, my apps goes crazy. When I'm setting itemindex for Radiogroup in "OnCreateForm" event then OnClick for that control is fired. Such behavior will be from now on ?

Yes.
See issue #15989:
TRadioGroup: OnChange Workaround Fails In Form Initialization

Regards,
Juha

Reply by email

Unknown author
to zeljko

2011/4/6 zeljko

Show quoted text 7 lines
On Tuesday 05 of April 2011 22:16:29 wrote: > Hi, > since rev. 30161, my apps goes crazy. Where and why your apps goes crazy because of that ?

1. in some case I've OnClick code which show some control if another are visible, in that case they are not visible and
I see what it should not see.
2. in some case I've MessageBox in OnClick, then if I've ItemIndex:=2 OnCreate Form then it fired that MessageBox
etc.

but there is no problem, I can use "if not Visible then exit;" <- OnClick
or maybe better solution is:
RadioGroup1.OnClick:=nil;
RadioGroup1.ItemIndex:=2;
;
Show quoted text 10 lines
> When I'm setting itemindex for Radiogroup in "OnCreateForm" event then > OnClick for that control is fired. Actually, I've changed that to be Delphi compat. > Such behavior will be from now on ? Yes, see http://bugs.freepascal.org/view.php?id=15989

IMHO I think that is odd behaviour, better (logical) in that case is to have OnChange event related with ItemIndex (but there's no OnChange for RadioGroup).

what will be now with ListBox,ComboBox.ItemIndex in that case ? I don't have Delphi to check.

Maybe another problem, I read a little about this behavior in Delphi and I do not know if this is true but (in Delphi) Itemindex OnClick fires only when different from the previous value is set. Can't check this.

best regards
Tomek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110406/7662a87c/attachment-0001.html>

Reply by email