- // determine the total proportion of all resizable panes,
- // and the total size of the dock minus the size of all
- // the fixed panes
- int i, dock_pane_count = dock.panes.GetCount();
- int pane_position = -1;
- for (i = 0; i < dock_pane_count; ++i)
+ // determine the size of the dock, based on orientation
+ if (dock.IsHorizontal())
+ dock_pixels = dock.rect.GetWidth();
+ else
+ dock_pixels = dock.rect.GetHeight();
+
+ // determine the total proportion of all resizable panes,
+ // and the total size of the dock minus the size of all
+ // the fixed panes
+ int i, dock_pane_count = dock.panes.GetCount();
+ int pane_position = -1;
+ for (i = 0; i < dock_pane_count; ++i)
+ {
+ wxAuiPaneInfo& p = *dock.panes.Item(i);
+ if (p.window == pane.window)
+ pane_position = i;
+
+ // while we're at it, subtract the pane sash
+ // width from the dock width, because this would
+ // skew our proportion calculations
+ if (i > 0)
+ dock_pixels -= sashSize;
+
+ // also, the whole size (including decorations) of
+ // all fixed panes must also be subtracted, because they
+ // are not part of the proportion calculation
+ if (p.IsFixed())