Aggregates information needed for rendering drag and drop indicators.
コード例 #1
0
        /// <summary>
        /// Initialize a new instance of the DropDockingIndicatorsSquare class.
        /// </summary>
        /// <param name="paletteDragDrop">Drawing palette.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="showLeft">Show left hot area.</param>
        /// <param name="showRight">Show right hot area.</param>
        /// <param name="showTop">Show top hot area.</param>
        /// <param name="showBottom">Show bottom hot area.</param>
        /// <param name="showMiddle">Show middle hot area.</param>
        public DropDockingIndicatorsSquare(IPaletteDragDrop paletteDragDrop, 
                                           IRenderer renderer,
							               bool showLeft, bool showRight,
							               bool showTop, bool showBottom,
                                           bool showMiddle)
        {
            _paletteDragDrop = paletteDragDrop;
            _renderer = renderer;

            // Initialize the drag data that indicators which docking indicators are needed
            _dragData = new RenderDragDockingData(showLeft, showRight, showTop, showBottom, showMiddle);

            // Ask the renderer to measure the sizing of the indicators that are displayed
            _renderer.RenderGlyph.MeasureDragDropDockingGlyph(_dragData, _paletteDragDrop, PaletteDragFeedback.Square);

            // Setup window so that it is transparent to the Silver color and does not have any borders etc...
            BackColor = Color.Silver;
            ClientSize = _dragData.DockWindowSize;
            ControlBox = false;
            FormBorderStyle = FormBorderStyle.None;
            Location = new Point(100, 200);
            MaximizeBox = false;
            MinimizeBox = false;
            MinimumSize = Size.Empty;
            Name = "DropIndicators";
            ShowInTaskbar = false;
            SizeGripStyle = SizeGripStyle.Hide;
            StartPosition = FormStartPosition.Manual;
            Text = "DropIndicators";
            TransparencyKey = System.Drawing.Color.Silver;
            Paint += new PaintEventHandler(DropIndicators_Paint);
        }
コード例 #2
0
        /// <summary>
        /// Initialize a new instance of the DropDockingIndicatorsRounded class.
        /// </summary>
        /// <param name="paletteDragDrop">Drawing palette.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="showLeft">Show left hot area.</param>
        /// <param name="showRight">Show right hot area.</param>
        /// <param name="showTop">Show top hot area.</param>
        /// <param name="showBottom">Show bottom hot area.</param>
        /// <param name="showMiddle">Show middle hot area.</param>
        public DropDockingIndicatorsRounded(IPaletteDragDrop paletteDragDrop, 
                                            IRenderer renderer,
							                bool showLeft, bool showRight,
							                bool showTop, bool showBottom,
                                            bool showMiddle)
        {
            _paletteDragDrop = paletteDragDrop;
            _renderer = renderer;

            // Initialize the drag data that indicators which docking indicators are needed
            _dragData = new RenderDragDockingData(showLeft, showRight, showTop, showBottom, showMiddle);

            // Ask the renderer to measure the sizing of the indicators that are displayed
            _renderer.RenderGlyph.MeasureDragDropDockingGlyph(_dragData, _paletteDragDrop, PaletteDragFeedback.Rounded);
            _showRect = new Rectangle(Point.Empty, _dragData.DockWindowSize);

            // Any old title will do as it will not be shown
            CreateParams cp = new CreateParams();
            cp.Caption = "DropDockingIndicatorsRounded";

            // Define the screen position/size
            cp.X = _showRect.X;
            cp.Y = _showRect.Y;
            cp.Height = _showRect.Width;
            cp.Width = _showRect.Height;

            // As a top-level window it has no parent
            cp.Parent = IntPtr.Zero;

            // Appear as a top-level window
            cp.Style = unchecked((int)(uint)PI.WS_POPUP);

            // Set styles so that it does not have a caption bar and is above all other
            // windows in the ZOrder, i.e. TOPMOST
            cp.ExStyle = (int)PI.WS_EX_TOPMOST +
                         (int)PI.WS_EX_TOOLWINDOW;

            // We are going to use per-pixrl alpha blending and so need a layered window
            cp.ExStyle += (int)PI.WS_EX_LAYERED;

            // Create the actual window
            this.CreateHandle(cp);
        }
