Selaa lähdekoodia

added back alpha and cursor orientation

Unknown 6 vuotta sitten
vanhempi
commit
313b03fda6
2 muutettua tiedostoa jossa 138 lisäystä ja 2 poistoa
  1. 117 2
      vectoredit/umain.lfm
  2. 21 0
      vectoredit/umain.pas

+ 117 - 2
vectoredit/umain.lfm

@@ -1,7 +1,7 @@
 object Form1: TForm1
-  Left = 531
+  Left = 530
   Height = 475
-  Top = 0
+  Top = 25
   Width = 627
   Caption = 'Vector Edit'
   ClientHeight = 475
@@ -416,6 +416,121 @@ object Form1: TForm1
       Width = 27
       OnMouseUp = ShapeBackColorMouseUp
     end
+    object UpDownBackAlpha: TBCTrackbarUpdown
+      Left = 413
+      Height = 25
+      Top = 8
+      Width = 48
+      BarExponent = 1
+      Increment = 1
+      LongTimeInterval = 400
+      MinValue = 0
+      MaxValue = 255
+      OnChange = UpDownBackAlphaChange
+      Value = 255
+      ShortTimeInterval = 100
+      Background.Color = clWindow
+      Background.ColorOpacity = 255
+      Background.Gradient1.StartColor = clWhite
+      Background.Gradient1.StartColorOpacity = 255
+      Background.Gradient1.DrawMode = dmSet
+      Background.Gradient1.EndColor = clBlack
+      Background.Gradient1.EndColorOpacity = 255
+      Background.Gradient1.ColorCorrection = True
+      Background.Gradient1.GradientType = gtLinear
+      Background.Gradient1.Point1XPercent = 0
+      Background.Gradient1.Point1YPercent = 0
+      Background.Gradient1.Point2XPercent = 0
+      Background.Gradient1.Point2YPercent = 100
+      Background.Gradient1.Sinus = False
+      Background.Gradient2.StartColor = clWhite
+      Background.Gradient2.StartColorOpacity = 255
+      Background.Gradient2.DrawMode = dmSet
+      Background.Gradient2.EndColor = clBlack
+      Background.Gradient2.EndColorOpacity = 255
+      Background.Gradient2.ColorCorrection = True
+      Background.Gradient2.GradientType = gtLinear
+      Background.Gradient2.Point1XPercent = 0
+      Background.Gradient2.Point1YPercent = 0
+      Background.Gradient2.Point2XPercent = 0
+      Background.Gradient2.Point2YPercent = 100
+      Background.Gradient2.Sinus = False
+      Background.Gradient1EndPercent = 35
+      Background.Style = bbsColor
+      ButtonBackground.Color = clBlack
+      ButtonBackground.ColorOpacity = 255
+      ButtonBackground.Gradient1.StartColor = clBtnShadow
+      ButtonBackground.Gradient1.StartColorOpacity = 255
+      ButtonBackground.Gradient1.DrawMode = dmSet
+      ButtonBackground.Gradient1.EndColor = clBtnFace
+      ButtonBackground.Gradient1.EndColorOpacity = 255
+      ButtonBackground.Gradient1.ColorCorrection = True
+      ButtonBackground.Gradient1.GradientType = gtLinear
+      ButtonBackground.Gradient1.Point1XPercent = 0
+      ButtonBackground.Gradient1.Point1YPercent = -50
+      ButtonBackground.Gradient1.Point2XPercent = 0
+      ButtonBackground.Gradient1.Point2YPercent = 50
+      ButtonBackground.Gradient1.Sinus = False
+      ButtonBackground.Gradient2.StartColor = clBtnFace
+      ButtonBackground.Gradient2.StartColorOpacity = 255
+      ButtonBackground.Gradient2.DrawMode = dmSet
+      ButtonBackground.Gradient2.EndColor = clBtnShadow
+      ButtonBackground.Gradient2.EndColorOpacity = 255
+      ButtonBackground.Gradient2.ColorCorrection = True
+      ButtonBackground.Gradient2.GradientType = gtLinear
+      ButtonBackground.Gradient2.Point1XPercent = 0
+      ButtonBackground.Gradient2.Point1YPercent = 50
+      ButtonBackground.Gradient2.Point2XPercent = 0
+      ButtonBackground.Gradient2.Point2YPercent = 150
+      ButtonBackground.Gradient2.Sinus = False
+      ButtonBackground.Gradient1EndPercent = 50
+      ButtonBackground.Style = bbsGradient
+      ButtonDownBackground.Color = clBtnShadow
+      ButtonDownBackground.ColorOpacity = 255
+      ButtonDownBackground.Gradient1.StartColor = clWhite
+      ButtonDownBackground.Gradient1.StartColorOpacity = 255
+      ButtonDownBackground.Gradient1.DrawMode = dmSet
+      ButtonDownBackground.Gradient1.EndColor = clBlack
+      ButtonDownBackground.Gradient1.EndColorOpacity = 255
+      ButtonDownBackground.Gradient1.ColorCorrection = True
+      ButtonDownBackground.Gradient1.GradientType = gtLinear
+      ButtonDownBackground.Gradient1.Point1XPercent = 0
+      ButtonDownBackground.Gradient1.Point1YPercent = 0
+      ButtonDownBackground.Gradient1.Point2XPercent = 0
+      ButtonDownBackground.Gradient1.Point2YPercent = 100
+      ButtonDownBackground.Gradient1.Sinus = False
+      ButtonDownBackground.Gradient2.StartColor = clWhite
+      ButtonDownBackground.Gradient2.StartColorOpacity = 255
+      ButtonDownBackground.Gradient2.DrawMode = dmSet
+      ButtonDownBackground.Gradient2.EndColor = clBlack
+      ButtonDownBackground.Gradient2.EndColorOpacity = 255
+      ButtonDownBackground.Gradient2.ColorCorrection = True
+      ButtonDownBackground.Gradient2.GradientType = gtLinear
+      ButtonDownBackground.Gradient2.Point1XPercent = 0
+      ButtonDownBackground.Gradient2.Point1YPercent = 0
+      ButtonDownBackground.Gradient2.Point2XPercent = 0
+      ButtonDownBackground.Gradient2.Point2YPercent = 100
+      ButtonDownBackground.Gradient2.Sinus = False
+      ButtonDownBackground.Gradient1EndPercent = 35
+      ButtonDownBackground.Style = bbsColor
+      Border.Color = clWindowText
+      Border.ColorOpacity = 255
+      Border.LightColor = clWhite
+      Border.LightOpacity = 255
+      Border.LightWidth = 0
+      Border.Style = bboSolid
+      Border.Width = 1
+      Rounding.RoundX = 1
+      Rounding.RoundY = 1
+      Rounding.RoundOptions = []
+      Font.Color = clWindowText
+      Font.Name = 'Arial'
+      HasTrackBar = True
+      ArrowColor = clBtnText
+      TabOrder = 4
+      TabStop = True
+      UseDockManager = False
+    end
   end
   object ColorDialog1: TColorDialog
     Color = clBlack

