Page 1 of 1

Silly Qestion on Layout::BoxSizer in Panel.

Posted: Tue May 14, 2019 7:32 pm
by Mungo1981
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

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

Posted: Tue May 14, 2019 7:44 pm
by doublemax
Hard to tell based on that description. Possibly using a wrong parent somewhere?

Can you show the code that creates the GUI?

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

Posted: Tue May 14, 2019 7:50 pm
by Mungo1981
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.

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

Posted: Tue May 14, 2019 9:34 pm
by alys666
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).

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

Posted: Tue May 14, 2019 10:07 pm
by doublemax
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.