Kirix Support Forums

Show / hide toolbars using popup menu

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

Show / hide toolbars using popup menu

Postby andrey_yazhuk on Tue Aug 28, 2007 11:10 am

Hello,

We are developing an application that uses wxAuiManager and wxAuiToolbars.
We expect to have a relatively large number of toolbars and so we need to allow users to decide what toolbars should be visible. Similarly to MS Office apps we want to implement a popup menu that will list all available toolbars, user will be able show / hide toolbars by setting / clearing checkmarks in the menu. The menu should be shown when a user right clicks in the “toolbar area” of the frame window.
What is the best way to implement this in AUI?

Andrey Yazhuk
andrey_yazhuk
Registered User
 
Posts: 4
Joined: Tue Aug 07, 2007 4:01 pm

Re: Show / hide toolbars using popup menu

Postby Ben on Tue Aug 28, 2007 12:21 pm

Hi,

You should be able to do that with wxAUI's events alone, along with wxToolBar. If you want to use wxAuiToolBar, you are more than welcome to do so. I haven't had the few extra hours I've needed to put out wxAuiToolBar just yet, but you can expect it soon.

All the best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Re: Show / hide toolbars using popup menu

Postby andrey_yazhuk on Wed Aug 29, 2007 6:24 am

Hello Ben,

Currently we are using wxToolBar, but I would be interested to try wxAuiToolBar.
What wxAUI events and in what class should I handle in order to get a right click in the "toolbar area". Do you think that special support for this popup menu could be added to wxAUI? (I am willing to contribute my time, but will need guidance).

Andrey
andrey_yazhuk
Registered User
 
Posts: 4
Joined: Tue Aug 07, 2007 4:01 pm

Re: Show / hide toolbars using popup menu

Postby Ben on Thu Aug 30, 2007 4:58 pm

Hi,

I was mistaken. The wxAuiManager doesn't have events for this. Fortunately, it might still be possible to do this without modifying wxAUI. Since wxAUI draws directly onto the frame window, all you need to do it intercept EVT_RIGHT_UP on your frame window. Once you have this, you need to find out if the right-click happened in the toolbar area.

Give this a try, and let me know.

We'll have to add a set of more comprehensive events to do this more elegantly.

All the best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Re: Show / hide toolbars using popup menu

Postby Julian Smart on Fri Aug 31, 2007 4:38 pm

I didn't know wxAuiToolBar was available yet.

Anyhoo, two things come to mind. My Ctrl-Tab switcher menu thing for showing an AUI (or other) pane is here:

http://www.anthemion.co.uk/wxwin/switcher.jpg
http://www.anthemion.co.uk/wxwin/switcher.zip

and I've written a simple toolbar customisation system here:

http://www.anthemion.co.uk/wxwin/toolbarcust.zip

This allows the user to pick a toolbar from a drop-down box and switch the toolbar (and its tools) on or off. This works with any wxToolBarBase-derived toolbar and requires you to store tool information in data classes rather than create the toolbars directly.

Regards,

Julian
Julian Smart
Registered User
 
Posts: 17
Joined: Sun Nov 05, 2006 4:45 pm

Return to wxAUI Questions, Thoughts & Feedback