Silly Qestion on Layout::BoxSizer in Panel.

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
Mungo1981
Experienced Solver
Experienced Solver
Posts: 86
Joined: Wed Jan 30, 2019 5:42 pm

Silly Qestion on Layout::BoxSizer in Panel.

Post by Mungo1981 » Tue May 14, 2019 7:32 pm

So here I'm back.
I try to begin my Project at Zero.
And I think it would be the realisticy Option I have.
So to my first silly Question:
I have a Notebook in a Frame ( Main-Frame ).
And in this Notebook three Pages.
Avery Page has his Color. ( Background Color ).
So in the first Page I have a BoxSizer ( Vertical ) and two Panels.
And now I must add two Buttons in the first Panel.
I'm try to add a BoxSizer ( Horizontal ).
And at the two Buttons.
New it will get me a silly result:
Out of the last Boxsizer with it's Buttons the Frame will show correctly.
But with the BoxSizer and the Buttons, only a blank Frame will be shown.

So hes anybody a Idea what's going wrong. I have no Idea.

In hope of help

Mungo1981

User avatar
doublemax
Moderator
Moderator
Posts: 14786
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Silly Qestion on Layout::BoxSizer in Panel.

Post by doublemax » Tue May 14, 2019 7:44 pm

Hard to tell based on that description. Possibly using a wrong parent somewhere?

Can you show the code that creates the GUI?
Use the source, Luke!

Mungo1981
Experienced Solver
Experienced Solver
Posts: 86
Joined: Wed Jan 30, 2019 5:42 pm

Re: Silly Qestion on Layout::BoxSizer in Panel.

Post by Mungo1981 » Tue May 14, 2019 7:50 pm

Thank you,
I will be a great think when you could go with me trough this Process.
Can you please give me again this web-address to share the tar-ball of my project with you ???

And could you remove the label "Experience Solver". I'm only a artist who will use his computer to make some kind's of Art.

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 317
Joined: Tue Oct 18, 2016 2:31 pm

Re: Silly Qestion on Layout::BoxSizer in Panel.

Post by alys666 » Tue May 14, 2019 9:34 pm

Mungo1981 wrote:
Tue May 14, 2019 7:32 pm
So here I'm back.
I try to begin my Project at Zero.
And I think it would be the realisticy Option I have.
So to my first silly Question:
I have a Notebook in a Frame ( Main-Frame ).
And in this Notebook three Pages.
Avery Page has his Color. ( Background Color ).
So in the first Page I have a BoxSizer ( Vertical ) and two Panels.
And now I must add two Buttons in the first Panel.
I'm try to add a BoxSizer ( Horizontal ).
And at the two Buttons.
New it will get me a silly result:
Out of the last Boxsizer with it's Buttons the Frame will show correctly.
But with the BoxSizer and the Buttons, only a blank Frame will be shown.

So hes anybody a Idea what's going wrong. I have no Idea.

In hope of help

Mungo1981
if you want to add buttons in sizer to instance _panel, you have to:
1. create _sizer by new();
2. create buttons with parent _panel by new();
3. add buttons to _sizer kinda : _sizer->Add(_mybutton, 0, wxALL, 10);
4. assign this sizer to _panel : _panel->SetSizerAndFit(_sizer);

so there are three things you must notice:
1. subordinated controls must be added to sizer via: sizer->Add(...)
2. controls must have parent _panel (via constructor) : new wxButton(_panel, ....)
3. sizer must be assigned to panel via _panel->SetSizer(_sizer).
ubuntu 16.04, wxWidgets 3.0.4

User avatar
doublemax
Moderator
Moderator
Posts: 14786
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Silly Qestion on Layout::BoxSizer in Panel.

Post by doublemax » Tue May 14, 2019 10:07 pm

Mungo1981 wrote:
Tue May 14, 2019 7:50 pm
Can you please give me again this web-address to share the tar-ball of my project with you ???
Is it that big? can't you extract the relevant parts and post it here? Otherwise upload it to something like https://www.sendspace.com/
But depending on how big it is, or how much effort it takes to build it, i can't make any promises.
Mungo1981 wrote:
Tue May 14, 2019 7:50 pm
And could you remove the label "Experience Solver". I'm only a artist who will use his computer to make some kind's of Art.
I can't. These "titles" are given automatically by the forum software depending on your number of posts.
Use the source, Luke!

Post Reply