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:
@@ -113,10 +113,28 @@ void wxFloatingPane::OnSize(wxSizeEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxFloatingPane::OnClose(wxCloseEvent& WXUNUSED(event))
|
void wxFloatingPane::OnClose(wxCloseEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
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);
|
m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
|
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user