[Mono-dev] MonoDevelop.Components.Docking - Tabbed	DockGroupType question
    Tara.Hemphill at l-3com.com 
    Tara.Hemphill at l-3com.com
       
    Fri Jun 24 12:35:42 EDT 2011
    
    
  
To fix the problem I added a check to see if the item being docked is
the same as the first item in the tab group, if so, modifies the
insertion index appropriately because trying to insert the item before
itself in the group causes the float problem. Since its status was
"AutoHide" it is still technically visible, so was kept in the tab
group's list of visible objects.  Changes are below.
 
(1)DockGroup.cs (line 122) - commented out the index increase:
 
    public DockGroupItem AddObject (DockItem obj, DockPosition pos,
string relItemId)
    {
    ...
    else if (pos == DockPosition.CenterBefore || pos ==
DockPosition.Center) {
                        if (type != DockGroupType.Tabbed)
                              gitem = Split (DockGroupType.Tabbed, pos
== DockPosition.CenterBefore, obj, npos);
                        else {
                              //if (pos == DockPosition.Center) //
removed to fix issue with drag/docking the 1st tab item after autohiding
                                    //npos++;
                              gitem = new DockGroupItem (Frame, obj);
                              dockObjects.Insert (npos, gitem);
                              gitem.ParentGroup = this;
                        }
                  }
                  ResetVisibleGroups ();
                  return gitem;
    }
 
 
(2)DockGroup.cs (line 912) - added check for same item
 
    internal override bool GetDockTarget (DockItem item, int px, int py,
out DockDelegate dockDelegate, out Gdk.Rectangle rect)
            {
                  if (!Allocation.Contains (px, py) ||
VisibleObjects.Count == 0) {
                        dockDelegate = null;
                        rect = Gdk.Rectangle.Zero;
                        return false;
                  }
                  
                  if (type == DockGroupType.Tabbed) {
                    // this is a fix for issue with drag/docking the 1st
tab item after autohiding it
                    int pos = 0;
                    if (item.Id ==
((DockGroupItem)VisibleObjects[0]).Id)
                    {
                        pos++;
                    }
    
                        // Tabs can only contain DockGroupItems
                        return
((DockGroupItem)VisibleObjects[pos]).GetDockTarget (item, px, py,
Allocation, out dockDelegate, out rect);
                  }
    ...
 
 
Tara Hemphill
Software Engineer
L-3 Communications - Integrated Systems
Phone: x3012
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110624/24519b07/attachment-0001.html 
    
    
More information about the Mono-devel-list
mailing list