]> git.saurik.com Git - wxWidgets.git/commitdiff
wxaui maximize/restore button patch from Aleksey Sanin (many thanks)
authorBenjamin Williams <bwilliams@kirix.com>
Wed, 1 Nov 2006 17:43:51 +0000 (17:43 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Wed, 1 Nov 2006 17:43:51 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/dockart.h
include/wx/aui/framemanager.h
samples/aui/auidemo.cpp
src/aui/dockart.cpp
src/aui/floatpane.cpp
src/aui/framemanager.cpp

index fb21ae5acd587bdf4eebfd794fd7180a22e5a4cf..db823b52c24753049938cb755334fad1bb05a180 100644 (file)
@@ -143,8 +143,12 @@ protected:
     wxFont m_caption_font;
     wxBitmap m_inactive_close_bitmap;
     wxBitmap m_inactive_pin_bitmap;
+    wxBitmap m_inactive_maximize_bitmap;
+    wxBitmap m_inactive_restore_bitmap;
     wxBitmap m_active_close_bitmap;
     wxBitmap m_active_pin_bitmap;
+    wxBitmap m_active_maximize_bitmap;
+    wxBitmap m_active_restore_bitmap;
     wxPen m_gripper_pen1;
     wxPen m_gripper_pen2;
     wxPen m_gripper_pen3;
index cf6d9094c7fbbd1e89fea1220c6d4e70fada7e05..d49b9df268e7b3d4aecb5070178ef265301d3a10 100644 (file)
@@ -95,7 +95,7 @@ enum wxPaneButtonState
 enum wxAuiButtonId
 {
     wxAUI_BUTTON_CLOSE = 101,
-    wxAUI_BUTTON_MAXIMIZE = 102,
+    wxAUI_BUTTON_MAXIMIZE_RESTORE = 102,
     wxAUI_BUTTON_MINIMIZE = 103,
     wxAUI_BUTTON_PIN = 104,
     wxAUI_BUTTON_OPTIONS = 105,
@@ -237,6 +237,7 @@ public:
     bool IsFloatable() const { return HasFlag(optionFloatable); }
     bool IsMovable() const { return HasFlag(optionMovable); }
     bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose); }
+    bool IsMaximized() const { return HasFlag(optionMaximized); }
     bool HasCaption() const { return HasFlag(optionCaption); }
     bool HasGripper() const { return HasFlag(optionGripper); }
     bool HasBorder() const { return HasFlag(optionPaneBorder); }
@@ -279,6 +280,8 @@ public:
     wxPaneInfo& Hide() { return SetFlag(optionHidden, true); }
     wxPaneInfo& Show(bool show = true) { return SetFlag(optionHidden, !show); }
     wxPaneInfo& CaptionVisible(bool visible = true) { return SetFlag(optionCaption, visible); }
+    wxPaneInfo& Maximize() { return SetFlag(optionMaximized, true); }
+    wxPaneInfo& Restore() { return SetFlag(optionMaximized, false); }
     wxPaneInfo& PaneBorder(bool visible = true) { return SetFlag(optionPaneBorder, visible); }
     wxPaneInfo& Gripper(bool visible = true) { return SetFlag(optionGripper, visible); }
     wxPaneInfo& GripperTop(bool attop = true) { return SetFlag(optionGripperTop, attop); }
@@ -293,6 +296,10 @@ public:
     wxPaneInfo& RightDockable(bool b = true) { return SetFlag(optionRightDockable, b); }
     wxPaneInfo& Floatable(bool b = true) { return SetFlag(optionFloatable, b); }
     wxPaneInfo& Movable(bool b = true) { return SetFlag(optionMovable, b); }
+
+    wxPaneInfo& SaveHidden() { return SetFlag(optionSavedHidden, HasFlag(optionHidden)); }
+    wxPaneInfo& RestoreHidden() { return SetFlag(optionHidden, HasFlag(optionSavedHidden)); }
+
     wxPaneInfo& Dockable(bool b = true)
     {
         return TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b);
@@ -362,6 +369,8 @@ public:
         optionToolbar         = 1 << 13,
         optionActive          = 1 << 14,
         optionGripperTop      = 1 << 15,
+        optionMaximized       = 1 << 16,
+        optionSavedHidden     = 1 << 17,
 
         buttonClose           = 1 << 24,
         buttonMaximize        = 1 << 25,