+ 21 - 0
vectoredit/umain.pas

@@ -51,6 +51,7 @@ type
     ToolButtonRectangle: TToolButton;
     ToolButtonEllipse: TToolButton;
     UpDownPenAlpha: TBCTrackbarUpdown;
+    UpDownBackAlpha: TBCTrackbarUpdown;
     procedure BGRAVirtualScreen1MouseDown(Sender: TObject;
       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     procedure BGRAVirtualScreen1MouseMove(Sender: TObject; Shift: TShiftState;
@@ -69,6 +70,7 @@ type
     procedure ShapePenColorMouseUp(Sender: TObject; Button: TMouseButton;
       Shift: TShiftState; X, Y: Integer);
     procedure ToolButtonClick(Sender: TObject);
+    procedure UpDownBackAlphaChange(Sender: TObject; AByUser: boolean);
     procedure UpDownPenAlphaChange(Sender: TObject; AByUser: boolean);
   private
     FPenColor, FBackColor: TBGRAPixel;
@@ -362,6 +364,16 @@ begin
   end;
 end;
 
+procedure TForm1.UpDownBackAlphaChange(Sender: TObject; AByUser: boolean);
+begin
+  if AByUser then
+  begin
+    FBackColor:= ColorToBGRA(ShapeBackColor.Brush.Color, UpDownBackAlpha.Value);
+    if Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) then
+      vectorOriginal.SelectedShape.BackColor:= FBackColor;
+  end;
+end;
+
 procedure TForm1.UpDownPenAlphaChange(Sender: TObject; AByUser: boolean);
 begin
   if AByUser then
@@ -466,6 +478,7 @@ begin
   begin
     CheckBoxBack.Checked := true;
     ShapeBackColor.Brush.Color := AValue.ToColor;
+    UpDownBackAlpha.Value := AValue.alpha;
   end;
   if not FUpdatingFromShape and Assigned(vectorOriginal) then
   begin
@@ -551,6 +564,14 @@ begin
   case ACursor of
     oecDefault: BGRAVirtualScreen1.Cursor := crDefault;
     oecMove: BGRAVirtualScreen1.Cursor := crSizeAll;
+    oecMoveN: BGRAVirtualScreen1.Cursor := crSizeN;
+    oecMoveS: BGRAVirtualScreen1.Cursor := crSizeS;
+    oecMoveE: BGRAVirtualScreen1.Cursor := crSizeE;
+    oecMoveW: BGRAVirtualScreen1.Cursor := crSizeW;
+    oecMoveNE: BGRAVirtualScreen1.Cursor := crSizeNE;
+    oecMoveSW: BGRAVirtualScreen1.Cursor := crSizeSW;
+    oecMoveNW: BGRAVirtualScreen1.Cursor := crSizeNW;
+    oecMoveSE: BGRAVirtualScreen1.Cursor := crSizeSE;
   end;
 end;