]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/framemanager.cpp
don't use old name for wxTE_PROCESS_ENTER unavailable when compatibility is off
[wxWidgets.git] / src / aui / framemanager.cpp
index 933aa5a75ea9048a9d5945172e24a9793379954f..99614d76382fa9e8b461a2ad4a487c98df13d7fa 100644 (file)
@@ -333,7 +333,9 @@ static void RenumberDockRows(wxDockInfoPtrArray& docks)
 }
 
 
-
+// SetActivePane() sets the active pane, as well as cycles through
+// every other pane and makes sure that all others' active flags
+// are turned off
 static void SetActivePane(wxPaneInfoArray& panes, wxWindow* active_pane)
 {
     int i, pane_count;
@@ -544,7 +546,9 @@ void wxFrameManager::ProcessMgrEvent(wxFrameManagerEvent& event)
 
 // SetArtProvider() instructs wxFrameManager to use the
 // specified art provider for all drawing calls.  This allows
-// plugable look-and-feel features
+// plugable look-and-feel features.  The pointer that is
+// passed to this method subsequently belongs to wxFrameManager,
+// and is deleted in the frame manager destructor
 void wxFrameManager::SetArtProvider(wxDockArt* art_provider)
 {
     // delete the last art provider, if any
@@ -554,6 +558,7 @@ void wxFrameManager::SetArtProvider(wxDockArt* art_provider)
     m_art = art_provider;
 }
 
+
 bool wxFrameManager::AddPane(wxWindow* window, const wxPaneInfo& pane_info)
 {
     // check if the pane has a valid window
@@ -574,10 +579,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())
     {
-        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 int)clock(), m_panes.GetCount());
+             (unsigned int)clock(),
+             (unsigned long)m_panes.GetCount());
     }
 
     // set initial proportion (if not already set)
@@ -674,7 +680,7 @@ bool wxFrameManager::InsertPane(wxWindow* window, const wxPaneInfo& pane_info,
     {
         return AddPane(window, pane_info);
     }
-     else
+    else
     {
         if (pane_info.IsFloating())
         {
@@ -697,6 +703,8 @@ bool wxFrameManager::InsertPane(wxWindow* window, const wxPaneInfo& pane_info,
 }
 
 
+// DetachPane() removes a pane from the frame manager.  This
+// method will not destroy the window that is removed.
 bool wxFrameManager::DetachPane(wxWindow* window)
 {
     int i, count;
@@ -1139,7 +1147,7 @@ void wxFrameManager::LayoutAddPane(wxSizer* cont,
     {
         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);
@@ -1198,7 +1206,7 @@ void wxFrameManager::LayoutAddPane(wxSizer* cont,
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
-     else
+    else
     {
         sizer_item = cont->Add(horz_pane_sizer, pane_proportion, wxEXPAND);
     }
@@ -1288,7 +1296,7 @@ void wxFrameManager::LayoutAddDock(wxSizer* cont,
         part.sizer_item = sizer_item;
         uiparts.Add(part);
     }
-     else
+    else
     {
         for (pane_i = 0; pane_i < pane_count; ++pane_i)
         {
@@ -2085,8 +2093,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              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)),
@@ -2097,8 +2105,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              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)),
@@ -2109,8 +2117,8 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
              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)),
@@ -2459,10 +2467,8 @@ void wxFrameManager::ShowHint(const wxRect& rect)
         }
          else
         {
-            wxPoint pt = rect.GetPosition();
-            wxSize size = rect.GetSize();
             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)
@@ -2945,7 +2951,7 @@ void wxFrameManager::UpdateButtonOnScreen(wxDockUIPart* button_ui_part,
              else
             state = wxAUI_BUTTON_STATE_HOVER;
     }
-     else
+    else
     {
         if (event.LeftDown())
             state = wxAUI_BUTTON_STATE_HOVER;
@@ -3231,7 +3237,7 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
             Repaint(NULL);
         }
     }
-     else if (m_action == actionClickButton)
+    else if (m_action == actionClickButton)
     {
         m_hover_button = NULL;
         m_frame->ReleaseMouse();
@@ -3247,15 +3253,15 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
             ProcessMgrEvent(e);
         }
     }
-     else if (m_action == actionClickCaption)
+    else if (m_action == actionClickCaption)
     {
         m_frame->ReleaseMouse();
     }
-     else if (m_action == actionDragFloatingPane)
+    else if (m_action == actionDragFloatingPane)
     {
         m_frame->ReleaseMouse();
     }
-     else if (m_action == actionDragToolbarPane)
+    else if (m_action == actionDragToolbarPane)
     {
         m_frame->ReleaseMouse();
 
@@ -3281,7 +3287,7 @@ void wxFrameManager::OnLeftUp(wxMouseEvent& event)
         pane.state &= ~wxPaneInfo::actionPane;
         Update();
     }
-     else
+    else
     {
         event.Skip();
     }
@@ -3322,7 +3328,7 @@ void wxFrameManager::OnMotion(wxMouseEvent& event)
         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);
@@ -3369,13 +3375,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);
     }
-     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"));
@@ -3478,7 +3484,7 @@ void wxFrameManager::OnPaneButton(wxFrameManagerEvent& event)
         pane.Hide();
         Update();
     }
-     else if (event.button == wxPaneInfo::buttonPin)
+    else if (event.button == wxPaneInfo::buttonPin)
     {
         if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) &&
             pane.IsFloatable())