コード例 #3
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        /// <summary>
        /// Draw a solid area glyph suitable for a drag drop area.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="dragData">Set of drag docking data.</param>
        /// <param name="dragDropPalette">Palette source of drawing values.</param>
        /// <param name="feedback">Feedback requested.</param>
        public override void DrawDragDropDockingGlyph(RenderContext context,
                                                      RenderDragDockingData dragData,
                                                      IPaletteDragDrop dragDropPalette,
                                                      PaletteDragFeedback feedback)
        {
            Debug.Assert(context != null);
            Debug.Assert(dragData != null);
            Debug.Assert(dragDropPalette != null);

            if (feedback == PaletteDragFeedback.Rounded)
                DrawDragDockingRounded(context, dragData, dragDropPalette);
            else
                DrawDragDockingSquares(context, dragData, dragDropPalette);
        }
コード例 #4
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        /// <summary>
        /// Measure the drag and drop docking glyphs.
        /// </summary>
        /// <param name="dragData">Set of drag docking data.</param>
        /// <param name="dragDropPalette">Palette source of drawing values.</param>
        /// <param name="feedback">Feedback requested.</param>
        public override void MeasureDragDropDockingGlyph(RenderDragDockingData dragData,
                                                         IPaletteDragDrop dragDropPalette,
                                                         PaletteDragFeedback feedback)
        {
            Debug.Assert(dragData != null);
            Debug.Assert(dragDropPalette != null);

            if (feedback == PaletteDragFeedback.Rounded)
                MeasureDragDockingRounded(dragData, dragDropPalette);
            else
                MeasureDragDockingSquares(dragData, dragDropPalette);
        }
コード例 #5
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void MeasureDragDockingSquares(RenderDragDockingData dragData,
                                               IPaletteDragDrop dragDropPalette)
        {
            dragData.DockWindowSize = new Size(88, 88);

            if (dragData.ShowMiddle)
            {
                dragData.RectLeft = new Rectangle(0, 29, 29, 29);
                dragData.RectRight = new Rectangle(59, 29, 29, 29);
                dragData.RectTop = new Rectangle(29, 0, 29, 29);
                dragData.RectBottom = new Rectangle(29, 59, 29, 29);
                dragData.RectMiddle = new Rectangle(23, 23, 40, 40);
            }
            else
            {
                dragData.RectLeft = new Rectangle(0, 29, 32, 29);
                dragData.RectRight = new Rectangle(56, 29, 32, 29);
                dragData.RectTop = new Rectangle(29, 0, 29, 32);
                dragData.RectBottom = new Rectangle(29, 56, 29, 31);
            }
        }
コード例 #6
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
 private void MeasureDragDockingRounded(RenderDragDockingData dragData,
                                        IPaletteDragDrop dragDropPalette)
 {
     dragData.DockWindowSize = new Size(103, 103);
     dragData.RectLeft = new Rectangle(0, 36, 32, 31);
     dragData.RectRight = new Rectangle(71, 36, 32, 31);
     dragData.RectTop = new Rectangle(36, 0, 31, 32);
     dragData.RectBottom = new Rectangle(36, 71, 31, 32);
     dragData.RectMiddle = new Rectangle(36, 36, 31, 31);
 }
