]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/floatpane.cpp
generate middle click events (patch 1521314)
[wxWidgets.git] / src / aui / floatpane.cpp
index e79355872e5d07c6c5ebe1cb2b1e966affd0e381..b365752ee184e09d9d248844ae617fbc9ef9c1e4 100644 (file)
@@ -41,7 +41,8 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
                 : wxFloatingPaneBaseClass(parent, id, wxEmptyString,
                         pane.floating_pos, pane.floating_size,
                         wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
-                        wxCLOSE_BOX | wxFRAME_NO_TASKBAR |
+                        (pane.HasCloseButton()?wxCLOSE_BOX:0) |
+                        wxFRAME_NO_TASKBAR |
                         wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN |
                         (pane.IsFixed()?0:wxRESIZE_BORDER)
                         )
@@ -49,7 +50,7 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
     m_owner_mgr = owner_mgr;
     m_moving = false;
     m_last_rect = wxRect();
-    m_mgr.SetFrame(this);
+    m_mgr.SetManagedWindow(this);
     SetExtraStyle(wxWS_EX_PROCESS_IDLE);
 }
 
@@ -69,6 +70,9 @@ void wxFloatingPane::SetPaneWindow(const wxPaneInfo& pane)
                     PaneBorder(false).
                     Layer(0).Row(0).Position(0);
 
+    // Carry over the minimum size
+    SetMinSize(pane.window->GetMinSize());
+
     m_mgr.AddPane(m_pane_window, contained_pane);
     m_mgr.Update();
 
@@ -112,10 +116,11 @@ void wxFloatingPane::OnSize(wxSizeEvent& event)
     m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize());
 }
 
-void wxFloatingPane::OnClose(wxCloseEvent& WXUNUSED(event))
+void wxFloatingPane::OnClose(wxCloseEvent& evt)
 {
-    m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
-    Destroy();
+    m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt);
+    if (!evt.GetVeto())
+        Destroy();
 }
 
 void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)