Selection in GroupBox

General TRichView support forum. Please post your questions here
Post Reply
charles.lambert
Posts: 26
Joined: Mon Jul 05, 2010 7:44 pm

Selection in GroupBox

Post 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
charles.lambert
Posts: 26
Joined: Mon Jul 05, 2010 7:44 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
charles.lambert
Posts: 26
Joined: Mon Jul 05, 2010 7:44 pm

Post by charles.lambert »

Thank you very much :)
charles.lambert
Posts: 26
Joined: Mon Jul 05, 2010 7:44 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
charles.lambert
Posts: 26
Joined: Mon Jul 05, 2010 7:44 pm

Post by charles.lambert »

Ok thanks
Post Reply