]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/floatpane.cpp
improvements to wxPickerBase default proportion values (patch 1525578)
[wxWidgets.git] / src / aui / floatpane.cpp
index 00b4bd7b5253a86002f75d00d2f5e00e5189307c..b365752ee184e09d9d248844ae617fbc9ef9c1e4 100644 (file)
 #ifndef WX_PRECOMP
 #endif
 
+IMPLEMENT_CLASS( wxFloatingPane, wxFloatingPaneBaseClass )
+
 wxFloatingPane::wxFloatingPane(wxWindow* parent,
                 wxFrameManager* owner_mgr,
-                wxWindowID id /*= wxID_ANY*/,
-                const wxPoint& pos /*= wxDefaultPosition*/,
-                const wxSize& size /*= wxDefaultSize*/)
-                : wxFloatingPaneBaseClass(parent, id, wxEmptyString, pos, size,
+                const wxPaneInfo& pane,
+                wxWindowID id /*= wxID_ANY*/)
+                : wxFloatingPaneBaseClass(parent, id, wxEmptyString,
+                        pane.floating_pos, pane.floating_size,
                         wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
-                        wxCLOSE_BOX | wxFRAME_NO_TASKBAR |
-                        wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN)
+                        (pane.HasCloseButton()?wxCLOSE_BOX:0) |
+                        wxFRAME_NO_TASKBAR |
+                        wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN |
+                        (pane.IsFixed()?0:wxRESIZE_BORDER)
+                        )
 {
     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);
 }
 
@@ -65,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();
 
@@ -80,9 +88,6 @@ void wxFloatingPane::SetPaneWindow(const wxPaneInfo& pane)
 
     SetTitle(pane.caption);
 
-    if (contained_pane.IsFixed())
-        SetWindowStyle(GetWindowStyle() & ~wxRESIZE_BORDER);
-
     if (pane.floating_size != wxDefaultSize)
     {
         SetSize(pane.floating_size);
@@ -111,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)