@@ -448,6 +457,9 @@ public:
     bool DetachPane(wxWindow* window);
     
     void ClosePane(wxPaneInfo& pane_info);
+    void MaximizePane(wxPaneInfo& pane_info);
+    void RestorePane(wxPaneInfo& pane_info);
+    void RestoreMaximizedPane();
 
     wxString SavePaneInfo(wxPaneInfo& pane);
     void LoadPaneInfo(wxString pane_part, wxPaneInfo &pane);
@@ -578,6 +590,7 @@ protected:
     wxWindow* m_action_window;   // action frame or window (NULL if none)
     wxRect m_action_hintrect;    // hint rectangle for the action
     bool m_skipping;
+    bool m_has_maximized;
     wxRect m_last_rect;
     wxDockUIPart* m_hover_button;// button uipart being hovered over
     wxRect m_last_hint;          // last hint rectangle
@@ -755,6 +768,8 @@ public:
 BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANEBUTTON, 0)
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANECLOSE, 0)
+    DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANEMAXIMIZE, 0)
+    DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANERESTORE, 0)
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0)
 END_DECLARE_EVENT_TYPES()
 
@@ -767,6 +782,10 @@ typedef void (wxEvtHandler::*wxFrameManagerEventFunction)(wxFrameManagerEvent&);
    wx__DECLARE_EVT0(wxEVT_AUI_PANEBUTTON, wxFrameManagerEventHandler(func))
 #define EVT_AUI_PANECLOSE(func) \
    wx__DECLARE_EVT0(wxEVT_AUI_PANECLOSE, wxFrameManagerEventHandler(func))
+#define EVT_AUI_PANEMAXIMIZE(func) \
+   wx__DECLARE_EVT0(wxEVT_AUI_PANEMAXIMIZE, wxFrameManagerEventHandler(func))
+#define EVT_AUI_PANERESTORE(func) \
+   wx__DECLARE_EVT0(wxEVT_AUI_PANERESTORE, wxFrameManagerEventHandler(func))
 #define EVT_AUI_RENDER(func) \
    wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxFrameManagerEventHandler(func))
 
@@ -774,11 +793,15 @@ typedef void (wxEvtHandler::*wxFrameManagerEventFunction)(wxFrameManagerEvent&);
 
 %constant wxEventType wxEVT_AUI_PANEBUTTON;
 %constant wxEventType wxEVT_AUI_PANECLOSE;
+%constant wxEventType wxEVT_AUI_PANEMAXIMIZE;
+%constant wxEventType wxEVT_AUI_PANERESTORE;
 %constant wxEventType wxEVT_AUI_RENDER;
 
 %pythoncode {
     EVT_AUI_PANEBUTTON = wx.PyEventBinder( wxEVT_AUI_PANEBUTTON )
     EVT_AUI_PANECLOSE = wx.PyEventBinder( wxEVT_AUI_PANECLOSE )
+    EVT_AUI_PANECLOSE = wx.PyEventBinder( wxEVT_AUI_PANEMAXIMIZE )
+    EVT_AUI_PANECLOSE = wx.PyEventBinder( wxEVT_AUI_PANERESTORE )
     EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER )
 }
 #endif // SWIG
index de7776def204be825fefa1dea01be5b5549e8807..5aa73acaeb0432e3489ef4253c02952258f3bd7c 100644 (file)
@@ -742,7 +742,6 @@ MyFrame::MyFrame(wxWindow* parent,
     tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
     tb5->Realize();
 
-
     // add a bunch of panes
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test1")).Caption(wxT("Pane Caption")).
@@ -750,11 +749,13 @@ MyFrame::MyFrame(wxWindow* parent,
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test2")).Caption(wxT("Client Size Reporter")).
-                  Bottom().Position(1));
+                  Bottom().Position(1).
+                  PinButton(true).CloseButton(true).MaximizeButton(true));
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test3")).Caption(wxT("Client Size Reporter")).
-                  Bottom());
+                  Bottom().
+                  PinButton(true).CloseButton(true).MaximizeButton(true));
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test4")).Caption(wxT("Pane Caption")).
@@ -766,20 +767,24 @@ MyFrame::MyFrame(wxWindow* parent,
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test6")).Caption(wxT("Client Size Reporter")).
-                  Right().Row(1));
+                  Right().Row(1).
+                  PinButton(true).CloseButton(true).MaximizeButton(true));
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test7")).Caption(wxT("Client Size Reporter")).
-                  Left().Layer(1));
+                  Left().Layer(1).
+                  PinButton(true).CloseButton(true).MaximizeButton(true));
 
     m_mgr.AddPane(CreateTreeCtrl(), wxPaneInfo().
                   Name(wxT("test8")).Caption(wxT("Tree Pane")).
-                  Left().Layer(1).Position(1));
+                  Left().Layer(1).Position(1).
+                  CloseButton(true).MaximizeButton(true));
 
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("test9")).Caption(wxT("Min Size 200x100")).
                   BestSize(wxSize(200,100)).MinSize(wxSize(200,100)).
