コード例 #1
0
 /// <summary>
 /// Initializes the designer with the specified component.
 /// </summary>
 /// <param name="component">The IComponent to associate with the designer.</param>
 public override void Initialize(System.ComponentModel.IComponent component)
 {
     base.Initialize(component);
     this.m_xpanderPanelList = (XPanderPanelList)this.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.
     this.m_xpanderPanelList.AutoScroll = false;
 }
コード例 #2
0
        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))
                    {
                        BSE.Windows.Forms.Panel panel = xpanderPanelList.Parent as BSE.Windows.Forms.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);
                    }
                }
            }
        }
コード例 #3
0
 /// <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.
 }
コード例 #4
0
 /// <summary>
 /// Initializes the designer with the specified component.
 /// </summary>
 /// <param name="component">The IComponent to associate with the designer.</param>
 public override void Initialize(System.ComponentModel.IComponent component)
 {
    base.Initialize(component);
    this.m_xpanderPanelList = (XPanderPanelList) this.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.
    this.m_xpanderPanelList.AutoScroll = false;
 }
コード例 #5
0
 internal XPanderPanelCollection(XPanderPanelList xpanderPanelList)
 {
    this.m_xpanderPanelList = xpanderPanelList;
    this.m_controlCollection = this.m_xpanderPanelList.Controls;
 }
コード例 #6
0
        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))
                        {
                            BSE.Windows.Forms.Panel panel = xpanderPanelList.Parent as BSE.Windows.Forms.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);
                    }
                }
            }
        }
コード例 #7
0
 internal XPanderPanelCollection(XPanderPanelList xpanderPanelList)
 {
     this.m_xpanderPanelList  = xpanderPanelList;
     this.m_controlCollection = this.m_xpanderPanelList.Controls;
 }
コード例 #8
0
 internal XPanderPanelCollection(XPanderPanelList xpanderPanelList)
 {
     m_xpanderPanelList  = xpanderPanelList;
     m_controlCollection = m_xpanderPanelList.Controls;
 }