예제 #1
0
파일: JMComboBox.cs 프로젝트: jxj050928/Kim
        internal void RenderScrollBarArrowInternal(
            Graphics g,
            Rectangle rect,
            Color baseColor,
            Color borderColor,
            Color innerBorderColor,
            Color arrowColor,
            RoundStyle roundStyle,
            bool drawBorder,
            bool drawGlass,
            ArrowDirection arrowDirection,
            LinearGradientMode mode)
        {
            ControlPaintClass.RenderBackgroundInternal(
                g,
                rect,
                baseColor,
                borderColor,
                innerBorderColor,
                roundStyle,
                0,
                .45F,
                drawBorder,
                drawGlass,
                mode);

            using (SolidBrush brush = new SolidBrush(arrowColor))
            {
                RenderArrowInternal(
                    g,
                    rect,
                    arrowDirection,
                    brush);
            }
        }
예제 #2
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            base.OnPaint(e);
            rects = new List <Rectangle>();
            //Rectangle rec = new Rectangle(Width - 40, (CaptionHeight - 15) / 2, 35, 15);
            //GraphicsPath fk = GetGraphicPath.CreatePath(rec, 4, RoundStyle.All, false);
            //e.Graphics.DrawPath(new Pen(Color.Gray), fk);

            if (_ZDownVisible)
            {
                Rectangle rec = new Rectangle(Width - 20, (CaptionHeight - 15) / 2, 17, 15);
                if (_cstate == ControlState.Pressed)
                {
                    GraphicsPath fk = GetGraphicPath.CreatePath(rec, 4, RoundStyle.All, false);
                    e.Graphics.DrawPath(new Pen(Color.Gray), fk);
                }
                ControlPaintClass.RenderArrowInternal(e.Graphics, rec, _isExplan ? ArrowDirection.Up : ArrowDirection.Down, new SolidBrush(Color.Black));
                rects.Add(rec);
            }

            if (_ZImageVisible)
            {
                Rectangle rec1 = new Rectangle(Width - 35, (CaptionHeight - 10) / 2, 10, 10);
                if (_cstate == ControlState.Hover)
                {
                    Rectangle    rec11 = new Rectangle(Width - 40, (CaptionHeight - 15) / 2, 20, 15);
                    GraphicsPath fk    = GetGraphicPath.CreatePath(rec11, 4, RoundStyle.All, false);
                    e.Graphics.DrawPath(new Pen(Color.Gray), fk);
                }
                e.Graphics.DrawImage(Zcl, rec1);
                rects.Add(rec1);
            }
        }
예제 #3
0
 protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
 {
     base.OnPaint(e);
     ControlPaintClass.RenderArrowInternal(e.Graphics, e.ClipRectangle, ZADirection, new System.Drawing.SolidBrush(Color.Black));
     //ControlPaintClass.RenderArrowInternal(e.Graphics, e.ClipRectangle, ArrowDirection.Down, new System.Drawing.SolidBrush(Color.Black));
 }
예제 #4
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (base.Panel1Collapsed || base.Panel2Collapsed)
            {
                return;
            }

            Graphics  g    = e.Graphics;
            Rectangle rect = base.SplitterRectangle;

            if (rect.Width <= 0 || rect.Height <= 0)
            {
                return;
            }

            bool bHorizontal = base.Orientation == Orientation.Horizontal;

            LinearGradientMode gradientMode = bHorizontal ?
                                              LinearGradientMode.Vertical : LinearGradientMode.Horizontal;

            using (LinearGradientBrush brush = new LinearGradientBrush(
                       rect, ColorClass.GetColor(_zBaseColor, 0, 100, 35, 0),
                       _zBaseColor, gradientMode))//Color.FromArgb(105, 200, 254)
            {
                Blend blend = new Blend();
                blend.Positions = new float[] { 0f, .5f, 1f };
                blend.Factors   = new float[] { .5F, 1F, .5F };

                brush.Blend = blend;
                g.FillRectangle(brush, rect);
            }

            if (_collapsePanel == CollapsePanel.None)
            {
                return;
            }

            Rectangle arrowRect;
            Rectangle topLeftRect;
            Rectangle bottomRightRect;

            CalculateRect(
                CollapseRect,
                out arrowRect,
                out topLeftRect,
                out bottomRightRect);

            ArrowDirection direction = ArrowDirection.Left;

            switch (_collapsePanel)
            {
            case CollapsePanel.Panel1:
                if (bHorizontal)
                {
                    direction =
                        _spliterPanelState == SpliterPanelState.Collapsed ?
                        ArrowDirection.Down : ArrowDirection.Up;
                }
                else
                {
                    direction =
                        _spliterPanelState == SpliterPanelState.Collapsed ?
                        ArrowDirection.Right : ArrowDirection.Left;
                }
                break;

            case CollapsePanel.Panel2:
                if (bHorizontal)
                {
                    direction =
                        _spliterPanelState == SpliterPanelState.Collapsed ?
                        ArrowDirection.Up : ArrowDirection.Down;
                }
                else
                {
                    direction =
                        _spliterPanelState == SpliterPanelState.Collapsed ?
                        ArrowDirection.Left : ArrowDirection.Right;
                }
                break;
            }

            Color foreColor = _mouseState == ControlState.Hover ?
                              _zArrowColor : ColorClass.GetColor(_zArrowColor, 0, 60, 70, 90);

            using (SmoothingModeGraphics sg = new SmoothingModeGraphics(g))
            {
                ControlPaintClass.RenderGrid(g, topLeftRect, new Size(3, 3), foreColor);
                ControlPaintClass.RenderGrid(g, bottomRightRect, new Size(3, 3), foreColor);

                using (Brush brush = new SolidBrush(foreColor))
                {
                    ControlPaintClass.RenderArrowInternal(
                        g,
                        arrowRect,
                        direction,
                        brush);
                }
            }
        }