コード例 #7
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingSquaresTop(Graphics g,
                                               Color activeColor,
                                               Color inactiveColor,
                                               RenderDragDockingData dragData)
        {
            Color borderColour = ControlPaint.Dark(activeColor);

            // Draw border around the window square
            using (Pen borderPen = new Pen(borderColour),
                       dashPen = new Pen(borderColour),
                       shadow1Pen = new Pen(_190),
                       shadow2Pen = new Pen(_218))
            {
                // Draw the caption area at top of window
                using (LinearGradientBrush middleBrush = new LinearGradientBrush(new Rectangle(33, 5, 20, 1), ControlPaint.LightLight(inactiveColor), activeColor, 0f),
                                           bottomBrush = new LinearGradientBrush(new Rectangle(33, 6, 20, 1), ControlPaint.Light(activeColor), activeColor, 0f),
                                           positionBrush = new LinearGradientBrush(new Rectangle(34, 6, 19, 10), Color.FromArgb(160, inactiveColor), Color.FromArgb(64, inactiveColor), 90f),
                                           arrowBrush = new LinearGradientBrush(new Rectangle(39, 40, 8, 4), borderColour, Color.FromArgb(175, borderColour), 90f))
                {
                    // Draw border
                    g.DrawLine(borderPen, 33, 4, 53, 4);
                    g.DrawLine(borderPen, 53, 4, 53, 27);
                    g.DrawLine(borderPen, 53, 27, 33, 27);
                    g.DrawLine(borderPen, 33, 27, 33, 4);

                    // Draw shadows around right and bottom edges
                    g.DrawLine(shadow1Pen, 34, 28, 54, 28);
                    g.DrawLine(shadow1Pen, 54, 5, 54, 28);
                    g.DrawLine(shadow2Pen, 35, 29, 55, 29);
                    g.DrawLine(shadow2Pen, 55, 6, 55, 29);

                    // Draw the caption area
                    g.FillRectangle(middleBrush, 34, 5, 19, 1);
                    g.FillRectangle(bottomBrush, 34, 6, 19, 1);

                    // Draw client area
                    g.FillRectangle(SystemBrushes.Window, 34, 7, 19, 20);

                    // Draw docking edge indicator
                    g.FillRectangle(positionBrush, 34, 7, 19, 9);

                    // Draw a dashed line down the middle
                    dashPen.DashStyle = DashStyle.Dot;
                    g.DrawLine(dashPen, 35, 15, 53, 15);

                    // Draw the direction arrow
                    g.FillPolygon(arrowBrush, new Point[] { new Point(43, 18), new Point(47, 23), new Point(39, 23), new Point(43, 18) });

                    // If active, then draw highlighted border
                    if (dragData.ActiveTop)
                    {
                        g.DrawLine(borderPen, 29, 0, 29, 23);
                        g.DrawLine(borderPen, 57, 0, 57, 23);
                        g.DrawLine(borderPen, 29, 0, 57, 0);
                    }
                }
            }
        }
