Kirix Support Forums

How about a full working example?

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

How about a full working example?

Postby Joel on Mon Jan 09, 2006 1:34 pm

I found the lack of examples a rather intimidating thing. I like the concept of wxAUI and all its features, but I just can't seem to get it to woerk without a proper understanding of logic.

The provided example on the site is rather simplistic, and isn't "real world" enough, if you get what I mean. I'm really just itnerested in the toolbar docking stuff, not really the floating panel stuff, but nonetheless...
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Ben on Mon Jan 09, 2006 4:09 pm

Did you take a look at the sample in the "sample" directory in wxAUI itself? It has a fully functional 1000-line example which attempts to use every part of the library.

The small example on the website was an attempt to demonstrate the smallest possible docking window application. It wasn't meant to be in-depth at all.

I guess my question is: did you find the sample application inside wxAUI itself insufficient?

All the best,
Ben
Last edited by Ben on Mon Jan 09, 2006 6:35 pm, edited 1 time in total.
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Postby Joel on Mon Jan 09, 2006 5:11 pm

oh great.... im officially blind (not as in really blind, but im blind as in i cant take notice of things....) :x sorry bout that :P
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Joel on Tue Jan 10, 2006 3:24 am

For some strange reason LoadPerspective doesn't work, I just took the string SavePerspective returned me, then did a LoadPerspective after the frame was created (so the 'workspace' is saved). Now when I move the toolbar around, the other part of the frame with all my main controls and all disappear :? sometimes I also get a memory violation, and I've rebuilt my project quite a few times now...
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Joel on Tue Jan 10, 2006 3:28 am

correction: the access violation occurs at program shutdown...

and if I compile a build without the LoadPerspective, it shuts down fine... am I doing something wrong somewheres?
Code: Select all
   //do the toolbars
   wxPaneInfo tool;
   tool.ToolbarPane().Top().LeftDockable(false).RightDockable(false).Caption(lang["Standard Toolbar"]);
   background_toolbar->SetSize(background_toolbar->GetBestSize());
   manager.AddPane(background_toolbar, tool);
   SetToolBar(NULL);
   
   wxPaneInfo main;
   main.Fixed().CaptionVisible(false).PaneBorder(false).Centre().Resizable();
   manager.AddPane(background_panel, main);
   manager.Update();

   manager.LoadPerspective(config->Read("Toolbar Layout", ""));
of course, ive made sure that the registry key isn't empty...
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Ben on Tue Jan 10, 2006 6:00 am

You probably just need to call wxFrameManager::UnInit() in your frame class's destructor.

Best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Postby Joel on Tue Jan 10, 2006 9:40 am

I did... and i personally find it weird...

Code: Select all
   //Handle the toolbar
   background_toolbar->SetSize(background_toolbar->GetBestSize());
   wxPaneInfo tool;
   tool.ToolbarPane().Top().LeftDockable(false).RightDockable(false).Caption(lang["Standard Toolbar"]);
   manager.AddPane(background_toolbar, tool);
   SetToolBar(NULL);
   
   wxPaneInfo main;
   main.CaptionVisible(false).PaneBorder(false).Centre().Resizable();
   manager.AddPane(background_container, main);
   manager.Update();


and then I get this:
[Image removed]

the toolbar doesn't work; you can't click ANYTHING, and resizing doesn't work... it was because I accidentally reverted and lost all my changes... but using back the sources above, I got that...
Last edited by Joel on Tue Jan 10, 2006 12:46 pm, edited 1 time in total.
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Ben on Tue Jan 10, 2006 10:39 am

I'll try to draw some conclusions by looking at your screenshot (however, without more contextual code it may not be possible to diagnose the real problem).

Whenever drawn items (such as the pane gripper) don't show, it's almost inevitably due to the fact that another window is covering it up. This often stems from some window which is not managed properly by the frame manager.

We ran into this problem with wxMDIParentFrame a while back. It turned out that the MDI Client window hadn't been properly managed as the center pane. This, btw, is fixed in the upcoming 0.9.1

Are you absolutely sure that your center pane is being managed by wxAUI? Also check to make sure you are not doing any custom sizing in your frame's OnSize, as this would result in unpredictable behavior.
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Postby Joel on Tue Jan 10, 2006 12:10 pm

OK, i solved most of it.
[image removed]

Now, the toolbar doesn't show the borders properly... I know its trivial, but...
Last edited by Joel on Tue Jan 10, 2006 12:46 pm, edited 2 times in total.
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Postby Joel on Tue Jan 10, 2006 12:35 pm

ah... its the toolbar style.... fixed it. Thanks ben. (omg, your the 3rd ben I know :o)
Image
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Return to wxAUI Questions, Thoughts & Feedback