Bläddra i källkod

make linestyle visible as a property from within atshapelinebgra

dmarceau 1 år sedan
förälder
incheckning
f95adc31d0
1 ändrade filer med 14 tillägg och 0 borttagningar
  1. 14 0
      atshapelinebgra.pas

+ 14 - 0
atshapelinebgra.pas

@@ -39,6 +39,7 @@ type
     FLineWidth: integer;
     FLineWidth: integer;
     FLineColor: TColor;
     FLineColor: TColor;
     FArrowColor: TColor;
     FArrowColor: TColor;
+    FLineStyle: TPenStyle;
 
 
     procedure SetArrowColor(AValue: TColor);
     procedure SetArrowColor(AValue: TColor);
     procedure SetLineColor(AValue: TColor);
     procedure SetLineColor(AValue: TColor);
@@ -47,6 +48,7 @@ type
     procedure SetArrow2(Value: Boolean);
     procedure SetArrow2(Value: Boolean);
     procedure SetArrowFactor(Value: integer);
     procedure SetArrowFactor(Value: integer);
     procedure SetLineWidth(AValue: Integer);
     procedure SetLineWidth(AValue: Integer);
+    procedure SetLineStyle(aLineStyle: TPenStyle);
   protected
   protected
     { Protected declarations }
     { Protected declarations }
     procedure Paint; override;
     procedure Paint; override;
@@ -71,6 +73,7 @@ type
     property LineColor: TColor read FLineColor write SetLineColor;
     property LineColor: TColor read FLineColor write SetLineColor;
     property ArrowColor: TColor read FArrowColor write SetArrowColor;
     property ArrowColor: TColor read FArrowColor write SetArrowColor;
     property LineWidth: Integer read FLineWidth write SetLineWidth;
     property LineWidth: Integer read FLineWidth write SetLineWidth;
+    property LineStyle: TPenStyle read FLineStyle write SetLineStyle default psSolid;
     property Arrow1: Boolean read FArrow1 write SetArrow1 default False;
     property Arrow1: Boolean read FArrow1 write SetArrow1 default False;
     property Arrow2: Boolean read FArrow2 write SetArrow2 default False;
     property Arrow2: Boolean read FArrow2 write SetArrow2 default False;
     property ArrowFactor: Integer read FArrowFactor write SetArrowFactor default 8;
     property ArrowFactor: Integer read FArrowFactor write SetArrowFactor default 8;
@@ -110,6 +113,7 @@ begin
   FArrowColor:=clBlack;
   FArrowColor:=clBlack;
   FLineColor:=clBlack;
   FLineColor:=clBlack;
   FLineWidth:=1;
   FLineWidth:=1;
+  FLineStyle:=psSolid;
   FLineDir:=drLeftRight;
   FLineDir:=drLeftRight;
 end;
 end;
 
 
@@ -151,6 +155,15 @@ begin
   end;
   end;
 end;
 end;
 
 
+procedure TShapeLineBGRA.SetLineStyle(aLineStyle: TPenStyle);
+begin
+  if aLineStyle <> FLineStyle then
+  begin
+    FLineStyle := aLineStyle;
+    Invalidate;
+  end;
+end;
+
 procedure TShapeLineBGRA.SetLineColor(AValue: TColor);
 procedure TShapeLineBGRA.SetLineColor(AValue: TColor);
 begin
 begin
   if AValue <> FLineColor then
   if AValue <> FLineColor then
@@ -192,6 +205,7 @@ begin
   bgra.CanvasBGRA.Pen.Color:= FLineColor;
   bgra.CanvasBGRA.Pen.Color:= FLineColor;
   bgra.CanvasBGRA.Brush.Color:=FArrowColor;
   bgra.CanvasBGRA.Brush.Color:=FArrowColor;
   bgra.CanvasBGRA.Pen.Width:=FLineWidth;
   bgra.CanvasBGRA.Pen.Width:=FLineWidth;
+  bgra.CanvasBGRA.Pen.Style:=FLineStyle;
 
 
   case FLineDir of
   case FLineDir of
     drLeftRight:
     drLeftRight: