wxSizer problem Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
gpu
Experienced Solver
Experienced Solver
Posts: 92
Joined: Tue Aug 12, 2014 3:46 am

wxSizer problem

Post by gpu »

I create a wxFlexGridSizer(2), but I want the 1st child to be the whole 1st row (have the width of the parent), then start the 2nd row, each row have 2 child, is it possible?
And can wxSizer add another wxSizer as a child?
Can wxSizer not be the whole sizer of the parent thorough SetSizer, but just occupy part area of the panel, does it have API to set its posiont and size ?
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSizer problem

Post by doublemax »

I create a wxFlexGridSizer(2), but I want the 1st child to be the whole 1st row (have the width of the parent), then start the 2nd row, each row have 2 child, is it possible?
You need wxGridBagSizer for that.
And can wxSizer add another wxSizer as a child?
Yes.
Can wxSizer not be the whole sizer of the parent thorough SetSizer, but just occupy part area of the panel, does it have API to set its posiont and size ?
No.
Use the source, Luke!
gpu
Experienced Solver
Experienced Solver
Posts: 92
Joined: Tue Aug 12, 2014 3:46 am

Re: wxSizer problem

Post by gpu »

And can wxSizer add another wxSizer as a child?
what is the API?I didn\'t find it ...
And I now doesn't use wxSizer. I completely set the position and size by myself, and I find it works well and more easy to get the right result when I scale them.
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSizer problem

Post by doublemax »

wxSizer::Add(...) can take a wxWindow* or wxSizer* as parameter.
I completely set the position and size by myself, and I find it works well and more easy to get the right result when I scale them.
In you mean the panels on the scrolledwindow, yes, there is definitely no need to use sizers in that case.
Use the source, Luke!
gpu
Experienced Solver
Experienced Solver
Posts: 92
Joined: Tue Aug 12, 2014 3:46 am

Re: wxSizer problem

Post by gpu »

doublemax wrote:wxSizer::Add(...) can take a wxWindow* or wxSizer* as parameter.
I completely set the position and size by myself, and I find it works well and more easy to get the right result when I scale them.
In you mean the panels on the scrolledwindow, yes, there is definitely no need to use sizers in that case.
I mean the small panels which owns some controls, and these small panels are on a big panel, then the big panels are on the scrollWindow
I used to use the wxSizer on both the small and big panel, and use default position and size for the controls on small panel and the same as the small panel on the big panel...then use Fit()
But I found it's a litter hard to get the exactly right position and size for them when i scale, that's why I abandon wxSizer here, another reason is the scale is always applyed to the whole scrollWindow and all the panel.
And I really don't why use wxSizer , when I scale , it's hard to get the exact right result....
gpu
Experienced Solver
Experienced Solver
Posts: 92
Joined: Tue Aug 12, 2014 3:46 am

Re: wxSizer problem

Post by gpu »

what's ur opinion about scale problem? Is it better to use or not to use wxSizer?
I have to scale all the big panel on the wxScrollWindow, the small panel on the big panel, and the controls on the small panels.
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSizer problem

Post by doublemax »

As the sizers don't know about your scaling, I'd tend against using sizers.
Use the source, Luke!
Post Reply