コード例 #8
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingSquaresRight(Graphics g,
                                                 Color activeColor,
                                                 Color inactiveColor,
                                                 RenderDragDockingData dragData)
        {
            Color borderColour = ControlPaint.Dark(activeColor);

            // Draw border around the window square
            using (Pen borderPen = new Pen(borderColour),
                       dashPen = new Pen(borderColour),
                       shadow1Pen = new Pen(_190),
                       shadow2Pen = new Pen(_218))
            {
                // Draw the caption area at top of window
                using (LinearGradientBrush middleBrush = new LinearGradientBrush(new Rectangle(60, 33, 23, 1), ControlPaint.LightLight(inactiveColor), activeColor, 0f),
                                           bottomBrush = new LinearGradientBrush(new Rectangle(60, 34, 23, 1), ControlPaint.Light(activeColor), activeColor, 0f),
                                           positionBrush = new LinearGradientBrush(new Rectangle(71, 35, 11, 1), Color.FromArgb(160, inactiveColor), Color.FromArgb(64, inactiveColor), 180f),
                                           arrowBrush = new LinearGradientBrush(new Rectangle(68, 40, 5, 8), borderColour, Color.FromArgb(175, borderColour), 180f))
                {
                    // Draw border
                    g.DrawLine(borderPen, 60, 33, 60, 53);
                    g.DrawLine(borderPen, 83, 33, 83, 53);
                    g.DrawLine(borderPen, 60, 53, 83, 53);
                    g.DrawLine(borderPen, 60, 33, 83, 33);

                    // Draw shadows around right and bottom edges
                    g.DrawLine(shadow1Pen, 61, 54, 84, 54);
                    g.DrawLine(shadow1Pen, 84, 34, 84, 54);
                    g.DrawLine(shadow2Pen, 62, 55, 85, 55);
                    g.DrawLine(shadow2Pen, 85, 35, 85, 55);

                    // Draw the caption area
                    g.FillRectangle(middleBrush, 61, 34, 22, 1);
                    g.FillRectangle(bottomBrush, 61, 35, 22, 1);

                    // Draw client area
                    g.FillRectangle(SystemBrushes.Window, 61, 36, 22, 17);

                    // Draw docking edge indicator
                    g.FillRectangle(positionBrush, 72, 36, 11, 17);

                    // Draw a dashed line down the middle
                    dashPen.DashStyle = DashStyle.Dot;
                    g.DrawLine(dashPen, 72, 37, 72, 52);

                    // Draw the direction arrow
                    g.FillPolygon(arrowBrush, new Point[] { new Point(69, 44), new Point(65, 40), new Point(65, 48), new Point(69, 44) });

                    // If active, then draw highlighted border
                    if (dragData.ActiveRight)
                    {
                        g.DrawLine(borderPen, 87, 29, 63, 29);
                        g.DrawLine(borderPen, 87, 57, 63, 57);
                        g.DrawLine(borderPen, 87, 29, 87, 57);
                    }
                }
            }
        }
