Page 1 of 1

Selection in GroupBox

Posted: Mon Mar 14, 2011 7:23 pm
by charles.lambert
I'm creating a groupbox at runtime and I assign two radiobuttons to it.

Code: Select all

var
     oGrpBox: TSRVGroupBox;
     oRdb1: TSRVRadioButton;
     oRdb2: TSRVRadioButton;
     oRdb3: TSRVRadioButton;
begin
   // Groupbox
   //
   oGrpBox := TSRVGroupBox.Create(nil);
   oGrpBox.Parent := SRichViewEdit1.RichViewEdit;
   oGrpBox.Name := 'SRVGroupBox';
   oGrpBox.Caption := 'SRVGroupBox';
   oGrpBox.Color := clWhite;

   // Radiobutton 1
   //
   oRdb1 :=TSRVRadioButton.Create(nil);
   oRdb1.Parent := oGrpBox;
   oRdb1.Name := 'RadioButton1';
   oRdb1.Font.Name := 'Microsoft Sans Serif';
   oRdb1.Caption := 'RadioButton1';
   oRdb1.Color := clWhite;
   oRdb1.Left := oGrpBox.Left + 10;
   oRdb1.Top := oGrpBox.Top + 20;

   // Radiobutton 2
   //
   oRdb2 := TSRVRadioButton.Create(nil);
   oRdb2.Parent := oGrpBox;
   oRdb2.Name := 'RadioButton2';
   oRdb2.Font.Name := 'Microsoft Sans Serif';
   oRdb2.Caption := 'RadioButton2';
   oRdb2.Color := clWhite;
   oRdb2.Left := oGrpBox.Left + 10;
   oRdb2.Top := oGrpBox.Top + 40;

   SRichViewEdit1.RichViewEdit.InsertControl('GrpBox', oGrpBox, rvvaMiddle);

What happens is that I can't change the selection after the creation.

I'd like to know if there's any function I have to create to allow that selection. Exemple an OnClick event or something like that...

Regardless,

- Charles

Posted: Mon Mar 14, 2011 8:26 pm
by charles.lambert
I'm not sure this is the good way to add radiobuttons to a groupbox so, I'd like to know how I can create a GroupBox at runtime and add radiobuttons to it.

Thanks

- Charles

Posted: Tue Mar 15, 2011 6:42 am
by Sergey Tkachenko
I tested your code with the latest version of our components (TRichView 13 and ScaleRichView 4), and it works: you can change selection in radiobuttons.
New versions will be uploaded very soon, today or tomorrow.

PS: your code is correct, only one correction: specify the groupbox as an owner for radiobuttons:

Code: Select all

oRdb1 := TSRVRadioButton.Create(oGrpBox);
Otherwise, there will be memory leaks, and radiobuttons will not be saved in RVF.

Posted: Tue Mar 15, 2011 12:48 pm
by charles.lambert
Thank you very much :)

Posted: Tue Mar 15, 2011 1:03 pm
by charles.lambert
I'm currently testing with the demo version and I'd like to know if the update you'll make today or tomorrow will also be available in demo version.

I'm willing to make some tests before buying the ScaleRichView editor. I already have the RichView Editor.

Posted: Tue Mar 15, 2011 5:19 pm
by Sergey Tkachenko
Yes, we will update a trial too.
We are making final preparation, and if we will not find any unexpected bugs in last tests, we will upload it tomorrow.

Posted: Tue Mar 15, 2011 5:21 pm
by charles.lambert
Ok thanks