wxAUI: Send cancel event on floating panes closing too (last log was misleading - that was on docked panes with a hand-drawn close button).

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

View File

@@ -114,8 +114,26 @@ void wxFloatingPane::OnSize(wxSizeEvent& event)
void wxFloatingPane::OnClose(wxCloseEvent& WXUNUSED(event))
{
m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
Destroy();
static wxList s_closing;
if (!s_closing.Member(this))
{
s_closing.Append(this);
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
cancelEvent.SetEventObject( m_pane_window );
m_pane_window->GetEventHandler()->ProcessEvent(cancelEvent);
s_closing.DeleteObject(this);
// we should really return here without doing anything if the close was vetoed
}
// The problem here is that the above can cause the window itself to be destroyed
if (!IsBeingDeleted() && m_pane_window && !m_pane_window->IsBeingDeleted()
&& (m_pane_window->GetParent()==this))
{
m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
Destroy();
}
}
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)