Page 1 of 1

wxFormBuilder won't build what I want

Posted: Thu Sep 11, 2014 6:11 pm
by shawnhcorey
I am trying to build something like this:

Code: Select all

AppNBPage : wxPanel
    wxSplitterWindow
        wxTreeCtrl
        wxGrid

AppMainWin : wxFrame
    AppMainPanel : wxPanel
        wxBoxSizer
            AppMenuBar : wxMenuBar
            AppToolBar : wxToolBar
            AppSttusBar : wxStatusBar
            AppNB : wxAUINotebook
                AppNBPage
                ...
1. wxFormBuilder won't let me put a wxBoxSizer in a wxPanel. It insists that the wxSizer goes in the wxFrame.

2. It won't let me put a wxSplitterWindow in a wxPanel or a wxAUINotebook.

What am I doing wrong?

Re: wxFormBuilder won't build what I want

Posted: Thu Sep 11, 2014 6:25 pm
by DavidHart
Hi,

Unless it's been fixed recently (I've not used it for a couple of years) wxFB stupidly won't let you put a control such as a panel directly into a frame; it insists on frame > sizer > panel. I suspect that's what it's complaining about here.

Regards,

David

Re: wxFormBuilder won't build what I want

Posted: Thu Sep 11, 2014 6:47 pm
by shawnhcorey
In other words, wxFormBuilder is not a very good guide. :(

Re: wxFormBuilder won't build what I want

Posted: Thu Sep 11, 2014 8:09 pm
by DavidHart
In other words, wxFormBuilder is not a very good guide
It's second-best IMO (I now use wxCrafter).

However it's easy in wxFB to add a sizer to the frame, and put the panel into it. It does no harm, it's just not needed.

Re: wxFormBuilder won't build what I want

Posted: Fri Sep 12, 2014 2:44 am
by New Pagodi
I love formbuilder, but I suppose it can be a bit picky about what it allows to be a child of certain controls.

Image

I think the only children in allows for notebook pages are panels. So you'll need to add a panel to serve as the page and then add the splitter as a child of that panel.

Incidentally, if the notebook is expanded and stretched and has no border, you could add it directly to the frame's sizer (bSizer1 in the picture above) and skip the application panel (m_panel1 in the picture above).

Re: wxFormBuilder won't build what I want

Posted: Fri Sep 12, 2014 11:46 am
by shawnhcorey
New Pagodi wrote:I love formbuilder, but I suppose it can be a bit picky about what it allows to be a child of certain controls.
Thanks. Though that seems to be a lot of sizers and panels. :?

Re: wxFormBuilder won't build what I want

Posted: Sat Feb 03, 2018 1:57 am
by buttonsrtoys
This is an old thread but I'm trying and failing to replicate part of it in wxFB. Specifically, adding a panel to a BoxSizer like shown above:
CaptureWxFB2.JPG
CaptureWxFB2.JPG (23.37 KiB) Viewed 1526 times
But wxFB won't let me add a panel to a BoxSizer. It puts it at the same level as the Frame as shown below:
CaptureWxFB.JPG
CaptureWxFB.JPG (23.55 KiB) Viewed 1526 times
Is there settings or something I need to add to the BoxSizer before it will receive a panel?

Re: wxFormBuilder won't build what I want

Posted: Sat Feb 03, 2018 2:02 am
by New Pagodi
buttonsrtoys wrote:But wxFB won't let me add a panel to a BoxSizer. It puts it at the same level as the Frame as shown below:
CaptureWxFB.JPG
Is there settings or something I need to add to the BoxSizer before it will receive a panel?
Use the wxPanel item under the "Containers" tab.

You're trying the an a Panel item from the "Forms" tab. The items on that tab are meant to be top level windows and can not be children of any other windows.

Re: wxFormBuilder won't build what I want

Posted: Wed May 02, 2018 9:02 am
by hpkkumar007
New Pagodi wrote:
buttonsrtoys wrote:But wxFB won't let me add a panel to a BoxSizer. It puts it at the same level as the Frame as shown below:
CaptureWxFB.JPG
Is there settings or something I need to add to the BoxSizer before it will receive a panel?
Use the wxPanel item under the "Containers" tab.

You're trying the an a Panel item from the "Forms" tab. The items on that tab are meant to be top level windows and can not be children of any other windows.
wxPanel item under the "Containers" tab worked, searched for this solution from few days..
many thanks.. :D