]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/framemanager.cpp
Include wx/gdiobj.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / aui / framemanager.cpp
index 55303c23d3fb70f87b64f2e70ced7355a683eeb0..8ceba22d207794e03538dbfb335ba15a2ff10584 100644 (file)
     #include "wx/app.h"
     #include "wx/dcclient.h"
     #include "wx/dcscreen.h"
     #include "wx/app.h"
     #include "wx/dcclient.h"
     #include "wx/dcscreen.h"
+    #include "wx/toolbar.h"
+    #include "wx/mdi.h"
 #endif
 
 //#include "wx/dcbuffer.h"
 
 #include "wx/image.h"
 #endif
 
 //#include "wx/dcbuffer.h"
 
 #include "wx/image.h"
-#include "wx/toolbar.h"
-
-#if wxUSE_MDI
-     #include "wx/mdi.h"
-#endif
 
 WX_CHECK_BUILD_OPTIONS("wxAUI")
 
 
 WX_CHECK_BUILD_OPTIONS("wxAUI")
 
@@ -577,10 +574,11 @@ bool wxFrameManager::AddPane(wxWindow* window, const wxPaneInfo& pane_info)
     // if the pane's name identifier is blank, create a random string
     if (pinfo.name.empty())
     {
     // if the pane's name identifier is blank, create a random string
     if (pinfo.name.empty())
     {
-        pinfo.name.Printf(wxT("%08x%08x%08x%08x"),
+        pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
              ((unsigned long)pinfo.window) & 0xffffffff,
              (unsigned int)time(NULL),
              ((unsigned long)pinfo.window) & 0xffffffff,
              (unsigned int)time(NULL),
-             (unsigned int)clock(), m_panes.GetCount());
+             (unsigned int)clock(),
+             (unsigned long)m_panes.GetCount());
     }
 
     // set initial proportion (if not already set)
     }
 
     // set initial proportion (if not already set)
@@ -677,7 +675,7 @@ bool wxFrameManager::InsertPane(wxWindow* window, const wxPaneInfo& pane_info,
     {
         return AddPane(window, pane_info);
     }
     {
         return AddPane(window, pane_info);
     }
-     else
+    else
     {
         if (pane_info.IsFloating())
         {
     {
         if (pane_info.IsFloating())
         {
@@ -1142,7 +1140,7 @@ void wxFrameManager::LayoutAddPane(wxSizer* cont,
     {
         sizer_item = vert_pane_sizer->Add(1, 1, 1, wxEXPAND);
     }
     {
         sizer_item = vert_pane_sizer->Add(1, 1, 1, wxEXPAND);
     }
-     else
+    else
     {
         sizer_item = vert_pane_sizer->Add(pane.window, 1, wxEXPAND);
         vert_pane_sizer->SetItemMinSize(pane.window, 1, 1);
     {
         sizer_item = vert_pane_sizer->Add(pane.window, 1, wxEXPAND);
         vert_pane_sizer->SetItemMinSize(pane.window, 1, 1);
@@ -1201,7 +1199,7 @@ void wxFrameManager::LayoutAddPane(wxSizer* cont,
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
-     else
+    else
     {
         sizer_item = cont->Add(horz_pane_sizer, pane_proportion, wxEXPAND);
     }
     {
         sizer_item = cont->Add(horz_pane_sizer, pane_proportion, wxEXPAND);
     }
@@ -1291,7 +1289,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
-     else
+    else
     {
         for (pane_i = 0; pane_i < pane_count; ++pane_i)
         {
     {
         for (pane_i = 0; pane_i < pane_count; ++pane_i)
         {
@@ -2088,8 +2086,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              Position(pt.y - GetDockPixelOffset(drop) - offset.y);
         return ProcessDockResult(target, drop);
     }
              Position(pt.y - GetDockPixelOffset(drop) - offset.y);
         return ProcessDockResult(target, drop);
     }
-     else if (pt.y < layer_insert_offset &&
-              pt.y > layer_insert_offset-auiLayerInsertPixels)
+    else if (pt.y < layer_insert_offset &&
+             pt.y > layer_insert_offset-auiLayerInsertPixels)
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP),
                                     GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP),
                                     GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
@@ -2100,8 +2098,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              Position(pt.x - GetDockPixelOffset(drop) - offset.x);
         return ProcessDockResult(target, drop);
     }
              Position(pt.x - GetDockPixelOffset(drop) - offset.x);
         return ProcessDockResult(target, drop);
     }
-     else if (pt.x >= cli_size.x - layer_insert_offset &&
-              pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels)
+    else if (pt.x >= cli_size.x - layer_insert_offset &&
+             pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels)
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT),
                                     GetMaxLayer(docks, wxAUI_DOCK_TOP)),
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT),
                                     GetMaxLayer(docks, wxAUI_DOCK_TOP)),
@@ -2112,8 +2110,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              Position(pt.y - GetDockPixelOffset(drop) - offset.y);
         return ProcessDockResult(target, drop);
     }
              Position(pt.y - GetDockPixelOffset(drop) - offset.y);
         return ProcessDockResult(target, drop);
     }
-     else if (pt.y >= cli_size.y - layer_insert_offset &&
-              pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
+    else if (pt.y >= cli_size.y - layer_insert_offset &&
+             pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
                                     GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
     {
         int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
                                     GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
@@ -2462,10 +2460,8 @@ void wxFrameManager::ShowHint(const wxRect& rect)
         }
          else
         {
         }
          else
         {
-            wxPoint pt = rect.GetPosition();
-            wxSize size = rect.GetSize();
             MakeWindowTransparent(m_hint_wnd, initial_fade);
             MakeWindowTransparent(m_hint_wnd, initial_fade);
-            m_hint_wnd->SetSize(pt.x, pt.y, rect.width, rect.height);
+            m_hint_wnd->SetSize(rect);
         }
 
         if (m_flags & wxAUI_MGR_TRANSPARENT_HINT_FADE)
         }
 
         if (m_flags & wxAUI_MGR_TRANSPARENT_HINT_FADE)
@@ -2948,7 +2944,7 @@ void wxFrameManager::UpdateButtonOnScreen(wxDockUIPart* button_ui_part,
              else
             state = wxAUI_BUTTON_STATE_HOVER;
     }
              else
             state = wxAUI_BUTTON_STATE_HOVER;
     }
-     else
+    else
     {
         if (event.LeftDown())
             state = wxAUI_BUTTON_STATE_HOVER;
     {
         if (event.LeftDown())
             state = wxAUI_BUTTON_STATE_HOVER;
@@ -3234,7 +3230,7 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
             Repaint(NULL);
         }
     }
             Repaint(NULL);
         }
     }
