wxFormBuilder won't build what I want

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
User avatar
shawnhcorey
Knows some wx things
Knows some wx things
Posts: 31
Joined: Mon Nov 19, 2012 3:29 pm
Location: The Great White North

wxFormBuilder won't build what I want

Postby shawnhcorey » Thu Sep 11, 2014 6:11 pm

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?

DavidHart
Site Admin
Site Admin
Posts: 3779
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxFormBuilder won't build what I want

Postby DavidHart » Thu Sep 11, 2014 6:25 pm

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

User avatar
shawnhcorey
Knows some wx things
Knows some wx things
Posts: 31
Joined: Mon Nov 19, 2012 3:29 pm
Location: The Great White North

Re: wxFormBuilder won't build what I want

Postby shawnhcorey » Thu Sep 11, 2014 6:47 pm

In other words, wxFormBuilder is not a very good guide. :(

DavidHart
Site Admin
Site Admin
Posts: 3779
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxFormBuilder won't build what I want

Postby DavidHart » Thu Sep 11, 2014 8:09 pm

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.

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 256
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder won't build what I want

Postby New Pagodi » Fri Sep 12, 2014 2:44 am

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

User avatar
shawnhcorey
Knows some wx things
Knows some wx things
Posts: 31
Joined: Mon Nov 19, 2012 3:29 pm
Location: The Great White North

Re: wxFormBuilder won't build what I want

Postby shawnhcorey » Fri Sep 12, 2014 11:46 am

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

buttonsrtoys
Knows some wx things
Knows some wx things
Posts: 43
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder won't build what I want

Postby buttonsrtoys » Sat Feb 03, 2018 1:57 am

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 1068 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 1068 times


Is there settings or something I need to add to the BoxSizer before it will receive a panel?

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 256
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder won't build what I want

Postby New Pagodi » Sat Feb 03, 2018 2:02 am

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.

hpkkumar007
In need of some credit
In need of some credit
Posts: 1
Joined: Wed May 02, 2018 8:55 am

Re: wxFormBuilder won't build what I want

Postby hpkkumar007 » Wed May 02, 2018 9:02 am

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


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 3 guests