AUI pane closure - getting informed Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
nroberts
Knows some wx things
Knows some wx things
Posts: 44
Joined: Fri Aug 03, 2007 8:07 pm

AUI pane closure - getting informed

Post by nroberts »

I'm trying to build a menu that the user can use to bring back dead AUI windows...windows that have been shut down. Got the menu figured out, but it would be nice if the check was accurate in that it's checked when the window is visible and not when it isn't.

The only way I can keep track of this is if I know when the window is closed.

Looked in the documentation on the wxAUI stuff (which is absolutely terrible, all kinds of missing classes and calls) and found nothing on how to do this. Looking in the header (framemanager.h) I found support for wxAuiManagerEvent. I tried connecting my managed window's event handler to the PANE_CLOSE event but I was never informed of pane closure. I did this through the EVT_AUI_PANE_CLOSE() macro.

So, since that magic didn't work, what is the black magic incantation that only those with the uber-gnostic knowledge to use this thing know which will allow me to be informed when panes are closed by the user outside my menu?

Thanks.
vdell
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 536
Joined: Fri Jan 07, 2005 3:44 pm
Location: Finland
Contact:

Post by vdell »

Try connecting through the frame manager:

Code: Select all

your_frame_mngr.Connect ( ... );
HTH
Visual C++ 9.0 / Windows XP Pro SP3 / wxWidgets 2.9.0 (SVN) | Colligere
yuri
Earned some good credits
Earned some good credits
Posts: 104
Joined: Thu Apr 09, 2009 4:58 pm
Location: Russia

Post by yuri »

You may also get wxAuiPaneInfo for required pane from your wxAuiManager and use IsShown() member:

Code: Select all

wxAuiPaneInfo& thePane = aui_mgr.GetPane(paneName);
if( thePane.IsOk() && thePane.IsShown() )
{   // hide?
}
else {// show it
}
nroberts
Knows some wx things
Knows some wx things
Posts: 44
Joined: Fri Aug 03, 2007 8:07 pm

Post by nroberts »

vdell wrote:Try connecting through the frame manager:

Code: Select all

your_frame_mngr.Connect ( ... );
HTH
For those searching for answers later, it's more than just calling connect:

Code: Select all


    aui_manager.Connect(wxEVT_AUI_PANE_CLOSE, wxAuiManagerEventHandler(application_frame::impl::on_aui_event), 0, this);
called from the event handler for the frame.
Post Reply