[Lazarus] New behavior - RadioGroup

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] New behavior - RadioGroup

t.wieckowski
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 ?

best regards
Tomek

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] New behavior - RadioGroup

Juha Manninen
[hidden email] kirjoitti tiistai, 5. huhtikuuta 2011 23:16:29:
> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] New behavior - RadioGroup

zeljko
In reply to this post by t.wieckowski
On Tuesday 05 of April 2011 22:16:29 [hidden email] wrote:
> Hi,
> since rev. 30161, my apps goes crazy.

Where and why your apps goes crazy because of that ?

> 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

zeljko

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] New behavior - RadioGroup

t.wieckowski
2011/4/6 zeljko <[hidden email]>
On Tuesday 05 of April 2011 22:16:29 [hidden email] 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;
RadioGroup1.OnClick:=@RadioGroup1OnClick;

 
> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus