[Mono-dev] MonoDevelop.Components.Docking - Tabbed DockGroupType question

Tara.Hemphill at l-3com.com Tara.Hemphill at l-3com.com
Wed Jun 15 16:51:57 EDT 2011


Our application uses the MonoDevelop.Components.Docking framework in our
Windows application. We last updated to the latest version in November
2010.  I have come across some interesting behavior that occurs in the
following situation:

 

-          Press the auto hide button of the first panel in a
DockGroupType.Tabbed ParentGroup

-          Hold mouse over collapsed panel until it expands

-          Drag panel into center of the tabbed group (back to original
spot) and drop

 

At this point the panel resizes to the size of the blue rectangle that
showed where the panel would be dropped, and then undocks from the main
window to float at that size.  This only happens on the first item in a
tabbed group.  I found a commented out section of code in
DockGroupItem.cs (line 112, GetDockTarget(..)) that seems as though it
might deal with this. However, it references a DockPosition type that is
not defined, CenterAfter.  The method is below, with the commented out
portion in bold:

 

public bool GetDockTarget (DockItem item, int px, int py, Gdk.Rectangle
rect, out DockDelegate dockDelegate, out Gdk.Rectangle outrect)

{

     dockDelegate = null;

                

     if (item != this.item && this.item.Visible && rect.Contains (px,
py)) {

          int xdockMargin = (int) ((double)rect.Width * (1.0 -
DockFrame.ItemDockCenterArea)) / 2;

          int ydockMargin = (int) ((double)rect.Height * (1.0 -
DockFrame.ItemDockCenterArea)) / 2;

          DockPosition pos;

                     

/*        if (ParentGroup.Type == DockGroupType.Tabbed) {

                rect = new Gdk.Rectangle (rect.X + xdockMargin, rect.Y +
ydockMargin, rect.Width - xdockMargin*2, rect.Height - ydockMargin*2);

                pos = DockPosition.CenterAfter;

          }

*/        if (px <= rect.X + xdockMargin && ParentGroup.Type !=
DockGroupType.Horizontal) {

                outrect = new Gdk.Rectangle (rect.X, rect.Y,
xdockMargin, rect.Height);

                pos = DockPosition.Left;

          }

          else if (px >= rect.Right - xdockMargin && ParentGroup.Type !=
DockGroupType.Horizontal) {

                outrect = new Gdk.Rectangle (rect.Right - xdockMargin,
rect.Y, xdockMargin, rect.Height);

                pos = DockPosition.Right;

          }

          else if (py <= rect.Y + ydockMargin && ParentGroup.Type !=
DockGroupType.Vertical) {

                outrect = new Gdk.Rectangle (rect.X, rect.Y, rect.Width,
ydockMargin);

                pos = DockPosition.Top;

          }

          else if (py >= rect.Bottom - ydockMargin && ParentGroup.Type
!= DockGroupType.Vertical) {

                outrect = new Gdk.Rectangle (rect.X, rect.Bottom -
ydockMargin, rect.Width, ydockMargin);

                pos = DockPosition.Bottom;

          }

          else {

                outrect = new Gdk.Rectangle (rect.X + xdockMargin,
rect.Y + ydockMargin, rect.Width - xdockMargin*2, rect.Height -
ydockMargin*2);

                pos = DockPosition.Center;

          }

          

          dockDelegate = delegate (DockItem dit) {

                DockGroupItem it = ParentGroup.AddObject (dit, pos, Id);

                it.SetVisible (true);

                ParentGroup.FocusItem (it);

          };

          return true;

     }

     outrect = Gdk.Rectangle.Zero;

     return false;

}

 

I have tried a few small things, but nothing as affected the behavior so
far.  Any ideas on what I could edit to get this working properly?
Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110615/5c3fedfd/attachment-0001.html 


More information about the Mono-devel-list mailing list