Custom "wxStaticBoxSizer" (sorts of) 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
smf
Knows some wx things
Knows some wx things
Posts: 32
Joined: Wed Nov 12, 2008 7:04 pm

Custom "wxStaticBoxSizer" (sorts of)

Post by smf » Thu Nov 22, 2012 12:06 am

Hi,

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...

best,
Stefan

Manolo
Can't get richer than this
Can't get richer than this
Posts: 712
Joined: Mon Apr 30, 2012 11:07 pm

Re: Custom "wxStaticBoxSizer" (sorts of)

Post by Manolo » Thu Nov 22, 2012 2:38 am

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.

Post Reply