]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/framemanager.cpp
Undid completely wrong patch 1438117: other platforms do _not_ count
[wxWidgets.git] / src / aui / framemanager.cpp
index 7f9d92afa4cb888fe49ed52906a209f5b1e7f2a5..e1b0ee6797fa0c76d07b803eda87bec114a3d650 100644 (file)
@@ -799,6 +799,10 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
     if (GetPane(pane_info.window).IsOk())
         return false;
 
+    // if the new pane is docked then we should undo maximize
+    if(pane_info.IsDocked())
+        RestoreMaximizedPane();
+
     m_panes.Add(pane_info);
 
     wxAuiPaneInfo& pinfo = m_panes.Last();
@@ -946,6 +950,9 @@ bool wxAuiManager::InsertPane(wxWindow* window, const wxAuiPaneInfo& pane_info,
         }
          else
         {
+            // if the new pane is docked then we should undo maximize
+            RestoreMaximizedPane();
+
             existing_pane.Direction(pane_info.dock_direction);
             existing_pane.Layer(pane_info.dock_layer);
             existing_pane.Row(pane_info.dock_row);
@@ -2161,28 +2168,30 @@ void wxAuiManager::Update()
             p.window->SetSize(1,1);
 
 
-           // the following block is a workaround for bug #1531361
-           // (see wxWidgets sourceforge page).  On wxGTK (only), when
-           // a frame is shown/hidden, a move event unfortunately
-           // also gets fired.  Because we may be dragging around
-           // a pane, we need to cancel that action here to prevent
-           // a spurious crash.
-           if (m_action_window == p.frame)
-           {
-               if (wxWindow::GetCapture() == m_frame)
+               // the following block is a workaround for bug #1531361
+               // (see wxWidgets sourceforge page).  On wxGTK (only), when
+               // a frame is shown/hidden, a move event unfortunately
+               // also gets fired.  Because we may be dragging around
+               // a pane, we need to cancel that action here to prevent
+               // a spurious crash.
+               if (m_action_window == p.frame)
+               {
+                       if (wxWindow::GetCapture() == m_frame)
                     m_frame->ReleaseMouse();
                 m_action = actionNone;
-               m_action_window = NULL;
-           }
+                       m_action_window = NULL;
+               }
 
-           // hide the frame
+               // hide the frame
             if (p.frame->IsShown())
                 p.frame->Show(false);
 
             // reparent to m_frame and destroy the pane
-            if(m_action_window == p.frame) {
+            if(m_action_window == p.frame)
+            {
                 m_action_window = NULL;
             }
+            
             p.window->Reparent(m_frame);
             p.frame->SetSizer(NULL);
             p.frame->Destroy();
@@ -3543,12 +3552,12 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event)
     wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY());
     if (part)
     {
-        if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
-            return;
-
         if (part->type == wxAuiDockUIPart::typeDockSizer ||
             part->type == wxAuiDockUIPart::typePaneSizer)
         {
+            if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
+                return;
+        
             // a dock may not be resized if it has a single
             // pane which is not resizable
             if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock &&
@@ -3580,6 +3589,9 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event)
          else if (part->type == wxAuiDockUIPart::typeCaption ||
                   part->type == wxAuiDockUIPart::typeGripper)
         {
+            if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
+                return;
+
             if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE)
             {
                 // set the caption as active