Browse Source

less warnings

Unknown 7 years ago
parent
commit
e642e131b7
5 changed files with 18 additions and 17 deletions
  1. 0 2
      bcsvgbutton.pas
  2. 3 3
      bgracontrols.pas
  3. 0 1
      bgraflashprogressbar.pas
  4. 12 10
      bgraspeedbutton.pas
  5. 3 1
      colorspeedbutton.pas

+ 0 - 2
bcsvgbutton.pas

@@ -219,8 +219,6 @@ begin
 end;
 end;
 
 
 procedure TBCSVGButton.setFFileNameDown(const AValue: string);
 procedure TBCSVGButton.setFFileNameDown(const AValue: string);
-var li,st:ansistring;
-    F:Text;
 begin
 begin
   If AValue<>'' then ReadSVGFileAndSetString(Avalue,2);
   If AValue<>'' then ReadSVGFileAndSetString(Avalue,2);
 End;
 End;

+ 3 - 3
bgracontrols.pas

@@ -15,7 +15,7 @@ uses
   BGRAImageList, BGRAImageManipulation, BGRAKnob, BGRAResizeSpeedButton, 
   BGRAImageList, BGRAImageManipulation, BGRAKnob, BGRAResizeSpeedButton, 
   BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, 
   BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, 
   ColorSpeedButton, DTAnalogClock, DTAnalogGauge, dtthemedclock, 
   ColorSpeedButton, DTAnalogClock, DTAnalogGauge, dtthemedclock, 
-  dtthemedgauge, MaterialColors, bcmdbutton, bcmdbuttonfocus, 
+  dtthemedgauge, MaterialColors, BCMDButton, BCMDButtonFocus, 
   LazarusPackageIntf;
   LazarusPackageIntf;
 
 
 implementation
 implementation
@@ -50,8 +50,8 @@ begin
   RegisterUnit('DTAnalogGauge', @DTAnalogGauge.Register);
   RegisterUnit('DTAnalogGauge', @DTAnalogGauge.Register);
   RegisterUnit('dtthemedclock', @dtthemedclock.Register);
   RegisterUnit('dtthemedclock', @dtthemedclock.Register);
   RegisterUnit('dtthemedgauge', @dtthemedgauge.Register);
   RegisterUnit('dtthemedgauge', @dtthemedgauge.Register);
-  RegisterUnit('bcmdbutton', @bcmdbutton.Register);
-  RegisterUnit('bcmdbuttonfocus', @bcmdbuttonfocus.Register);
+  RegisterUnit('BCMDButton', @BCMDButton.Register);
+  RegisterUnit('BCMDButtonFocus', @BCMDButtonFocus.Register);
 end;
 end;
 
 
 initialization
 initialization

+ 0 - 1
bgraflashprogressbar.pas

@@ -161,7 +161,6 @@ procedure TBGRAFlashProgressBar.Paint;
 var
 var
   content: TRect;
   content: TRect;
   xpos, y, tx, ty: integer;
   xpos, y, tx, ty: integer;
-  grayValue: integer;
   bgColor: TBGRAPixel;
   bgColor: TBGRAPixel;
 
 
   function ApplyLightness(c: TBGRAPixel; lightness: word): TBGRAPixel;
   function ApplyLightness(c: TBGRAPixel; lightness: word): TBGRAPixel;

+ 12 - 10
bgraspeedbutton.pas

@@ -60,8 +60,8 @@ type
     { Protected declarations }
     { Protected declarations }
     {$IFDEF BGRA_DRAW}
     {$IFDEF BGRA_DRAW}
     function DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
     function DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
-      const AOffset: TPoint; AState: TButtonState; ATransparent: boolean;
-      BiDiFlags: longint): TRect; override;
+      const AOffset: TPoint; AState: TButtonState; {%H-}ATransparent: boolean;
+      {%H-}BiDiFlags: longint): TRect; override;
     {$ENDIF}
     {$ENDIF}
   public
   public
     { Public declarations }
     { Public declarations }
@@ -94,19 +94,21 @@ begin
   {Result := inherited DrawGlyph(ACanvas, AClient, AOffset, AState,
   {Result := inherited DrawGlyph(ACanvas, AClient, AOffset, AState,
     ATransparent, BiDiFlags); }
     ATransparent, BiDiFlags); }
 
 
-  if Glyph = nil then
+  if not Assigned(Glyph) then
+  begin
+    Result := Rect(0,0,0,0);
     Exit;
     Exit;
+  end;
+
   { It's not good solution assigning glyph on each draw call but FGlyph and SetGlyph is
   { It's not good solution assigning glyph on each draw call but FGlyph and SetGlyph is
     in private section }
     in private section }
   FBGRA.Assign(Glyph);
   FBGRA.Assign(Glyph);
 
 
-  if Assigned(Glyph) then
-  begin
-    if (AState = bsDown) or (Down = True) then
-      FBGRA.Draw(ACanvas, AOffset.x + 1, AOffset.y + 1, False)
-    else
-      FBGRA.Draw(ACanvas, AOffset.x, AOffset.y, False);
-  end;
+  if (AState = bsDown) or (Down = True) then
+    FBGRA.Draw(ACanvas, AOffset.x + 1, AOffset.y + 1, False)
+  else
+    FBGRA.Draw(ACanvas, AOffset.x, AOffset.y, False);
+  Result:= AClient;
 end;
 end;
 
 
 constructor TBGRASpeedButton.Create(AOwner: TComponent);
 constructor TBGRASpeedButton.Create(AOwner: TComponent);

+ 3 - 1
colorspeedbutton.pas

@@ -10,7 +10,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
-  Buttons, BGRASpeedButton, Types, LCLType, Themes, Math, LCLProc;
+  Buttons, BGRASpeedButton, Types, LCLType, Themes, LCLProc;
 
 
 type
 type
 
 
@@ -37,7 +37,9 @@ type
 
 
   TColorSpeedButton = class(TBGRASpeedButton)
   TColorSpeedButton = class(TBGRASpeedButton)
   private
   private
+    {$ifdef overridepaint}
     FLastDrawDetails: TThemedElementDetails;
     FLastDrawDetails: TThemedElementDetails;
+    {$endif}
     FPopupMode: boolean;
     FPopupMode: boolean;
     FPressed: boolean;
     FPressed: boolean;
     FStateActive: TColorState;
     FStateActive: TColorState;