private static void DrawBorders(Graphics graphics, XPanderPanel xpanderPanel) { if (xpanderPanel.ShowBorder) { using (GraphicsPath graphicsPath = new GraphicsPath()) { using (Pen pen = new Pen(xpanderPanel.PanelColors.BorderColor, 1f)) { Rectangle captionRectangle = xpanderPanel.CaptionRectangle; Rectangle rectangle = captionRectangle; if (xpanderPanel.Expand) { rectangle = xpanderPanel.ClientRectangle; graphics.DrawLine(pen, captionRectangle.Left, captionRectangle.Top + captionRectangle.Height - 1, captionRectangle.Left + captionRectangle.Width, captionRectangle.Top + captionRectangle.Height - 1); } XPanderPanelList xPanderPanelList = xpanderPanel.Parent as XPanderPanelList; if (xPanderPanelList != null && xPanderPanelList.Dock == DockStyle.Fill) { TXPanelFrame tXPanelFrame = xPanderPanelList.Parent as TXPanelFrame; XPanderPanel xPanderPanel = xPanderPanelList.Parent as XPanderPanel; if ((tXPanelFrame != null && tXPanelFrame.Padding == new Padding(0)) || (xPanderPanel != null && xPanderPanel.Padding == new Padding(0))) { if (xpanderPanel.Top != 0) { graphicsPath.AddLine(rectangle.Left, rectangle.Top, rectangle.Left + captionRectangle.Width, rectangle.Top); } graphics.DrawLine(pen, rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Top + rectangle.Height); graphics.DrawLine(pen, rectangle.Left + rectangle.Width - 1, rectangle.Top, rectangle.Left + rectangle.Width - 1, rectangle.Top + rectangle.Height); } else { if (xpanderPanel.Top == 0) { graphicsPath.AddLine(rectangle.Left, rectangle.Top, rectangle.Left + rectangle.Width, rectangle.Top); } graphicsPath.AddLine(rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Top + rectangle.Height); graphicsPath.AddLine(rectangle.Left, rectangle.Top + rectangle.Height - 1, rectangle.Left + rectangle.Width - 1, rectangle.Top + rectangle.Height - 1); graphicsPath.AddLine(rectangle.Left + rectangle.Width - 1, rectangle.Top, rectangle.Left + rectangle.Width - 1, rectangle.Top + rectangle.Height); } } else { if (xpanderPanel.Top == 0) { graphicsPath.AddLine(rectangle.Left, rectangle.Top, rectangle.Left + rectangle.Width, rectangle.Top); } graphicsPath.AddLine(rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Top + rectangle.Height); graphicsPath.AddLine(rectangle.Left, rectangle.Top + rectangle.Height - 1, rectangle.Left + rectangle.Width - 1, rectangle.Top + rectangle.Height - 1); graphicsPath.AddLine(rectangle.Left + rectangle.Width - 1, rectangle.Top, rectangle.Left + rectangle.Width - 1, rectangle.Top + rectangle.Height); } } using (Pen pen = new Pen(xpanderPanel.PanelColors.BorderColor, 1f)) { graphics.DrawPath(pen, graphicsPath); } } } }
public override bool OnMouseDown(Glyph g, MouseButtons button, Point mouseLoc) { if (m_xpanderPanel != null && !m_xpanderPanel.Expand) { XPanderPanelList xPanderPanelList = m_xpanderPanel.Parent as XPanderPanelList; if (xPanderPanelList != null) { xPanderPanelList.Expand(m_xpanderPanel); m_xpanderPanel.Invalidate(invalidateChildren: false); } } return(true); }
private static void DrawInnerBorders(Graphics graphics, XPanderPanel xpanderPanel) { if (xpanderPanel.ShowBorder) { using (GraphicsPath graphicsPath = new GraphicsPath()) { Rectangle captionRectangle = xpanderPanel.CaptionRectangle; XPanderPanelList xPanderPanelList = xpanderPanel.Parent as XPanderPanelList; if (xPanderPanelList != null && xPanderPanelList.Dock == DockStyle.Fill) { TXPanelFrame tXPanelFrame = xPanderPanelList.Parent as TXPanelFrame; XPanderPanel xPanderPanel = xPanderPanelList.Parent as XPanderPanel; if ((tXPanelFrame != null && tXPanelFrame.Padding == new Padding(0)) || (xPanderPanel != null && xPanderPanel.Padding == new Padding(0))) { graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + 1); if (xpanderPanel.Top == 0) { graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y, captionRectangle.X + captionRectangle.Width, captionRectangle.Y); } else { graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + 1, captionRectangle.X + captionRectangle.Width, captionRectangle.Y + 1); } } } else { graphicsPath.AddLine(captionRectangle.X + 1, captionRectangle.Y + captionRectangle.Height, captionRectangle.X + 1, captionRectangle.Y); if (xpanderPanel.Top == 0) { graphicsPath.AddLine(captionRectangle.X + 1, captionRectangle.Y + 1, captionRectangle.X + captionRectangle.Width - 1, captionRectangle.Y + 1); } else { graphicsPath.AddLine(captionRectangle.X + 1, captionRectangle.Y, captionRectangle.X + captionRectangle.Width - 1, captionRectangle.Y); } } using (Pen pen = new Pen(xpanderPanel.PanelColors.InnerBorderColor)) { graphics.DrawPath(pen, graphicsPath); } } } }
internal XPanderPanelCollection(XPanderPanelList xpanderPanelList) { m_xpanderPanelList = xpanderPanelList; m_controlCollection = m_xpanderPanelList.Controls; }
public override void Initialize(IComponent component) { base.Initialize(component); m_xpanderPanelList = (XPanderPanelList)Control; m_xpanderPanelList.AutoScroll = false; }