/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate with the designer.</param> public override void Initialize(IComponent component) { base.Initialize(component); m_xpanderPanelList = (XPanderPanelList)Control; //Disable the autoscroll feature for the control during design time. The control //itself sets this property to true when it initializes at run time. Trying to position //controls in this control with the autoscroll property set to True is problematic. m_xpanderPanelList.AutoScroll = false; }
private static void DrawInnerBorders(Graphics graphics, XPanderPanel xpanderPanel) { if (xpanderPanel.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { Rectangle captionRectangle = xpanderPanel.CaptionRectangle; XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList; if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) { Kesoft.Windows.Forms.Panels.Panel panel = xpanderPanelList.Parent as Kesoft.Windows.Forms.Panels.Panel; XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0)))) { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness); if (xpanderPanel.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y, captionRectangle.X + captionRectangle.Width, captionRectangle.Y); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width, captionRectangle.Y + Constants.BorderThickness); } } } else { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + captionRectangle.Height, captionRectangle.X + Constants.BorderThickness, captionRectangle.Y); if (xpanderPanel.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y); } } using (Pen borderPen = new Pen(xpanderPanel.PanelColors.InnerBorderColor)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
/// <summary> /// Called when any mouse-down message enters the adorner window of the BehaviorService. /// </summary> /// <param name="g">A Glyph.</param> /// <param name="button">A MouseButtons value indicating which button was clicked.</param> /// <param name="mouseLoc">The location at which the click occurred.</param> /// <returns>true if the message was handled; otherwise, false. </returns> public override bool OnMouseDown(System.Windows.Forms.Design.Behavior.Glyph g, MouseButtons button, Point mouseLoc) { if ((this.m_xpanderPanel != null) && (this.m_xpanderPanel.Expand == false)) { XPanderPanelList xpanderPanelList = this.m_xpanderPanel.Parent as XPanderPanelList; if (xpanderPanelList != null) { xpanderPanelList.Expand(this.m_xpanderPanel); this.m_xpanderPanel.Invalidate(false); } } return(true); // indicating we processed this event. }
private static void DrawBorders(Graphics graphics, XPanderPanel xpanderPanel) { if (xpanderPanel.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { using (Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness)) { Rectangle captionRectangle = xpanderPanel.CaptionRectangle; Rectangle borderRectangle = captionRectangle; if (xpanderPanel.Expand == true) { borderRectangle = xpanderPanel.ClientRectangle; graphics.DrawLine( borderPen, captionRectangle.Left, captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness, captionRectangle.Left + captionRectangle.Width, captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness); } XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList; if ((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) { Kesoft.Windows.Forms.Panels.Panel panel = xpanderPanelList.Parent as Kesoft.Windows.Forms.Panels.Panel; XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0)))) { if (xpanderPanel.Top != 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + captionRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); // Right vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } else { // Upper horizontal borderline only at the top xpanderPanel if (xpanderPanel.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } else { // Upper horizontal borderline only at the top xpanderPanel if (xpanderPanel.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } using (Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
internal XPanderPanelCollection(XPanderPanelList xpanderPanelList) { this.xpanderPanelList = xpanderPanelList; controlCollection = xpanderPanelList.Controls; }