Пример #1
0
        private static void DrawInnerBorders(Graphics graphics, PanderPanelW PanderPanelW)
        {
            if (PanderPanelW.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    Rectangle        captionRectangle = PanderPanelW.CaptionRectangle;
                    PanderPanelListW PanderPanelListW = PanderPanelW.Parent as PanderPanelListW;
                    if ((PanderPanelListW != null) && (PanderPanelListW.Dock == DockStyle.Fill))
                    {
                        XiaoCai.WinformUI.Panels.PanelW panel = PanderPanelListW.Parent as XiaoCai.WinformUI.Panels.PanelW;
                        PanderPanelW parentPanderPanelW       = PanderPanelListW.Parent as PanderPanelW;
                        if (((panel != null) && (panel.Padding == new Padding(0))) ||
                            ((parentPanderPanelW != null) && (parentPanderPanelW.Padding == new Padding(0))))
                        {
                            //Left vertical borderline
                            graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness);
                            if (PanderPanelW.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 (PanderPanelW.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(PanderPanelW.PanelColors.InnerBorderColor))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
Пример #2
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_PanderPanelW != null) && (this.m_PanderPanelW.Expand == false))
     {
         PanderPanelListW PanderPanelListW = this.m_PanderPanelW.Parent as PanderPanelListW;
         if (PanderPanelListW != null)
         {
             PanderPanelListW.Expand(this.m_PanderPanelW);
             this.m_PanderPanelW.Invalidate(false);
         }
     }
     return(true);            // indicating we processed this event.
 }
		internal PanderPanelWCollection(PanderPanelListW PanderPanelListW)
        {
            this.m_PanderPanelListW = PanderPanelListW;
			this.m_controlCollection = this.m_PanderPanelListW.Controls;
        }
Пример #4
0
        private static void DrawBorders(Graphics graphics, PanderPanelW PanderPanelW)
        {
            if (PanderPanelW.ShowBorder == true)
            {
                using (GraphicsPath graphicsPath = new GraphicsPath())
                {
                    using (Pen borderPen = new Pen(PanderPanelW.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        Rectangle captionRectangle = PanderPanelW.CaptionRectangle;
                        Rectangle borderRectangle  = captionRectangle;

                        if (PanderPanelW.Expand == true)
                        {
                            borderRectangle = PanderPanelW.ClientRectangle;

                            graphics.DrawLine(
                                borderPen,
                                captionRectangle.Left,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness,
                                captionRectangle.Left + captionRectangle.Width,
                                captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness);
                        }

                        PanderPanelListW PanderPanelListW = PanderPanelW.Parent as PanderPanelListW;
                        if ((PanderPanelListW != null) && (PanderPanelListW.Dock == DockStyle.Fill))
                        {
                            XiaoCai.WinformUI.Panels.PanelW panel = PanderPanelListW.Parent as XiaoCai.WinformUI.Panels.PanelW;
                            PanderPanelW parentPanderPanelW       = PanderPanelListW.Parent as PanderPanelW;
                            if (((panel != null) && (panel.Padding == new Padding(0))) ||
                                ((parentPanderPanelW != null) && (parentPanderPanelW.Padding == new Padding(0))))
                            {
                                if (PanderPanelW.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 PanderPanelW
                                if (PanderPanelW.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 PanderPanelW
                            if (PanderPanelW.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(PanderPanelW.PanelColors.BorderColor, Constants.BorderThickness))
                    {
                        graphics.DrawPath(borderPen, graphicsPath);
                    }
                }
            }
        }
		/// <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_PanderPanelListW = (PanderPanelListW)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_PanderPanelListW.AutoScroll = false;
        }