Browse Source

Added missing property to SuperGauge test program

sganz 10 months ago
parent
commit
e8cbc02d3c
3 changed files with 44 additions and 10 deletions
  1. 1 1
      supergaugecommon.pas
  2. 33 9
      test/test_supergauge/sgtest.lfm
  3. 10 0
      test/test_supergauge/sgtest.pas

+ 1 - 1
supergaugecommon.pas

@@ -580,7 +580,7 @@ end;
 
 
 procedure TSGPointerCapSettings.SetEdgeThickness(AValue: integer);
 procedure TSGPointerCapSettings.SetEdgeThickness(AValue: integer);
 begin
 begin
-  if FEdgeThickness = AValue then
+  if (FEdgeThickness = AValue) or (AValue < 0) then
     Exit;
     Exit;
 
 
   FEdgeThickness := AValue;
   FEdgeThickness := AValue;

+ 33 - 9
test/test_supergauge/sgtest.lfm

@@ -1384,7 +1384,7 @@ object SGTestFrm: TSGTestFrm
         Left = 184
         Left = 184
         Height = 33
         Height = 33
         Hint = 'Shader Curve, Typically for Phong shader'
         Hint = 'Shader Curve, Typically for Phong shader'
-        Top = 248
+        Top = 281
         Width = 97
         Width = 97
         MaxLength = 0
         MaxLength = 0
         ParentShowHint = False
         ParentShowHint = False
@@ -1399,7 +1399,7 @@ object SGTestFrm: TSGTestFrm
       object CapCurveExponentLbl: TLabel
       object CapCurveExponentLbl: TLabel
         Left = 9
         Left = 9
         Height = 25
         Height = 25
-        Top = 256
+        Top = 289
         Width = 124
         Width = 124
         Caption = 'Curve Exponent'
         Caption = 'Curve Exponent'
       end
       end
@@ -1427,7 +1427,7 @@ object SGTestFrm: TSGTestFrm
       object CapFillColorLbl: TLabel
       object CapFillColorLbl: TLabel
         Left = 8
         Left = 8
         Height = 25
         Height = 25
-        Top = 136
+        Top = 169
         Width = 69
         Width = 69
         Caption = 'Fill Color'
         Caption = 'Fill Color'
       end
       end
@@ -1435,7 +1435,7 @@ object SGTestFrm: TSGTestFrm
         Left = 120
         Left = 120
         Height = 26
         Height = 26
         Hint = 'Fill Color'
         Hint = 'Fill Color'
-        Top = 135
+        Top = 168
         Width = 171
         Width = 171
         Style = [cbStandardColors, cbExtendedColors, cbCustomColor]
         Style = [cbStandardColors, cbExtendedColors, cbCustomColor]
         ColorDialog = ColorDialog1
         ColorDialog = ColorDialog1
@@ -1449,7 +1449,7 @@ object SGTestFrm: TSGTestFrm
         Left = 184
         Left = 184
         Height = 33
         Height = 33
         Hint = 'Light Intensity of the Shader'
         Hint = 'Light Intensity of the Shader'
-        Top = 208
+        Top = 241
         Width = 97
         Width = 97
         MaxLength = 0
         MaxLength = 0
         ParentShowHint = False
         ParentShowHint = False
@@ -1465,14 +1465,14 @@ object SGTestFrm: TSGTestFrm
       object CapLightIntensityLbl: TLabel
       object CapLightIntensityLbl: TLabel
         Left = 9
         Left = 9
         Height = 25
         Height = 25
-        Top = 216
+        Top = 249
         Width = 111
         Width = 111
         Caption = 'Light Intensity'
         Caption = 'Light Intensity'
       end
       end
       object CapRadiusLbl: TLabel
       object CapRadiusLbl: TLabel
         Left = 9
         Left = 9
         Height = 25
         Height = 25
-        Top = 176
+        Top = 209
         Width = 53
         Width = 53
         Caption = 'Radius'
         Caption = 'Radius'
       end
       end
@@ -1480,7 +1480,7 @@ object SGTestFrm: TSGTestFrm
         Left = 184
         Left = 184
         Height = 33
         Height = 33
         Hint = 'X Offset from Center'
         Hint = 'X Offset from Center'
-        Top = 168
+        Top = 201
         Width = 97
         Width = 97
         MaxLength = 0
         MaxLength = 0
         ParentShowHint = False
         ParentShowHint = False
@@ -1506,7 +1506,7 @@ object SGTestFrm: TSGTestFrm
           ''
           ''
           'For thicker pointers and the triangle shaped pointer, '
           'For thicker pointers and the triangle shaped pointer, '
           'setting the Edge Color to match the Fill Color can make'
           'setting the Edge Color to match the Fill Color can make'
