wxAUI: Send a cancel event to the window within a frame which is closed, so it knows it is being destroyed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Alex Bligh
2006-07-04 19:52:22 +00:00
parent 80d9952564
commit cf08f19a72

View File

@@ -3486,8 +3486,20 @@ void wxFrameManager::OnPaneButton(wxFrameManagerEvent& event)
if (event.button == wxPaneInfo::buttonClose)
{
pane.Hide();
Update();
if (pane.IsOk())
{
wxWindow * pane_window = pane.window;
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
cancelEvent.SetEventObject( pane_window );
pane_window->GetEventHandler()->ProcessEvent(cancelEvent);
// The problem here is that the above can cause the window itself to be destroyed
if (!pane_window->IsBeingDeleted() && pane.IsOk())
{
pane.Hide();
Update();
}
}
}
else if (event.button == wxPaneInfo::buttonPin)
{