wxMenuToolBar - Pop-up menus inside of wxToolBar

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
paulcomposer
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Oct 06, 2006 3:11 am
Contact:

wxMenuToolBar - Pop-up menus inside of wxToolBar

Post by paulcomposer » Tue Dec 05, 2006 12:53 am

Hey All:

I've completed a "wxMenuToolBar", derived from wxToolBar, it implements pop-up menus within toolbars. Two things it does pretty well: 1) The menu pops up immediately on left-mouse down and menu items can be selected on left-mouse up, and 2) the menu positioning is directly below the toolbar.

The first type of button looks like a regular tool bar button, and pops up a menu when clicked.

The second type of button looks like a small black downwards triangle (ala the Firefox toolbar) and pops up a menu when clicked.

The files have been tested in both MAC and MSW, and a sample program is provided.

Check it out: http://pnelsoncomposer.com/software/wxMenuToolBar/

It also has a nice, simple wxMenuButton, which can be used anywhere you'd have a standard wxBitmapButton. It displays the small downwards triangle and pops up a menu when clicked.

Cheers!
Paul

Troels
Experienced Solver
Experienced Solver
Posts: 79
Joined: Fri Jan 07, 2005 12:02 pm
Location: Denmark

Re: wxMenuToolBar - Pop-up menus inside of wxToolBar

Post by Troels » Wed Dec 06, 2006 3:31 pm

Excellent! Very useful, in many/most applications.

A few suggestions:
- Adding DECLARE/IMPLEMENT_DYNAMIC_CLASS, to enable use with xrc
- Larger arrow (pulldown_xpm), it's probably hard to see on high resolution displays
- Regular button-like behaviour/appearance: the button in the form (next to the "Some text" edit box) cannot be navigated to using the keyboard, cannot get focus.

With these issues fixed wxMenuToolBar would be a natural addition to wx I think.

Regards

paulcomposer
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Oct 06, 2006 3:11 am
Contact:

Re: wxMenuToolBar - Pop-up menus inside of wxToolBar

Post by paulcomposer » Fri Dec 08, 2006 4:53 am

Troels wrote: With these issues fixed wxMenuToolBar would be a natural addition to wx I think.
Thanks! I will definitely look into doing these right away. They don't look that hard.

Paul

Troels
Experienced Solver
Experienced Solver
Posts: 79
Joined: Fri Jan 07, 2005 12:02 pm
Location: Denmark

Re: wxMenuToolBar - Pop-up menus inside of wxToolBar

Post by Troels » Wed Feb 13, 2008 12:51 pm

Pop-up/drop-down-menu is in wx2.9
wxToolBar.SetDropdownMenu()

Post Reply