-     else if (m_action == actionClickButton)
+    else if (m_action == actionClickButton)
     {
         m_hover_button = NULL;
         m_frame->ReleaseMouse();
     {
         m_hover_button = NULL;
         m_frame->ReleaseMouse();
@@ -3250,15 +3246,15 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
             ProcessMgrEvent(e);
         }
     }
             ProcessMgrEvent(e);
         }
     }
-     else if (m_action == actionClickCaption)
+    else if (m_action == actionClickCaption)
     {
         m_frame->ReleaseMouse();
     }
     {
         m_frame->ReleaseMouse();
     }
-     else if (m_action == actionDragFloatingPane)
+    else if (m_action == actionDragFloatingPane)
     {
         m_frame->ReleaseMouse();
     }
     {
         m_frame->ReleaseMouse();
     }
-     else if (m_action == actionDragToolbarPane)
+    else if (m_action == actionDragToolbarPane)
     {
         m_frame->ReleaseMouse();
 
     {
         m_frame->ReleaseMouse();
 
@@ -3284,7 +3280,7 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
         pane.state &= ~wxPaneInfo::actionPane;
         Update();
     }
         pane.state &= ~wxPaneInfo::actionPane;
         Update();
     }
-     else
+    else
     {
         event.Skip();
     }
     {
         event.Skip();
     }
@@ -3325,7 +3321,7 @@ void wxFrameManager::OnMotion(wxMouseEvent& event)
         DrawResizeHint(dc, rect);
         m_action_hintrect = rect;
     }
         DrawResizeHint(dc, rect);
         m_action_hintrect = rect;
     }
-     else if (m_action == actionClickCaption)
+    else if (m_action == actionClickCaption)
     {
         int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X);
         int drag_y_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_Y);
     {
         int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X);
         int drag_y_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_Y);
@@ -3372,13 +3368,13 @@ void wxFrameManager::OnMotion(wxMouseEvent& event)
             }
         }
     }
             }
         }
     }
-     else if (m_action == actionDragFloatingPane)
+    else if (m_action == actionDragFloatingPane)
     {
         wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
         m_action_window->Move(pt.x - m_action_offset.x,
                              pt.y - m_action_offset.y);
     }
     {
         wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
         m_action_window->Move(pt.x - m_action_offset.x,
                              pt.y - m_action_offset.y);
     }
-     else if (m_action == actionDragToolbarPane)
+    else if (m_action == actionDragToolbarPane)
     {
         wxPaneInfo& pane = GetPane(m_action_window);
         wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
     {
         wxPaneInfo& pane = GetPane(m_action_window);
         wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
@@ -3481,7 +3477,7 @@ void wxFrameManager::OnPaneButton(wxFrameManagerEvent& event)
         pane.Hide();
         Update();
     }
         pane.Hide();
         Update();
     }
-     else if (event.button == wxPaneInfo::buttonPin)
+    else if (event.button == wxPaneInfo::buttonPin)
     {
         if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) &&
             pane.IsFloatable())
     {
         if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) &&
             pane.IsFloatable())