コード例 #9
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingSquaresBackground(Graphics g, 
                                                      Color inside, 
                                                      Color border,
                                                      RenderDragDockingData dragData)
        {
            Color start = Color.FromArgb(190, 190, 190);
            using (Pen borderPen = new Pen(border))
            {
                using (SolidBrush insideBrush = new SolidBrush(inside))
                {
                    using (LinearGradientBrush gradientLL = new LinearGradientBrush(new Rectangle(-1, -1, 5, 5), start, inside, 0f),
                                               gradientTL = new LinearGradientBrush(new Rectangle(-1, 23, 5, 5), start, inside, 90f),
                                               gradientCC = new LinearGradientBrush(new Rectangle(24, 25, 5, 5), start, inside, 45f),
                                               gradientLT = new LinearGradientBrush(new Rectangle(28, -1, 5, 5), start, inside, 0f),
                                               gradientML = new LinearGradientBrush(new Rectangle(22, -1, 5, 5), start, inside, 0f),
                                               gradientMT = new LinearGradientBrush(new Rectangle(-1, 22, 5, 5), start, inside, 90f),
                                               gradientTT = new LinearGradientBrush(new Rectangle(-1, -1, 5, 5), start, inside, 90f))
                    {
                        // Draw all the background cross?
                        if (dragData.ShowBack)
                        {
                            // Create points for a polygon
                            Point[] pts = new Point[]{new Point(0,  29), new Point(23, 29),
                                                      new Point(29, 23), new Point(29, 0),
                                                      new Point(57, 0),  new Point(57, 23),
                                                      new Point(63, 29), new Point(87, 29),
                                                      new Point(87, 57), new Point(63, 57),
                                                      new Point(57, 63), new Point(57, 87),
                                                      new Point(29, 87), new Point(29, 63),
                                                      new Point(23, 57), new Point(0,  57)};

                            // Fill this area with a solid colour
                            g.FillPolygon(insideBrush, pts);

                            // Draw shadow at some of the box edges
                            g.FillPolygon(gradientLL, new Point[] { new Point(1, 57), new Point(1, 30), new Point(4, 33), new Point(4, 57) });
                            g.FillPolygon(gradientTL, new Point[] { new Point(1, 30), new Point(25, 30), new Point(27, 33), new Point(3, 33) });
                            g.FillPolygon(gradientCC, new Point[] { new Point(23, 30), new Point(30, 23), new Point(33, 26), new Point(26, 33) });
                            g.FillPolygon(gradientLT, new Point[] { new Point(30, 1), new Point(30, 24), new Point(33, 26), new Point(33, 4) });
                            g.FillPolygon(gradientTT, new Point[] { new Point(30, 1), new Point(57, 1), new Point(57, 4), new Point(33, 4) });
                            g.FillPolygon(gradientLT, new Point[] { new Point(30, 63), new Point(30, 87), new Point(33, 87), new Point(33, 66) });
                            g.FillPolygon(gradientTL, new Point[] { new Point(63, 30), new Point(87, 30), new Point(87, 33), new Point(66, 33) });

                            // Draw outline in darker colour
                            g.DrawPolygon(borderPen, pts);
                        }
                        else if (dragData.ShowLeft && dragData.ShowRight)
                        {
                            // Create points for a polygon
                            Point[] pts = new Point[]{new Point(0,  29), new Point(23, 29),
                                                      new Point(29, 23), new Point(57, 23),
                                                      new Point(63, 29), new Point(87, 29),
                                                      new Point(87, 57), new Point(63, 57),
                                                      new Point(57, 63), new Point(29, 63),
                                                      new Point(23, 57), new Point(0,  57)};

                            // Fill this area with a solid colour
                            g.FillPolygon(insideBrush, pts);

                            // Draw shadow at some of the box edges
                            g.FillPolygon(gradientLL, new Point[] { new Point(1, 57), new Point(1, 30), new Point(4, 33), new Point(4, 57) });
                            g.FillPolygon(gradientTL, new Point[] { new Point(1, 30), new Point(25, 30), new Point(27, 33), new Point(3, 33) });
                            g.FillPolygon(gradientCC, new Point[] { new Point(23, 30), new Point(30, 23), new Point(33, 26), new Point(26, 33) });
                            g.FillPolygon(gradientMT, new Point[] { new Point(30, 24), new Point(57, 24), new Point(60, 27), new Point(33, 27) });
                            g.FillPolygon(gradientTL, new Point[] { new Point(63, 30), new Point(87, 30), new Point(87, 33), new Point(66, 33) });

                            // Draw outline in darker colour
                            g.DrawPolygon(borderPen, pts);
                        }
                        else if (dragData.ShowLeft)
                        {
                            // Only draw the background for the left square
                            g.FillRectangle(insideBrush, 0, 29, 31, 28);
                            g.DrawRectangle(borderPen, 0, 29, 31, 28);
                        }
                        else if (dragData.ShowRight)
                        {
                            // Only draw the background for the right square
                            g.FillRectangle(insideBrush, 56, 29, 31, 28);
                            g.DrawRectangle(borderPen, 56, 29, 31, 28);
                        }
                        else if (dragData.ShowTop && dragData.ShowBottom)
                        {
                            // Create points for a polygon
                            Point[] pts = new Point[]{new Point(23, 29), new Point(29, 23),
                                                      new Point(29, 0),  new Point(57, 0),
                                                      new Point(57, 23), new Point(63, 29),
                                                      new Point(63, 57), new Point(57, 63),
                                                      new Point(57, 87), new Point(29, 87),
                                                      new Point(29, 63), new Point(23, 57)};

                            // Fill this area with a solid colour
                            g.FillPolygon(insideBrush, pts);

                            g.FillPolygon(gradientLT, new Point[] { new Point(30, 1), new Point(30, 24), new Point(33, 26), new Point(33, 4) });
                            g.FillPolygon(gradientTT, new Point[] { new Point(30, 1), new Point(57, 1), new Point(57, 4), new Point(33, 4) });
                            g.FillPolygon(gradientCC, new Point[] { new Point(23, 30), new Point(30, 23), new Point(33, 26), new Point(26, 33) });
                            g.FillPolygon(gradientML, new Point[] { new Point(24, 57), new Point(24, 30), new Point(27, 33), new Point(27, 60) });
                            g.FillPolygon(gradientLT, new Point[] { new Point(30, 63), new Point(30, 87), new Point(33, 87), new Point(33, 66) });

                            // Draw outline in darker colour
                            g.DrawPolygon(borderPen, pts);
                        }
                        else if (dragData.ShowTop)
                        {
                            // Only draw the background for the top square
                            g.FillRectangle(insideBrush, 29, 0, 28, 31);
                            g.DrawRectangle(borderPen, 29, 0, 28, 31);
                        }
                        else if (dragData.ShowBottom)
                        {
                            // Only draw the background for the bottom square
                            g.FillRectangle(insideBrush, 29, 56, 28, 31);
                            g.DrawRectangle(borderPen, 29, 56, 28, 31);
                        }
                        else if (dragData.ShowMiddle)
                        {
                            // Only draw the background for the middle square
                            Point[] pts = new Point[]{new Point(23, 29), new Point(29, 23),
                                                      new Point(57, 23), new Point(63, 29),
                                                      new Point(63, 57), new Point(57, 63),
                                                      new Point(29, 63), new Point(23, 57)};

                            g.FillPolygon(insideBrush, pts);
                            g.DrawPolygon(borderPen, pts);
                        }
                    }
                }
            }
        }
