Kirix Support Forums

wxAuiToolBar and controls

Please post any wxAUI patches or modifications you've created here. Thanks!

wxAuiToolBar and controls

Postby ben007 on Mon Sep 01, 2008 3:50 am

Hi,

I've seen that the new wxAuiToolBar can show a dropdown popup menu with overflow items (this is a great feature !).
But controls can’t be shown in the menu.

I would like to make this work but I don’t know what would be the best solution to deal with this :
- try to add the “AppendControl” feature to wxMenu (difficult ?)
- use a custom dialog instead of the popup menu ?

Could you give me your opinion on this ?

Thanks
ben007
Registered User
 
Posts: 3
Joined: Mon Jan 07, 2008 2:20 am

Re: wxAuiToolBar and controls

Postby Dave on Tue Sep 02, 2008 3:04 am

Hello,

The best way to do this is to create a class derived from wxPopupTransientWindow and put your control in this window. The wxPopupTransientWindow operates very similarly to a menu in that it is dismissed (hidden) for you when it loses the focus (once the user clicks outside its client area).

Create an instance of this popup window in the EVT_AUITOOLBAR_OVERFLOW_CLICK event handler and call Popup() on it in order to show the popup window when the user clicks the overflow button. If you need to explicitly hide the window, you can call Dismiss().

You'll need to include <wx/popupwin.h> in order to use the wxPopupTransientWindow class.

Hope this helps.

All the best,
Dave.
Dave Williams
Kirix Support Team
User avatar
Dave
Kirix Support Team
 
Posts: 32
Joined: Wed Sep 21, 2005 11:07 pm

Return to wxAUI Patches & Modifications