grouping Check Boxes Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
johnnie
Experienced Solver
Experienced Solver
Posts: 64
Joined: Mon Jan 14, 2008 8:59 am
Location: Bangalore
Contact:

grouping Check Boxes

Post by johnnie » Wed Jun 04, 2008 4:28 am

I want to group the check boxes like a array of items. Is there any possibility of grouping the checkboxes.

I tried using wxcheckListBox , but the orientation of checkboxes could not be changed.I need the checkboxes in 5*4 matrix .But wxcheckListBox shows only in horiantal way.
--johnniealan --

Frank
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Jan 01, 2005 6:19 pm

Post by Frank » Wed Jun 04, 2008 9:02 am

You can use a wxFlexGridSizer.

Set the rows/colums to 5 and 4. Then you just insert the checkboxes.

johnnie
Experienced Solver
Experienced Solver
Posts: 64
Joined: Mon Jan 14, 2008 8:59 am
Location: Bangalore
Contact:

Post by johnnie » Thu Jun 05, 2008 3:30 am

But how do I get array of references to the check Boxes placed inside the sizer
--johnniealan --

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Thu Jun 05, 2008 6:16 am

Upon creating the checkboxes, you could store the contents in a std::vector array or maybe a hash map / list it depends on how you wish to access them.

They will be automatically deleted by the framework but it offers you a container to maybe access them faster.

Be careful that you don't overdo the number of controls in a GUI which that I mean if you need to scale your app later to allow a flexible amount of rows / columns for your checkboxes, I would not create wxCheckBox controls, but one custom control that emulates checkboxes by e.g. clickable pictures.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Fri Jun 06, 2008 12:27 am

johnnie wrote:But how do I get array of references to the check Boxes placed inside the sizer
By keeping pointers to them when you create them

johnnie
Experienced Solver
Experienced Solver
Posts: 64
Joined: Mon Jan 14, 2008 8:59 am
Location: Bangalore
Contact:

Post by johnnie » Mon Jun 09, 2008 3:42 am

Jorg and Auria Thanks a lot...
--johnniealan --

Post Reply