コード例 #10
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingSquares(RenderContext context,
                                            RenderDragDockingData dragData,
                                            IPaletteDragDrop dragDropPalette)
        {
            Color back = dragDropPalette.GetDragDropDockBack();
            Color border = dragDropPalette.GetDragDropDockBorder();
            Color active = dragDropPalette.GetDragDropDockActive();
            Color inactive = dragDropPalette.GetDragDropDockInactive();

            DrawDragDockingSquaresBackground(context.Graphics, back, border, dragData);
            if (dragData.ShowLeft) DrawDragDockingSquaresLeft(context.Graphics, active, inactive, dragData);
            if (dragData.ShowRight) DrawDragDockingSquaresRight(context.Graphics, active, inactive, dragData);
            if (dragData.ShowTop) DrawDragDockingSquaresTop(context.Graphics, active, inactive, dragData);
            if (dragData.ShowBottom) DrawDragDockingSquaresBottom(context.Graphics, active, inactive, dragData);
            if (dragData.ShowMiddle) DrawDragDockingSquaresMiddle(context.Graphics, active, inactive, dragData);
        }
コード例 #11
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
 private void DrawDragDockingRoundedTop(RenderContext context,
                                        Color inside, Color border,
                                        Color active, Color inactive,
                                        RenderDragDockingData dragData)
 {
     DrawDragDockingRoundedRect(context, (dragData.ActiveTop ? active : inside), (dragData.ActiveTop ? active : border), dragData.RectTop, 3);
     DrawDragDockingArrow(context, active, dragData.RectTop, VisualOrientation.Top);
 }
