ComponentFactory.Krypton.Toolkit.RenderStandard.DrawDragDockingSquaresTop C# (CSharp) Method

DrawDragDockingSquaresTop() private method

private DrawDragDockingSquaresTop ( Graphics g, Color activeColor, Color inactiveColor, RenderDragDockingData dragData ) : void
g System.Drawing.Graphics
activeColor Color
inactiveColor Color
dragData RenderDragDockingData
return void
        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);
                    }
                }
            }
        }
RenderStandard