private void SetupDockingHintWindows(Bar barMouseOver, IDockInfo barDockInfo) { Rectangle parentFormScreenRect=Rectangle.Empty; const int HINT_EDGE_OFFSET=32; if(m_TopDockSite.Parent.Parent!=null) { parentFormScreenRect=new Rectangle(m_TopDockSite.Parent.PointToScreen(Point.Empty),m_TopDockSite.Parent.Size); parentFormScreenRect.Y+=m_TopDockSite.Height; parentFormScreenRect.Height-=m_TopDockSite.Height; } else { parentFormScreenRect=m_TopDockSite.Parent.Bounds; parentFormScreenRect.Y+=m_TopDockSite.Height; parentFormScreenRect.Height-=m_TopDockSite.Height; } if(!this.DesignMode) { // Left Docking Hint if(barDockInfo.CanDockLeft) { if(m_DockingHintLeft==null) { m_DockingHintLeft=new DockingHint(eDockingHintSide.Left, GetEffectiveStyle()); m_DockingHintLeft.Location=new Point(parentFormScreenRect.X+HINT_EDGE_OFFSET,parentFormScreenRect.Y+(parentFormScreenRect.Height-m_DockingHintLeft.Height)/2); m_DockingHintLeft.ShowFocusless(); } } else if(m_DockingHintLeft!=null) { m_DockingHintLeft.Close(); m_DockingHintLeft.Dispose(); m_DockingHintLeft=null; } // Right Docking Hint if(barDockInfo.CanDockRight) { if(m_DockingHintRight==null) { m_DockingHintRight=new DockingHint(eDockingHintSide.Right, GetEffectiveStyle()); m_DockingHintRight.Location=new Point(parentFormScreenRect.Right-HINT_EDGE_OFFSET-m_DockingHintRight.Width,parentFormScreenRect.Y+(parentFormScreenRect.Height-m_DockingHintRight.Height)/2); m_DockingHintRight.ShowFocusless(); } } else if(m_DockingHintRight!=null) { m_DockingHintRight.Close(); m_DockingHintRight.Dispose(); m_DockingHintRight=null; } // Top Docking Hint if(barDockInfo.CanDockTop) { if(m_DockingHintTop==null) { m_DockingHintTop=new DockingHint(eDockingHintSide.Top, GetEffectiveStyle()); m_DockingHintTop.Location=new Point(parentFormScreenRect.X+(parentFormScreenRect.Width-m_DockingHintTop.Width)/2,parentFormScreenRect.Y+HINT_EDGE_OFFSET); m_DockingHintTop.ShowFocusless(); } } else if(m_DockingHintTop!=null) { m_DockingHintTop.Close(); m_DockingHintTop.Dispose(); m_DockingHintTop=null; } // Bottom Docking Hint if(barDockInfo.CanDockBottom) { if(m_DockingHintBottom==null) { m_DockingHintBottom=new DockingHint(eDockingHintSide.Bottom, GetEffectiveStyle()); m_DockingHintBottom.Location=new Point(parentFormScreenRect.X+(parentFormScreenRect.Width-m_DockingHintBottom.Width)/2,parentFormScreenRect.Bottom-HINT_EDGE_OFFSET-m_DockingHintBottom.Height); m_DockingHintBottom.ShowFocusless(); } } else if(m_DockingHintBottom!=null) { m_DockingHintBottom.Close(); m_DockingHintBottom.Dispose(); m_DockingHintBottom=null; } } // Middle docking hint bool bShowMidHint=false; eDockingHintSide hintSides=eDockingHintSide.All; if(barMouseOver==null) { hintSides=eDockingHintSide.Top; if(barDockInfo.CanDockBottom) hintSides=eDockingHintSide.Bottom; if(barDockInfo.CanDockLeft) hintSides=hintSides | eDockingHintSide.Left; if(barDockInfo.CanDockRight) hintSides=hintSides | eDockingHintSide.Right; if(barDockInfo.CanDockTop) hintSides=hintSides | eDockingHintSide.Top; else hintSides=hintSides & ~(hintSides & eDockingHintSide.Top); if(this.IsDocumentDockingEnabled && barDockInfo.CanDockDocument) { hintSides=eDockingHintSide.All; } } else { if(!barDockInfo.CanDockTab) hintSides=hintSides & ~(hintSides & eDockingHintSide.DockTab); } if(m_DockingHintMiddle==null) { if(barMouseOver!=null) m_DockingHintMiddle=new DockingHint(hintSides,true, GetEffectiveStyle()); else m_DockingHintMiddle = new DockingHint(hintSides, true, GetEffectiveStyle()); bShowMidHint=true; } else { if(barMouseOver!=null) m_DockingHintMiddle.DockingHintSides=hintSides; // eDockingHintSide.All; else m_DockingHintMiddle.DockingHintSides=hintSides; //eDockingHintSide.Sides; } Point midLocation=new Point(parentFormScreenRect.X+(parentFormScreenRect.Width-m_DockingHintMiddle.Width)/2, parentFormScreenRect.Y+(parentFormScreenRect.Height-m_DockingHintMiddle.Height)/2); if(barMouseOver!=null) { Point p=barMouseOver.PointToScreen(Point.Empty); midLocation=new Point(p.X+(barMouseOver.Width-m_DockingHintMiddle.Width)/2, p.Y+(barMouseOver.Height-m_DockingHintMiddle.Height)/2); } Rectangle r=new Rectangle(midLocation,m_DockingHintMiddle.Size); if(m_DockingHintLeft!=null && r.IntersectsWith(m_DockingHintLeft.Bounds)) { if(Control.MousePosition.Y<m_DockingHintLeft.Top) midLocation.Y=m_DockingHintLeft.Top-m_DockingHintMiddle.Height; else midLocation.Y=m_DockingHintLeft.Bottom; } else if(m_DockingHintRight!=null && r.IntersectsWith(m_DockingHintRight.Bounds)) { if(Control.MousePosition.Y<m_DockingHintRight.Top) midLocation.Y=m_DockingHintRight.Top-m_DockingHintMiddle.Height; else midLocation.Y=m_DockingHintRight.Bottom; } else if(m_DockingHintTop!=null && r.IntersectsWith(m_DockingHintTop.Bounds)) { if(Control.MousePosition.X>m_DockingHintTop.Left) midLocation.X=m_DockingHintTop.Right; else midLocation.X=m_DockingHintTop.Left-m_DockingHintMiddle.Width; } else if(m_DockingHintBottom!=null && r.IntersectsWith(m_DockingHintBottom.Bounds)) { if(Control.MousePosition.X>m_DockingHintBottom.Left) midLocation.X=m_DockingHintBottom.Right; else midLocation.X=m_DockingHintBottom.Left-m_DockingHintMiddle.Width; } if(m_DockingHintMiddle.Location!=midLocation) { m_DockingHintMiddle.Location=midLocation; } if(bShowMidHint) { m_DockingHintMiddle.ShowFocusless(); } }