]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/framemanager.cpp
more avoiding direct struct access
[wxWidgets.git] / src / aui / framemanager.cpp
index f9b29c1f75abff27668295cdfcac0c8607196c7e..698885412506208f182968aff99964dc3c7d7bfe 100644 (file)
@@ -801,7 +801,7 @@ wxAuiManager* wxAuiManager::GetManager(wxWindow* window)
 
 void wxAuiManager::UpdateHintWindowConfig()
 {
 
 void wxAuiManager::UpdateHintWindowConfig()
 {
-    // find out if the the system can do transparent frames
+    // find out if the system can do transparent frames
     bool can_do_transparent = false;
 
     wxWindow* w = m_frame;
     bool can_do_transparent = false;
 
     wxWindow* w = m_frame;
@@ -1362,7 +1362,7 @@ void wxAuiManager::RestorePane(wxAuiPaneInfo& pane_info)
     for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
     {
         wxAuiPaneInfo& p = m_panes.Item(i);
     for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
     {
         wxAuiPaneInfo& p = m_panes.Item(i);
-        if (!p.IsToolbar())
+        if (!p.IsToolbar() && !p.IsFloating())
         {
             p.SetFlag(wxAuiPaneInfo::optionHidden,
                       p.HasFlag(wxAuiPaneInfo::savedHiddenState));
         {
             p.SetFlag(wxAuiPaneInfo::optionHidden,
                       p.HasFlag(wxAuiPaneInfo::savedHiddenState));
@@ -1570,10 +1570,15 @@ bool wxAuiManager::LoadPerspective(const wxString& layout, bool update)
     if (part != wxT("layout2"))
         return false;
 
     if (part != wxT("layout2"))
         return false;
 
-    // mark all panes currently managed as docked and hidden
+    // Mark all panes currently managed as hidden. Also, dock all panes that are dockable.
     int pane_i, pane_count = m_panes.GetCount();
     for (pane_i = 0; pane_i < pane_count; ++pane_i)
     int pane_i, pane_count = m_panes.GetCount();
     for (pane_i = 0; pane_i < pane_count; ++pane_i)
-        m_panes.Item(pane_i).Dock().Hide();
+    {
+        wxAuiPaneInfo& p = m_panes.Item(pane_i);
+        if(p.IsDockable())
+            p.Dock();
+        p.Hide();
+    }
 
     // clear out the dock array; this will be reconstructed
     m_docks.Clear();
 
     // clear out the dock array; this will be reconstructed
     m_docks.Clear();
@@ -3396,7 +3401,7 @@ void wxAuiManager::OnHintActivate(wxActivateEvent& WXUNUSED(event))
     // Do nothing so this event isn't handled in the base handlers.
 
     // Letting the hint window activate without this handler can lead to
     // Do nothing so this event isn't handled in the base handlers.
 
     // Letting the hint window activate without this handler can lead to
-    // weird behavior on Mac where the menu is switched out to the top
+    // weird behaviour on Mac where the menu is switched out to the top
     // window's menu in MDI applications when it shouldn't be. So since
     // we don't want user interaction with the hint window anyway, we just
     // prevent it from activating here.
     // window's menu in MDI applications when it shouldn't be. So since
     // we don't want user interaction with the hint window anyway, we just
     // prevent it from activating here.
@@ -3429,7 +3434,7 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
 // CalculateHintRect() calculates the drop hint rectangle.  The method
 // first calls DoDrop() to determine the exact position the pane would
 // be at were if dropped.  If the pane would indeed become docked at the
 // CalculateHintRect() calculates the drop hint rectangle.  The method
 // first calls DoDrop() to determine the exact position the pane would
 // be at were if dropped.  If the pane would indeed become docked at the
-// specified drop point, the the rectangle hint will be returned in
+// specified drop point, the rectangle hint will be returned in
 // screen coordinates.  Otherwise, an empty rectangle is returned.
 // |pane_window| is the window pointer of the pane being dragged, |pt| is
 // the mouse position, in client coordinates.  |offset| describes the offset
 // screen coordinates.  Otherwise, an empty rectangle is returned.
 // |pane_window| is the window pointer of the pane being dragged, |pt| is
 // the mouse position, in client coordinates.  |offset| describes the offset
@@ -3846,7 +3851,7 @@ void wxAuiManager::OnRender(wxAuiManagerEvent& evt)
 // Render() fire a render event, which is normally handled by
 // wxAuiManager::OnRender().  This allows the render function to
 // be overridden via the render event.  This can be useful for paintin
 // Render() fire a render event, which is normally handled by
 // wxAuiManager::OnRender().  This allows the render function to
 // be overridden via the render event.  This can be useful for paintin
-// custom graphics in the main window. Default behavior can be
+// custom graphics in the main window. Default behaviour can be
 // invoked in the overridden function by calling OnRender()
 
 void wxAuiManager::Render(wxDC* dc)
 // invoked in the overridden function by calling OnRender()
 
 void wxAuiManager::Render(wxDC* dc)