Kirix Support Forums

Allow DoDrop to insert rows in vertical docks too

Please post any wxAUI patches or modifications you've created here. Thanks!

Allow DoDrop to insert rows in vertical docks too

Postby abligh on Thu Feb 09, 2006 3:04 pm

DoDrop seems to be buggy inserting rows into vertical docks (i.e. it uses the horizontal drop logic). I think the following patch fixes it.

Code: Select all
Index: src/manager.cpp
===================================================================
--- src/manager.cpp  (revision 427)
+++ src/manager.cpp  (working copy)
@@ -2870,8 +2870,10 @@
              Row(part->dock->dock_row).
              Position(dock_drop_offset);

-        if (pt.y < part->dock->rect.y + 2 &&
-            part->dock->panes.GetCount() > 1)
+        if ((
+            ((pt.y < part->dock->rect.y + 2) && part->dock->IsHorizontal()) ||
+            ((pt.x < part->dock->rect.x + 2) && part->dock->IsVertical())
+            ) && part->dock->panes.GetCount() > 1)
         {
             int row = drop.dock_row;
             DoInsertDockRow(panes, part->dock->dock_direction,
@@ -2880,8 +2882,10 @@
             drop.dock_row = row;
         }

-        if (pt.y > part->dock->rect.y + part->dock->rect.height - 2 &&
-            part->dock->panes.GetCount() > 1)
+        if ((
+            ((pt.y > part->dock->rect.y + part->dock->rect.height - 2 ) && part->dock->IsHorizontal()) ||
+            ((pt.x > part->dock->rect.x + part->dock->rect.width - 2 ) && part->dock->IsVertical())
+            ) && part->dock->panes.GetCount() > 1)
         {
             DoInsertDockRow(panes, part->dock->dock_direction,
                             part->dock->dock_layer,
abligh
Registered User
 
Posts: 59
Joined: Sun Jan 01, 2006 2:31 pm

Return to wxAUI Patches & Modifications