コード例 #12
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingRoundedMiddle(RenderContext context,
                                                  Color inside, Color border,
                                                  Color active, Color inactive,
                                                  RenderDragDockingData dragData)
        {
            Color borderColor = (dragData.ActiveMiddle ? active : border);
            Color insideColor = (dragData.ActiveMiddle ? active : inside);
            using (AntiAlias aa = new AntiAlias(context.Graphics))
            {
                using (GraphicsPath borderPath = new GraphicsPath(),
                                    insidePath = new GraphicsPath())
                {
                    // Generate the graphics paths for the border and the inside area which is just inside the border
                    Rectangle rect = dragData.RectMiddle;
                    Rectangle rectInside = new Rectangle(rect.X + 2, rect.Y + 2, rect.Width - 4, rect.Height - 4);
                    DrawDragDockingMiddleLines(borderPath, dragData.RectMiddle, 13);
                    DrawDragDockingMiddleLines(insidePath, rectInside, 9);

                    // Fill the entire border area
                    using (SolidBrush borderBrush = new SolidBrush(Color.FromArgb(196, Color.White)))
                        context.Graphics.FillPath(borderBrush, borderPath);

                    // Fill with gradient the area inside the border
                    RectangleF rectBoundsF = new RectangleF(rect.X - 1, rect.Y - 1, rect.Width + 2, rect.Height + 2);
                    using (LinearGradientBrush insideBrush = new LinearGradientBrush(rectBoundsF, Color.FromArgb(196, Color.White), insideColor, 90))
                    {
                        insideBrush.Blend = _dragRoundedInsideBlend;
                        context.Graphics.FillPath(insideBrush, insidePath);
                    }

                    using (Pen borderPen = new Pen(borderColor))
                    {
                        // Finally draw the actual border
                        context.Graphics.DrawPath(borderPen, borderPath);

                        // Draw the two extra tabs
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 2, rect.Bottom - 3), new Point(rect.Right - 2, rect.Bottom - 2));
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 10, rect.Bottom - 3), new Point(rect.Right - 10, rect.Bottom - 2));
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 3, rect.Bottom - 1), new Point(rect.X + 9, rect.Bottom - 1));
                    }
                }
            }
        }
コード例 #13
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
 private void DrawDragDockingRoundedBottom(RenderContext context,
                                           Color inside, Color border,
                                           Color active, Color inactive,
                                           RenderDragDockingData dragData)
 {
     DrawDragDockingRoundedRect(context, (dragData.ActiveBottom ? active : inside), (dragData.ActiveBottom ? active : border), dragData.RectBottom, 3);
     DrawDragDockingArrow(context, active, dragData.RectBottom, VisualOrientation.Bottom);
 }
コード例 #14
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
 private void DrawDragDockingRoundedBackground(RenderContext context,
                                               Color inside,
                                               Color border,
                                               RenderDragDockingData dragData)
 {
     if (dragData.ShowBack)
         DrawDragDockingRoundedRect(context, inside, border, new Rectangle(16, 16, 73, 73), 11);
 }
コード例 #15
0
ファイル: RenderBase.cs プロジェクト: Cocotteseb/Krypton
 /// <summary>
 /// Draw a solid area glyph suitable for a drag drop area.
 /// </summary>
 /// <param name="context">Render context.</param>
 /// <param name="dragData">Set of drag docking data.</param>
 /// <param name="dragDropPalette">Palette source of drawing values.</param>
 /// <param name="feedback">Feedback requested.</param>
 public abstract void DrawDragDropDockingGlyph(RenderContext context,
                                               RenderDragDockingData dragData,
                                               IPaletteDragDrop dragDropPalette,
                                               PaletteDragFeedback feedback);
コード例 #16
0
ファイル: RenderBase.cs プロジェクト: Cocotteseb/Krypton
 /// <summary>
 /// Measure the drag and drop docking glyphs.
 /// </summary>
 /// <param name="dragData">Set of drag docking data.</param>
 /// <param name="dragDropPalette">Palette source of drawing values.</param>
 /// <param name="feedback">Feedback requested.</param>
 public abstract void MeasureDragDropDockingGlyph(RenderDragDockingData dragData,
                                                  IPaletteDragDrop dragDropPalette,
                                                  PaletteDragFeedback feedback);