-                  Bottom().Layer(1));
+                  Bottom().Layer(1).
+                  CloseButton(true).MaximizeButton(true));
 
     wxWindow* wnd10 = CreateTextCtrl(wxT("This pane will prompt the user before hiding."));
     m_mgr.AddPane(wnd10, wxPaneInfo().
@@ -816,7 +821,6 @@ MyFrame::MyFrame(wxWindow* parent,
                   CenterPane().PaneBorder(false));
 
     // add the toolbars to the manager
-
     m_mgr.AddPane(tb1, wxPaneInfo().
                   Name(wxT("tb1")).Caption(wxT("Big Toolbar")).
                   ToolbarPane().Top().
@@ -848,7 +852,6 @@ MyFrame::MyFrame(wxWindow* parent,
                   ToolbarPane().Top().Row(2).Position(1).
                   LeftDockable(false).RightDockable(false));
 
-
     // make some default perspectives
 
     wxString perspective_all = m_mgr.SavePerspective();
@@ -1121,7 +1124,8 @@ void MyFrame::OnCreateSizeReport(wxCommandEvent& WXUNUSED(event))
 {
     m_mgr.AddPane(CreateSizeReportCtrl(), wxPaneInfo().
                   Name(wxT("Test")).Caption(wxT("Client Size Reporter")).
-                  Float().FloatingPosition(GetStartPosition()));
+                  Float().FloatingPosition(GetStartPosition()).
+                  PinButton(true).CloseButton(true).MaximizeButton(true));
     m_mgr.Update();
 }
 
index 9456f5515f4426796b046b4d261bb1c106c6cf9c..61fccf9125dc05e6f375a5f5c3ffb68174c44654 100644 (file)
@@ -187,6 +187,16 @@ wxDefaultDockArt::wxDefaultDockArt()
         0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
 #endif
 
+    static unsigned char maximize_bits[] = {
+        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0,
+        0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0,
+        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+    static unsigned char restore_bits[]={
+        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7,
+        0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd,
+        0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+        
     static unsigned char pin_bits[]={
         0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc,
         0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff,
@@ -194,15 +204,29 @@ wxDefaultDockArt::wxDefaultDockArt()
 
 #ifdef __WXMAC__
     m_inactive_close_bitmap = BitmapFromBits(close_bits, 16, 16, *wxWHITE);
+    m_active_close_bitmap = BitmapFromBits(close_bits, 16, 16, *wxWHITE );
 #else
     m_inactive_close_bitmap = BitmapFromBits(close_bits, 16, 16, m_inactive_caption_text_colour);
+    m_active_close_bitmap = BitmapFromBits(close_bits, 16, 16, m_active_caption_text_colour);
 #endif
-    m_inactive_pin_bitmap = BitmapFromBits(pin_bits, 16, 16, m_inactive_caption_text_colour);
+
 #ifdef __WXMAC__
-    m_active_close_bitmap = BitmapFromBits(close_bits, 16, 16, *wxWHITE );
+    m_inactive_maximize_bitmap = BitmapFromBits(maximize_bits, 16, 16, *wxWHITE);
+    m_active_maximize_bitmap = BitmapFromBits(maximize_bits, 16, 16, *wxWHITE );
 #else
-    m_active_close_bitmap = BitmapFromBits(close_bits, 16, 16, m_active_caption_text_colour);
+    m_inactive_maximize_bitmap = BitmapFromBits(maximize_bits, 16, 16, m_inactive_caption_text_colour);
+    m_active_maximize_bitmap = BitmapFromBits(maximize_bits, 16, 16, m_active_caption_text_colour);
 #endif
+
+#ifdef __WXMAC__
+    m_inactive_restore_bitmap = BitmapFromBits(restore_bits, 16, 16, *wxWHITE);
+    m_active_restore_bitmap = BitmapFromBits(restore_bits, 16, 16, *wxWHITE );
+#else
+    m_inactive_restore_bitmap = BitmapFromBits(restore_bits, 16, 16, m_inactive_caption_text_colour);
+    m_active_restore_bitmap = BitmapFromBits(restore_bits, 16, 16, m_active_caption_text_colour);
+#endif
+
+    m_inactive_pin_bitmap = BitmapFromBits(pin_bits, 16, 16, m_inactive_caption_text_colour);
     m_active_pin_bitmap = BitmapFromBits(pin_bits, 16, 16, m_active_caption_text_colour);
 
     // default metric values
@@ -589,6 +613,19 @@ void wxDefaultDockArt::DrawPaneButton(wxDC& dc, wxWindow *WXUNUSED(window),
     switch (button)
     {
         default:
+        case wxAUI_BUTTON_MAXIMIZE_RESTORE:
+            if (pane.IsMaximized()) {
+                if (pane.state & wxPaneInfo::optionActive)
+                    bmp = m_active_restore_bitmap;
+                    else
+                    bmp = m_inactive_restore_bitmap;
+            } else {
+                if (pane.state & wxPaneInfo::optionActive)
+                    bmp = m_active_maximize_bitmap;
+                    else
+                    bmp = m_inactive_maximize_bitmap;
+            }
+            break;
         case wxAUI_BUTTON_CLOSE:
             if (pane.state & wxPaneInfo::optionActive)
                 bmp = m_active_close_bitmap;
index 807b49a4e0a737c5c997acefb02f932ca2aecc9c..d8a8f110e4b2de2808b22e3389fdf7640a23246c 100644 (file)
@@ -50,6 +50,7 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
                         pane.floating_pos, pane.floating_size,
                         style | 
                         (pane.HasCloseButton()?wxCLOSE_BOX:0) |
+                        (pane.HasMaximizeButton()?wxMAXIMIZE:0) |
                         (pane.IsFixed()?0:wxRESIZE_BORDER)
                         )
 {
index efe9c09218fccb2c084a7ce090ff1f664c3dd080..856892f2b3a17a3129fdf3d2081c50f83b34cfda 100644 (file)
@@ -54,6 +54,8 @@ wxPaneInfo wxNullPaneInfo;
 wxDockInfo wxNullDockInfo;
 DEFINE_EVENT_TYPE(wxEVT_AUI_PANEBUTTON)
 DEFINE_EVENT_TYPE(wxEVT_AUI_PANECLOSE)
+DEFINE_EVENT_TYPE(wxEVT_AUI_PANEMAXIMIZE)
+DEFINE_EVENT_TYPE(wxEVT_AUI_PANERESTORE)
 DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER)
 
 #ifdef __WXMAC__
@@ -486,6 +488,7 @@ wxFrameManager::wxFrameManager(wxWindow* managed_wnd, unsigned int flags)
     m_hint_wnd = NULL;
     m_flags = flags;
     m_skipping = false;
+    m_has_maximized = false;
     m_frame = NULL;
     
     if (managed_wnd)
@@ -821,8 +824,14 @@ bool wxFrameManager::AddPane(wxWindow* window, const wxPaneInfo& pane_info)
     if (pinfo.dock_proportion == 0)
         pinfo.dock_proportion = 100000;
 
-    if (pinfo.HasCloseButton() &&
-        pinfo.buttons.size() == 0)
+    if (pinfo.HasMaximizeButton())
+    {
+        wxPaneButton button;
+        button.button_id = wxAUI_BUTTON_MAXIMIZE_RESTORE;
+        pinfo.buttons.Add(button);
+    }
+
+    if (pinfo.HasCloseButton())
     {
         wxPaneButton button;
         button.button_id = wxAUI_BUTTON_CLOSE;
@@ -1007,6 +1016,11 @@ bool wxFrameManager::DetachPane(wxWindow* window)
 // flags
 void wxFrameManager::ClosePane(wxPaneInfo& pane_info)
 {
+    // if we were maximized, restore
+    if(pane_info.IsMaximized()) {
+        RestorePane(pane_info);
+    }
+
     // first, hide the window
     if (pane_info.window && pane_info.window->IsShown()) {
         pane_info.window->Show(false);
@@ -1038,6 +1052,70 @@ void wxFrameManager::ClosePane(wxPaneInfo& pane_info)
     }
 }
 
+void wxFrameManager::MaximizePane(wxPaneInfo& pane_info)
+{
+    int i, pane_count;
+
+    // un-maximize and hide all other panes
+    for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
+    {
+        wxPaneInfo& p = m_panes.Item(i);
+        if(!p.IsToolbar()) {
+            p.Restore();
+            p.SaveHidden();
+            p.Hide();
+        }
+    }
+
+    // mark ourselves maximized
+    pane_info.Maximize();
+    pane_info.Show();
+    m_has_maximized = true;
+
+    // last, show the window
+    if (pane_info.window && !pane_info.window->IsShown()) {
+        pane_info.window->Show(true);
+    }
+}
+
+void wxFrameManager::RestorePane(wxPaneInfo& pane_info)
+{
+    int i, pane_count;
+
+    // restore all the panes
+    for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
+    {
+        wxPaneInfo& p = m_panes.Item(i);
+        if(!p.IsToolbar()) {
+            p.RestoreHidden();
+        }
+    }
+
+    // mark ourselves non-maximized
+    pane_info.Restore();
+    m_has_maximized = false;
+
+    // last, show the window
+    if (pane_info.window && !pane_info.window->IsShown()) {
+        pane_info.window->Show(true);
+    }
+}
+
+void wxFrameManager::RestoreMaximizedPane()
+{
+    int i, pane_count;
+
+    // restore all the panes
+    for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
+    {
+        wxPaneInfo& p = m_panes.Item(i);
+        if(p.IsMaximized()) {
+            RestorePane(p);
+            break;
+        }
+    }
+}
+
 // EscapeDelimiters() changes ";" into "\;" and "|" into "\|"
 // in the input string.  This is an internal functions which is
 // used for saving perspectives
@@ -1549,7 +1627,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
     int orientation = dock.IsHorizontal() ? wxHORIZONTAL : wxVERTICAL;
 
     // resizable bottom and right docks have a sash before them
-    if (!dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
+    if (!m_has_maximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
                         dock.dock_direction == wxAUI_DOCK_RIGHT))
     {
         sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND);
@@ -1568,6 +1646,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
     wxSizer* dock_sizer = new wxBoxSizer(orientation);
 
     // add each pane to the dock
+    bool has_maximized_pane = false;
     int pane_i, pane_count = dock.panes.GetCount();
 
     if (dock.fixed)
@@ -1583,6 +1662,9 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         {
             wxPaneInfo& pane = *(dock.panes.Item(pane_i));
             int pane_pos = pane_positions.Item(pane_i);
+            if(pane.IsMaximized()) {
+                has_maximized_pane = true;
+            }
 
             int amount = pane_pos - offset;
             if (amount > 0)
@@ -1626,10 +1708,13 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         for (pane_i = 0; pane_i < pane_count; ++pane_i)
         {
             wxPaneInfo& pane = *(dock.panes.Item(pane_i));
+            if(pane.IsMaximized()) {
+                has_maximized_pane = true;
+            }
 
             // if this is not the first pane being added,
             // we need to add a pane sizer
-            if (pane_i > 0)
+            if (!m_has_maximized && pane_i > 0)
             {
                 sizer_item = dock_sizer->Add(sash_size, sash_size, 0, wxEXPAND);
 
@@ -1647,7 +1732,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         }
     }
 
-    if (dock.dock_direction == wxAUI_DOCK_CENTER)
+    if (dock.dock_direction == wxAUI_DOCK_CENTER || has_maximized_pane)
         sizer_item = cont->Add(dock_sizer, 1, wxEXPAND);
          else
         sizer_item = cont->Add(dock_sizer, 0, wxEXPAND);
@@ -1667,7 +1752,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         cont->SetItemMinSize(dock_sizer, dock.size, 0);
 
     //  top and left docks have a sash after them
-    if (!dock.fixed && (dock.dock_direction == wxAUI_DOCK_TOP ||
+    if (!m_has_maximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_TOP ||
                         dock.dock_direction == wxAUI_DOCK_LEFT))
     {
         sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND);
@@ -1700,6 +1785,7 @@ wxSizer* wxFrameManager::LayoutAll(wxPaneInfoArray& panes,
     for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i)
         docks.Item(i).panes.Empty();
 
+
     // iterate through all known panes, filing each
     // of them into the appropriate dock. If the
     // pane does not exist in the dock, add it
@@ -1984,7 +2070,7 @@ wxSizer* wxFrameManager::LayoutAll(wxPaneInfoArray& panes,
                 for (row = 0,row_count = arr.GetCount(); row<row_count; ++row)
                    LayoutAddDock(middle, *arr.Item(row), uiparts, spacer_only);
             }
-             else
+             else if (!m_has_maximized)
             {
                 // there are no center docks, add a background area
                 wxSizerItem* sizer_item = middle->Add(1,1, 1, wxEXPAND);
@@ -3194,6 +3280,8 @@ void wxFrameManager::OnFloatingPaneMoved(wxWindow* wnd, wxDirection dir)
         if (m_flags & wxAUI_MGR_TRANSPARENT_DRAG)
             pane.frame->SetTransparent(255);
 #endif
+    } else if(m_has_maximized) {
+        RestoreMaximizedPane();
     }
 
     Update();
@@ -3425,7 +3513,7 @@ void wxFrameManager::UpdateButtonOnScreen(wxDockUIPart* button_ui_part,
              else
             state = wxAUI_BUTTON_STATE_HOVER;
     }
-    else
+     else
     {
         if (event.LeftDown())
             state = wxAUI_BUTTON_STATE_HOVER;
@@ -3440,11 +3528,14 @@ void wxFrameManager::UpdateButtonOnScreen(wxDockUIPart* button_ui_part,
     if (pt.x != 0 || pt.y != 0)
         cdc.SetDeviceOrigin(pt.x, pt.y);
 
-    m_art->DrawPaneButton(cdc, m_frame,
-              button_ui_part->button->button_id,
-              state,
-              button_ui_part->rect,
-              *hit_test->pane);
+    if (hit_test->pane)
+    {
+        m_art->DrawPaneButton(cdc, m_frame,
+                  button_ui_part->button->button_id,
+                  state,
+                  button_ui_part->rect,
+                  *hit_test->pane);
+    }
 }
 
 void wxFrameManager::OnLeftDown(wxMouseEvent& event)
@@ -3828,6 +3919,9 @@ void wxFrameManager::OnMotion(wxMouseEvent& event)
                                                       pt.y - m_action_offset.y);
 
                     // float the window
+                    if(pane_info->IsMaximized()) {
+                        RestorePane(*pane_info);
+                    }
                     pane_info->Float();
                     Update();
 
@@ -3902,12 +3996,16 @@ void wxFrameManager::OnMotion(wxMouseEvent& event)
             {
                 // make the old button normal
                 if (m_hover_button)
+                {
                     UpdateButtonOnScreen(m_hover_button, event);
-
+                    Repaint();
+                }
+                
                 // mouse is over a button, so repaint the
                 // button in hover mode
                 UpdateButtonOnScreen(part, event);
                 m_hover_button = part;
+                
             }
         }
          else
@@ -3972,6 +4070,32 @@ void wxFrameManager::OnPaneButton(wxFrameManagerEvent& evt)
             ClosePane(pane);
             Update();
         }
+    }
+    else if (evt.button == wxAUI_BUTTON_MAXIMIZE_RESTORE && !pane.IsMaximized())
+    {
+        // fire pane close event
+        wxFrameManagerEvent e(wxEVT_AUI_PANEMAXIMIZE);
+        e.SetPane(evt.pane);
+        ProcessMgrEvent(e);
+
+        if (!e.GetVeto())
+        {
+            MaximizePane(pane);
+            Update();
+        }
+    }
+    else if (evt.button == wxAUI_BUTTON_MAXIMIZE_RESTORE && pane.IsMaximized())
+    {
+        // fire pane close event
+        wxFrameManagerEvent e(wxEVT_AUI_PANERESTORE);
+        e.SetPane(evt.pane);
+        ProcessMgrEvent(e);
+
+        if (!e.GetVeto())
+        {
+            RestorePane(pane);
+            Update();
+        }
     }
      else if (evt.button == wxAUI_BUTTON_PIN)
     {