Change different frames/panels in one window

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Change different frames/panels in one window

Post by eriX »

Hello,

I want to create an application without a lot of childframeing...

There shall be some buttons on the top of the application, which shall change the content-section below them.
In the content section there shall be some other controls (buttons, images etc.)

I want to setup these "frames" in the GUI-Designer and code the buttons that they change this frames/panels.


How do I do that?


Can I add some wxFrames to my project, add a wxPanel on this frame?
Can I get this frames and components from this wxFrame and display them im my main window? <- How to do that?

OR

Shall I create some wxFrames, set up my controls and copy the generated creation code and paste it to my buttons, so that they change my content?


- eriX
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Change different frames/panels in one window

Post by jgrzybowski »

First of all I can recommend you basic toutorial: http://wxdsgn.sourceforge.net/?q=node/13
I was started with this example in 2007. WxDevC++ has got great GUI-Designer (RAD) similar to Delphi.

My advise is following:
1)Create new project as a “wxWidget Frame” (your wxFame will be created automatically);
2)add wxToolBar, wxStatusBar, wxMenu objects;
3)add wxPanel inside your wxFrame, which should fulfill your frame (note: if you do not accept gray border around this panel, you should set up borders of frame on value 0 – in properties window of RAD – because default value is 5)
4)add wxBoxSizer on your wxPanel (each panel should have sizer to arrange other objects putted on like buttons, images);
5)as a “content-section” you can use wxNotebook object (add into wxBoxSizer), than you need to add wxNotebookPage objects into wxNotebook as many as you need;
6)on each wxNotebookPage add wxBoxSizer and then you can putting there your functional objects: buttons, images, etc.

Regards
Jarek
Attachments
wxFrame_with_wxNotebook_(RAD).JPG
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Re: Change different frames/panels in one window

Post by eriX »

I don't want to use wxNotebook.

I did a big research in the last hours and got the idea to use wxNotebook and to size it bigger than my window is, because then those tab-controls, borders etc. will disappear completely and I can change the Notebook pages with a button... :mrgreen:

Offtopic:
Sorry for that, but I think that the wxDesigner isn't very flexible... It isn't possible to built a modern-looking application. All apps will look like 15 Years ago, when the first graphical Windows came up.
I like programming with WxWidgets... it's very easy and logical. But the limit of the GUI-Designer is reached with little applications - if you ask me.
I became 17 last week and I work with wxDevC++ since 3 years. The only reason why I kept on wxDevC++ is: I learned programming with it and it would need to much time to change the IDE.
So I will make the last update for my application in the next months and after that I start with JAVA & Eclipse - because I will work with that, if I start my IT-studies in 1,5 years. The next point would be android...
Post Reply