コード例 #17
0
ファイル: RenderStandard.cs プロジェクト: Cocotteseb/Krypton
        private void DrawDragDockingSquaresMiddle(Graphics g,
                                                  Color activeColor,
                                                  Color inactiveColor,
                                                  RenderDragDockingData dragData)
        {
            Color borderColour = ControlPaint.Dark(activeColor);

            // Draw border around the window square
            using (Pen borderPen = new Pen(borderColour),
                       dashPen = new Pen(borderColour),
                       shadow1Pen = new Pen(_190),
                       shadow2Pen = new Pen(_218))
            {
                // Draw the caption area at top of window
                using (LinearGradientBrush middleBrush = new LinearGradientBrush(new Rectangle(32, 34, 21, 1), ControlPaint.LightLight(inactiveColor), activeColor, 0f),
                                           bottomBrush = new LinearGradientBrush(new Rectangle(32, 35, 21, 1), ControlPaint.Light(activeColor), activeColor, 0f))
                {
                    // Draw border
                    g.DrawLine(borderPen, 32, 32, 54, 32);
                    g.DrawLine(borderPen, 32, 32, 32, 53);
                    g.DrawLine(borderPen, 32, 53, 33, 54);
                    g.DrawLine(borderPen, 33, 54, 41, 54);
                    g.DrawLine(borderPen, 41, 54, 42, 52);
                    g.DrawLine(borderPen, 42, 52, 42, 50);
                    g.DrawLine(borderPen, 42, 50, 54, 50);
                    g.DrawLine(borderPen, 54, 32, 54, 53);
                    g.DrawLine(borderPen, 54, 53, 53, 54);
                    g.DrawLine(borderPen, 53, 54, 49, 54);
                    g.DrawLine(borderPen, 49, 54, 48, 53);
                    g.DrawLine(borderPen, 48, 53, 48, 50);
                    g.DrawLine(borderPen, 48, 53, 47, 54);
                    g.DrawLine(borderPen, 47, 54, 43, 54);
                    g.DrawLine(borderPen, 43, 54, 42, 53);

                    // Draw the caption area
                    g.FillRectangle(middleBrush, 33, 33, 21, 1);
                    g.FillRectangle(bottomBrush, 33, 34, 21, 1);

                    // Draw the client area
                    g.FillRectangle(SystemBrushes.Window, 33, 35, 21, 15);
                    g.FillRectangle(SystemBrushes.Window, 33, 50, 9, 3);
                    g.FillRectangle(SystemBrushes.Window, 33, 53, 9, 1);
                    g.FillRectangle(SystemBrushes.Window, 43, 51, 5, 3);
                    g.FillRectangle(SystemBrushes.Window, 49, 51, 5, 3);

                    // Fill the inner indicator area
                    using (SolidBrush innerBrush = new SolidBrush(Color.FromArgb(64, inactiveColor)))
                    {
                        g.FillRectangle(innerBrush, 34, 36, 19, 13);
                        g.FillRectangle(innerBrush, 34, 49, 7, 3);
                        g.FillRectangle(innerBrush, 35, 52, 5, 1);
                    }

                    // Draw outline of the indicator area
                    dashPen.DashStyle = DashStyle.Dot;
                    g.DrawLine(dashPen, 34, 37, 34, 52);
                    g.DrawLine(dashPen, 35, 52, 40, 52);
                    g.DrawLine(dashPen, 40, 51, 40, 49);
                    g.DrawLine(dashPen, 40, 51, 40, 48);
                    g.DrawLine(dashPen, 41, 48, 53, 48);
                    g.DrawLine(dashPen, 52, 47, 52, 36);
                    g.DrawLine(dashPen, 35, 36, 52, 36);

                    // Draw right han side shadow
                    g.DrawLine(shadow1Pen, 55, 33, 55, 53);
                    g.DrawLine(shadow2Pen, 56, 34, 56, 53);
                    g.DrawLine(shadow1Pen, 33, 55, 53, 55);
                    g.DrawLine(shadow1Pen, 53, 55, 55, 53);
                    g.DrawLine(shadow2Pen, 34, 56, 53, 56);
                    g.DrawLine(shadow2Pen, 53, 56, 56, 53);
                }

                // If active, then draw highlighted border
                if (dragData.ActiveMiddle)
                {
                    g.DrawLine(borderPen, 23, 29, 29, 23);
                    g.DrawLine(borderPen, 57, 23, 63, 29);
                    g.DrawLine(borderPen, 63, 57, 57, 63);
                    g.DrawLine(borderPen, 23, 57, 29, 63);
                }
            }
        }