Kirix Support Forums

AUI: Layout changes possible?

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

AUI: Layout changes possible?

Postby ubit on Mon Dec 18, 2006 4:12 pm

I have posted this in wxForums too...

Here it is:

Hi,

i would like to use AUI for my application. Because there are a lot of Tool-Buttons the user should be free in arranging toolbars. I would like toolbars to be switchable between horizontal and vertical layout. If docking a pane left or right, it should change layout to vertical. If docked top or bottom, it should layout the buttons horizontally. Additionally it should be possible to switch the layout of a floating pane manually (e.g. between horizontal/vertical and a 1 or 2 row/col-Layout). I can think of 5 ways to implement this reasonably logical into the user interface:

Assume, that the "toolbar" has 4 layout states (1 row horizontal, 2 rows horizontal, 1 column vertical, 2 columns vertical.

1. Cycle between layouts by clicking (or maybe double clicking) on the "grip".
2. Switch between layouts with a context-menu (right mousebutton) - possibly with right mousebuttom over the grip.
3. Cycle between layouts by clicking on the titlebar of the pane if it is floating.
4. Switch layout from "external" interface components (e.g. a view->settings menu).
5. Integrate a "switch-layout"-button into the pane (nice, but consumes space on the user interface which is rare...).

Personally i prefer solution 1 combined with solution 3 (and possibly solution 5 in some rare cases). To implement all this i need:

An "event" that notifies the application if a pane is rearranged so that i can change layout e.g. from horizontal to vertical if the pane is moved from top/bottom to left/right or vice versa. But i did not found any "special" event on docking/floating of aui-panes. Any solution?

And i need access to the "grip" so that i can install an event handler which reacts on mousebuttons. Is there a (portable and safe) way to get access to the gripper?

And another small problem:
If an application uses aui with top/bottom and left/right docking capabilities aui lets the user move the panes so that they overlap. E.g. in the samples/auidemo:
If you move a toolbar to the bottom (as left as possible) it is possible to move the vertical toolbar down so that it overlaps the toolbar at the bottom. It can even overlap the statusbar of the frame! Is there any way to prevent this? Because this causes ugly overlapping graphics and is not very logical for the user, isn't it?

And last but not least:
With AUI it is possible to position a toolbar e.g in the top direction with the mouse so that it exceeds the window boundaries. Sometimes a pane is not de-docked, but it is positioned inside the parent frame as wide to the right that it is inaccessible at all!
If you take a look at e.g. microsoft office: There - if you move a toolbar-pane to the right - it "stops" if it reaches the window border. If the window is resized to a smaller size, than panes are "compressed" if there is not enough room (first space between panes is eliminated, than some tool-buttons are hidden) and inaccessible toobar-buttons are presented in a separate menu.
Can i use AUI so that it behaves like this?

Ciao, Udo

P.S.: Using wxWidgets 2.8.0 on Windows XP
ubit
Registered User
 
Posts: 2
Joined: Mon Dec 18, 2006 4:05 pm

Postby Ben on Tue Dec 19, 2006 1:03 am

Hi Udo,

You need wxAuiToolBar. It's not released yet, because I haven't had time to do the vertical/horizontal switching. It shouldn't be too long before we release it.

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

Postby ubit on Tue Dec 19, 2006 5:53 am

Thanks Ben,

that sound good. How would auiToobar be released? Is is from the beginning a part of an official release of wxWidgets? Or do i have to integrate a separate aui-lib into my application?

In Addition it would be very nice, if aui would generate some events. Especially events should be generated if panes are docked/de-docked. Just a new event-class where the information about docking position and id of the pane are passed.

Access to the Gripper (if used) should also be simple to realize - just add a simple method.

With those additions aui would be much more usable and flexible.

Ciao, Udo
ubit
Registered User
 
Posts: 2
Joined: Mon Dec 18, 2006 4:05 pm

Postby Ben on Thu Dec 21, 2006 12:44 am

Hi Udo,

wxAuiToolBar will probably be released during one of the dot-releases of 2.8, either 2.8.1 or 2.8.2. However, we'll contemplate releasing a preview version soon. Until it automatically switches between horizontal and vertical, it isn't really ready (although it looks much nicer).

Regarding the events, I couldn't agree more. We've added more events in the latest release, but there are still more to go.

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

Postby Huge on Thu Dec 28, 2006 8:56 am

bwilliams wrote:You need wxAuiToolBar. It's not released yet, because I haven't had time to do the vertical/horizontal switching. It shouldn't be too long before we release it.


Hi,
One way I have found works quite nicely is to have the toolbars lay themselves out according to available space. For example, say you have a toolbar with 8 buttons on it in a floating toolbar. You should be able to drag the bottom-right corner of the toolbar to generate 8x1, 4x2, 2x4 and 1x8 layouts. Docking left or right is then just a specialization of this. Although you could, say, dock a toolbar above a window and have the toolbar take the width of that window - generating a second row if required.

Also, you can allow any other control on the toolbar, such as a combo-box. Then, the layout procedure becomes something like "CalculateWidthGivenHeight" or "CalculateHeightGivenWidth" (depending on orientation) rather than "GetBestSize"/"GetMinSize".

Not sure if I've made myself clear here, but I hope it helps if you are designing toolbars.
Huge
Registered User
 
Posts: 25
Joined: Thu Dec 28, 2006 1:12 am

Postby Huge on Thu Dec 28, 2006 8:57 am

Sorry about the double post - got a smtp error ans thought it didnt work
Huge
Registered User
 
Posts: 25
Joined: Thu Dec 28, 2006 1:12 am

Return to wxAUI Questions, Thoughts & Feedback