1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
6
using System.Drawing.Drawing2D;
10
public class CollapseShape : VectorShape
12
static LinearGradientBrush shade = new LinearGradientBrush(
13
new PointF(0, 0), new PointF(0, 22),
14
Color.White, Color.LightSteelBlue);
16
static PointF[] arrowPoints = new PointF[]{
17
new PointF(5.0f, 10.0f),
18
new PointF(11.0f, 4.0f),
19
new PointF(17.0f, 10.0f),
20
new PointF(16.0f, 12.0f),
21
new PointF(11.0f, 7.0f),
22
new PointF(6.0f, 12.0f)
25
static GraphicsPath roundedButton = InitializeButtonShape();
27
static GraphicsPath InitializeButtonShape()
29
GraphicsPath path = new GraphicsPath();
30
path.AddArc(3, 3, 3, 3, 180, 90);
31
path.AddArc(18, 3, 3, 3, 270, 90);
32
path.AddArc(18, 18, 3, 3, 0, 90);
33
path.AddArc(3, 18, 3, 3, 90, 90);
38
static protected void DrawButton (Graphics graphics)
40
if (graphics == null) return;
41
graphics.FillPath(shade, roundedButton);
42
graphics.DrawPath(Pens.SteelBlue, roundedButton);
45
static protected void DrawArrow (Graphics graphics)
47
if (graphics == null) return;
48
graphics.FillPolygon (Brushes.DarkBlue, arrowPoints);
51
public override void Draw(Graphics graphics)
53
if (graphics == null) return;
54
CollapseShape.DrawButton(graphics);
56
graphics.TranslateTransform(1, 1);
57
CollapseShape.DrawArrow(graphics);
58
graphics.TranslateTransform(0, 6);
59
CollapseShape.DrawArrow(graphics);
62
public override float ShapeWidth
67
public override float ShapeHeight