Page 1 of 1

Custom "wxStaticBoxSizer" (sorts of)

Posted: Thu Nov 22, 2012 12:06 am
by smf

I'm in the need of drawing something more sophisticated around a group of widgets (and using a custom background, too). Not only a border and a label (if so, I'd be just using a wxStaticBoxSizer). The widgets themselfes are inside of a wxGridSizer. I can attach this to a derived wxPanel and everything is fine so far... only this: the panel then has exactly the size of the grid-sizer...

This may be a stupid question, but is there another way of telling the derived wxPanel that it should be bigger then the sizer it contains? Or do I have to add additional sizers to the "base"-sizer to achieve this? While I certainly can do it like that, I'd prefer some way which is more like add (say) 16 px to the top and 4 px to every other border of the panel avoiding the "more-sizers"-solution. I'm a little bit lost with this...


Re: Custom "wxStaticBoxSizer" (sorts of)

Posted: Thu Nov 22, 2012 2:38 am
by Manolo
The main sizer, that one which contains the rest of sizers, will manage the size for the window to which is attached.
If you need extra space between the window and its main sizer, I suggest adding borders to the children sizers.