-          'it look nicer.'
+          'it look nicer. Also change Edge Thickness to 0 for better look'
           ''
           ''
           'The Curve Exponent is for the Phong Shader, and can'
           'The Curve Exponent is for the Phong Shader, and can'
           'give some nice results. This only applies to the Phong '
           'give some nice results. This only applies to the Phong '
@@ -1517,6 +1517,30 @@ object SGTestFrm: TSGTestFrm
         )
         )
         TabOrder = 7
         TabOrder = 7
       end
       end
+      object CapEdgeThicknessSpe: TSpinEditEx
+        Left = 184
+        Height = 33
+        Hint = 'Thickness of the outer edge, 0 for none'
+        Top = 128
+        Width = 97
+        MaxLength = 0
+        ParentShowHint = False
+        ShowHint = True
+        TabOrder = 8
+        OnChange = CapEdgeThicknessSpeChange
+        MaxValue = 1000
+        MinValue = -1000
+        MinRepeatValue = 10
+        NullValue = 0
+        Value = 0
+      end
+      object CapEdgeThicknessLbl: TLabel
+        Left = 8
+        Height = 25
+        Top = 136
+        Width = 98
+        Caption = 'Edge Radius'
+      end
     end
     end
     object TextTab: TTabSheet
     object TextTab: TTabSheet
       Caption = 'Text'
       Caption = 'Text'

+ 10 - 0
test/test_supergauge/sgtest.pas

@@ -32,6 +32,8 @@ type
 
 
   TSGTestFrm = class(TForm)
   TSGTestFrm = class(TForm)
     BGRAKnob: TBGRAKnob;
     BGRAKnob: TBGRAKnob;
+    CapEdgeThicknessLbl: TLabel;
+    CapEdgeThicknessSpe: TSpinEditEx;
     FaceCurveExponentLbl: TLabel;
     FaceCurveExponentLbl: TLabel;
     FaceCurveExponentSpe: TFloatSpinEditEx;
     FaceCurveExponentSpe: TFloatSpinEditEx;
     FaceLightIntensityLbl: TLabel;
     FaceLightIntensityLbl: TLabel;
@@ -504,6 +506,7 @@ type
     procedure Band4ThicknessSpeChange(Sender: TObject);
     procedure Band4ThicknessSpeChange(Sender: TObject);
     procedure BGRAKnobValueChanged(Sender: TObject; Value: single);
     procedure BGRAKnobValueChanged(Sender: TObject; Value: single);
     procedure BandEnabledCbChange(Sender: TObject);
     procedure BandEnabledCbChange(Sender: TObject);
+    procedure CapEdgeThicknessSpeChange(Sender: TObject);
     procedure DisableAllMarkersBtnClick(Sender: TObject);
     procedure DisableAllMarkersBtnClick(Sender: TObject);
     procedure EnableAllMarkersBtnClick(Sender: TObject);
     procedure EnableAllMarkersBtnClick(Sender: TObject);
     procedure ExitSubMenuClick(Sender: TObject);
     procedure ExitSubMenuClick(Sender: TObject);
@@ -1029,6 +1032,7 @@ begin
   CapFillColorCb.Selected := SuperGauge.PointerCapSettings.FillColor;
   CapFillColorCb.Selected := SuperGauge.PointerCapSettings.FillColor;
   CapLightIntensitySpe.Value := SuperGauge.PointerCapSettings.LightIntensity;
   CapLightIntensitySpe.Value := SuperGauge.PointerCapSettings.LightIntensity;
   CapRadiusSpe.Value := SuperGauge.PointerCapSettings.Radius;
   CapRadiusSpe.Value := SuperGauge.PointerCapSettings.Radius;
+  CapEdgeThicknessSpe.Value := SuperGauge.PointerCapSettings.EdgeThickness;
 end;
 end;
 
 
 procedure TSGTestFrm.UpdatePointerStats;
 procedure TSGTestFrm.UpdatePointerStats;
@@ -1805,6 +1809,12 @@ begin
   SuperGauge.BandSettings1.Enabled := Band1EnabledCb.Checked;
   SuperGauge.BandSettings1.Enabled := Band1EnabledCb.Checked;
 end;
 end;
 
 
+procedure TSGTestFrm.CapEdgeThicknessSpeChange(Sender: TObject);
+begin
+  SuperGauge.PointerCapSettings.EdgeThickness := CapEdgeThicknessSpe.Value;
+  UpdateCapStats;
+end;
+
 procedure TSGTestFrm.DisableAllMarkersBtnClick(Sender: TObject);
 procedure TSGTestFrm.DisableAllMarkersBtnClick(Sender: TObject);
 begin
 begin
   SuperGauge.MarkerSettings1.Enabled := False;
   SuperGauge.MarkerSettings1.Enabled := False;