Browse Source

Removed unnecessary BGRAToColor and ColorToBGRA. Revised hints.

lainz 9 năm trước cách đây
mục cha
commit
4d36d2c32f

+ 34 - 32
bgracontrols.lpk → BGRAControls.lpk

@@ -23,9 +23,10 @@
       </Linking>
     </CompilerOptions>
     <Version Major="4" Minor="3"/>
-    <Files Count="42">
+    <Files Count="41">
       <Item1>
         <Filename Value="bcbasectrls.pas"/>
+        <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCBaseCtrls"/>
       </Item1>
       <Item2>
@@ -100,6 +101,7 @@
       </Item16>
       <Item17>
         <Filename Value="bcthememanager.pas"/>
+        <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCThemeManager"/>
       </Item17>
       <Item18>
@@ -109,6 +111,7 @@
       </Item18>
       <Item19>
         <Filename Value="bctools.pas"/>
+        <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCTools"/>
       </Item19>
       <Item20>
@@ -118,7 +121,8 @@
       </Item20>
       <Item21>
         <Filename Value="bctypes.pas"/>
-        <UnitName Value="bctypes"/>
+        <AddToUsesPkgSection Value="False"/>
+        <UnitName Value="BCTypes"/>
       </Item21>
       <Item22>
         <Filename Value="bgracustomdrawn.pas"/>
@@ -156,70 +160,68 @@
         <UnitName Value="BGRAResizeSpeedButton"/>
       </Item28>
       <Item29>
-        <Filename Value="bgrascript.pas"/>
-        <UnitName Value="BGRAScript"/>
-      </Item29>
-      <Item30>
         <Filename Value="bgrashape.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAShape"/>
-      </Item30>
-      <Item31>
+      </Item29>
+      <Item30>
         <Filename Value="bgraspeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpeedButton"/>
-      </Item31>
-      <Item32>
+      </Item30>
+      <Item31>
         <Filename Value="bgraspriteanimation.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpriteAnimation"/>
-      </Item32>
-      <Item33>
+      </Item31>
+      <Item32>
         <Filename Value="bgravirtualscreen.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAVirtualScreen"/>
-      </Item33>
-      <Item34>
+      </Item32>
+      <Item33>
         <Filename Value="dtanalogclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="DTAnalogClock"/>
-      </Item34>
-      <Item35>
+      </Item33>
+      <Item34>
         <Filename Value="dtanalogcommon.pp"/>
+        <AddToUsesPkgSection Value="False"/>
         <UnitName Value="DTAnalogCommon"/>
-      </Item35>
-      <Item36>
+      </Item34>
+      <Item35>
         <Filename Value="dtanaloggauge.pp"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="DTAnalogGauge"/>
-      </Item36>
-      <Item37>
+      </Item35>
+      <Item36>
         <Filename Value="dtthemedclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedclock"/>
-      </Item37>
-      <Item38>
+      </Item36>
+      <Item37>
         <Filename Value="dtthemedgauge.pp"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedgauge"/>
-      </Item38>
-      <Item39>
+      </Item37>
+      <Item38>
         <Filename Value="mouseandkeyinput/mouseandkeyinput.pas"/>
         <UnitName Value="MouseAndKeyInput"/>
-      </Item39>
-      <Item40>
+      </Item38>
+      <Item39>
         <Filename Value="bckeyboard.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCKeyboard"/>
+      </Item39>
+      <Item40>
+        <Filename Value="materialcolors.pas"/>
+        <UnitName Value="MaterialColors"/>
       </Item40>
       <Item41>
-        <Filename Value="materialcolors.pas"/>
-        <UnitName Value="materialcolors"/>
-      </Item41>
-      <Item42>
         <Filename Value="bcbrightandcontrast.pas"/>
-        <UnitName Value="ubrightandcontrast"/>
-      </Item42>
+        <AddToUsesPkgSection Value="False"/>
+        <UnitName Value="BCBrightAndContrast"/>
+      </Item41>
     </Files>
     <RequiredPkgs Count="2">
       <Item1>

+ 7 - 1
BGRAPascalScriptComponent.lpk

@@ -11,9 +11,10 @@
         <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       </SearchPaths>
     </CompilerOptions>
-    <Files Count="2">
+    <Files Count="3">
       <Item1>
         <Filename Value="bgrapascalscript.pas"/>
+        <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BGRAPascalScript"/>
       </Item1>
       <Item2>
@@ -21,6 +22,11 @@
         <HasRegisterProc Value="True"/>
         <UnitName Value="uPSI_BGRAPascalScript"/>
       </Item2>
+      <Item3>
+        <Filename Value="bgrascript.pas"/>
+        <AddToUsesPkgSection Value="False"/>
+        <UnitName Value="BGRAScript"/>
+      </Item3>
     </Files>
     <RequiredPkgs Count="3">
       <Item1>

+ 5 - 5
bcbutton.pas

@@ -77,8 +77,8 @@ type
     FBackground: TBCBackground;
     FBorder: TBCBorder;
     FFontEx: TBCFont;
-    procedure OnChangeFont(Sender: TObject; {%H-}AData: PtrInt);
-    procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+    procedure OnChangeFont({%H-}Sender: TObject; {%H-}AData: PtrInt);
+    procedure OnChangeChildProperty({%H-}Sender: TObject; AData: PtrInt);
     procedure SetBackground(AValue: TBCBackground);
     procedure SetBorder(AValue: TBCBorder);
     procedure SetFontEx(const AValue: TBCFont);
@@ -170,8 +170,8 @@ type
     procedure SetGlobalOpacity(const AValue: byte);
     procedure SetTextApplyGlobalOpacity(const AValue: boolean);
     procedure UpdateSize;
-    procedure OnChangeGlyph(Sender: TObject);
-    procedure OnChangeState(Sender: TObject; AData: PtrInt);
+    procedure OnChangeGlyph({%H-}Sender: TObject);
+    procedure OnChangeState({%H-}Sender: TObject; AData: PtrInt);
     procedure ImageListChange(ASender: TObject);
   protected
     { Protected declarations }
@@ -1526,7 +1526,7 @@ begin
         msHover: bgra := FBGRAHover;
         msClicked: bgra := FBGRAClick;
       end;
-    if bgra.NeedRender then
+    if {%H-}bgra.NeedRender then
       Render(bgra, TBCButtonState(bgra.CustomData));
     bgra.Draw(Self.Canvas, 0, 0, False);
   end

+ 5 - 5
bcbuttonfocus.pas

@@ -77,8 +77,8 @@ type
     FBackground: TBCBackground;
     FBorder: TBCBorder;
     FFontEx: TBCFont;
-    procedure OnChangeFont(Sender: TObject; {%H-}AData: PtrInt);
-    procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+    procedure OnChangeFont({%H-}Sender: TObject; {%H-}AData: PtrInt);
+    procedure OnChangeChildProperty({%H-}Sender: TObject; AData: PtrInt);
     procedure SetBackground(AValue: TBCBackground);
     procedure SetBorder(AValue: TBCBorder);
     procedure SetFontEx(const AValue: TBCFont);
@@ -171,8 +171,8 @@ type
     procedure SetGlobalOpacity(const AValue: byte);
     procedure SetTextApplyGlobalOpacity(const AValue: boolean);
     procedure UpdateSize;
-    procedure OnChangeGlyph(Sender: TObject);
-    procedure OnChangeState(Sender: TObject; AData: PtrInt);
+    procedure OnChangeGlyph({%H-}Sender: TObject);
+    procedure OnChangeState({%H-}Sender: TObject; AData: PtrInt);
     procedure ImageListChange(ASender: TObject);
   protected
     { Protected declarations }
@@ -1557,7 +1557,7 @@ begin
         msHover: bgra := FBGRAHover;
         msClicked: bgra := FBGRAClick;
       end;
-    if bgra.NeedRender then
+    if {%H-}bgra.NeedRender then
       Render(bgra, TBCButtonFocusState(bgra.CustomData));
     bgra.Draw(Self.Canvas, 0, 0, False);
   end

+ 2 - 2
bcdefaultthememanager.pas

@@ -29,8 +29,8 @@ type
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
   public
-    procedure Apply(AControl: TWinControl);
-    procedure Apply();
+    procedure Apply(AControl: TWinControl); override;
+    procedure Apply(); override;
   published
     property Button: TBCButton read FButton write SetFButton;
     property ButtonFocus: TBCButtonFocus read FButtonFocus write SetFButtonFocus;

+ 1 - 0
bcfilters.pas

@@ -221,6 +221,7 @@ var
   sf: TBCSimpleFilter;
   ls: ansistring;
 begin
+  sf := bcsNone;
   Result := sf;
   ls := UTF8LowerCase(s);
   for sf := low(TBCSimpleFilter) to high(TBCSimpleFilter) do

+ 4 - 4
bcimagebutton.pas

@@ -245,14 +245,14 @@ type
     procedure SetFAnimation(AValue: boolean);
     procedure SetFBitmapFile(AValue: string);
     procedure SetFBitmapOptions(AValue: TBCImageButtonSliceScalingOptions);
-    procedure Fade(Sender: TObject);
+    procedure Fade({%H-}Sender: TObject);
     procedure SetFTextVisible(AValue: boolean);
   protected
     { Protected declarations }
     procedure DrawControl; override;
     procedure RenderControl; override;
     procedure TextChanged; override;
-    procedure CMChanged(var Message: TLMessage); message CM_CHANGED; virtual;
+    procedure CMChanged(var {%H-}Message: TLMessage); message CM_CHANGED; virtual;
     {$IFDEF DEBUG}
     function GetDebugText: string;
     {$ENDIF}
@@ -277,7 +277,7 @@ type
     procedure SaveToFile(AFileName: string);
     procedure LoadFromFile(AFileName: string);
     procedure AssignFromFile(AFileName: string);
-    procedure OnFindClass(Reader: TReader; const AClassName: string;
+    procedure OnFindClass({%H-}Reader: TReader; const AClassName: string;
       var ComponentClass: TComponentClass);
   published
     { Published declarations }
@@ -955,7 +955,7 @@ procedure TBCCustomImageButton.RenderControl;
   begin
     AssignFontToBGRA(Font, ABitmap);
     ABitmap.TextRect(Rect(0, 0, Width, Height), Caption, taCenter, tlCenter,
-      ColorToBGRA(ColorToRGB(Font.Color)));
+      Font.Color);
   end;
 
 {$IFDEF DEBUG}

+ 3 - 3
bckeyboard.pas

@@ -6,7 +6,7 @@ interface
 
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
-  BCThemeManager, BCNumericKeyboard, BCButton, BCPanel, MouseAndKeyInput,
+  BCThemeManager, BCButton, BCPanel, MouseAndKeyInput,
   LCLType;
 
 type
@@ -31,8 +31,8 @@ type
   protected
     procedure PressVirtKey(p: longint);
     procedure PressShiftVirtKey(p: longint);
-    procedure OnButtonClick(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: integer); virtual;
+    procedure OnButtonClick(Sender: TObject; {%H-}Button: TMouseButton;
+      {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: integer); virtual;
     { When value is changed by the user }
     property OnUserChange: TNotifyEvent read FOnUserChange write FOnUserChange;
   public

+ 1 - 1
bclabel.pas

@@ -68,7 +68,7 @@ type
     procedure SetBorder(AValue: TBCBorder);
     procedure SetFontEx(AValue: TBCFont);
     procedure OnChangeProperty(Sender: TObject; {%H-}Data: PtrInt);
-    procedure OnChangeFont(Sender: TObject; {%H-}AData: PtrInt);
+    procedure OnChangeFont({%H-}Sender: TObject; {%H-}AData: PtrInt);
   protected
     procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
       {%H-}WithThemeSpace: boolean); override;

+ 4 - 4
bcmaterialdesignbutton.pas

@@ -53,8 +53,8 @@ type
     procedure SetFTextSize(AValue: integer);
     procedure SetFTextStyle(AValue: TFontStyles);
   protected
-    procedure OnStartTimer(Sender: TObject);
-    procedure OnTimer(Sender: TObject);
+    procedure OnStartTimer({%H-}Sender: TObject);
+    procedure OnTimer({%H-}Sender: TObject);
     procedure Paint; override;
     procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
       X, Y: integer); override;
@@ -353,7 +353,7 @@ begin
   if Caption <> '' then
   begin
     temp := DrawTextShadow(Width, Height - FShadowSize, Caption, FTextSize,
-      ColorToBGRA(FTextColor), ColorToBGRA(FTextShadowColor),
+      FTextColor, FTextShadowColor,
       FTextShadowOffsetX, FTextShadowOffsetY, FTextShadowSize,
       FTextStyle, FTextFont, FTextShadow, FTextQuality) as TBGRABitmap;
     FBGRA.PutImage(0, 0, temp, dmDrawWithTransparency);
@@ -390,7 +390,7 @@ begin
   begin
     FBGRAShadow.RoundRectAntialias(FShadowSize, FShadowSize, Width - FShadowSize,
       Height - FShadowSize, FRoundBorders, FRoundBorders,
-      ColorToBGRA(FShadowColor), 1, ColorToBGRA(FShadowColor), [rrDefault]);
+      FShadowColor, 1, FShadowColor, [rrDefault]);
     BGRAReplace(FBGRAShadow, FBGRAShadow.FilterBlurRadial(FShadowSize,
       FShadowSize, rbFast) as TBGRABitmap);
   end;

+ 4 - 4
bcnumerickeyboard.pas

@@ -29,8 +29,8 @@ type
     procedure SetFPanel(AValue: TBCPanel);
     procedure SetFValue(AValue: string);
   protected
-    procedure OnButtonClick(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: integer); virtual;
+    procedure OnButtonClick(Sender: TObject; {%H-}Button: TMouseButton;
+      {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: integer); virtual;
   protected
     { The input value }
     property Value: string read FValue write SetFValue;
@@ -72,8 +72,8 @@ type
 
   TBCRealNumericKeyboard = class(TBCCustomNumericKeyboard)
   protected
-    procedure OnButtonClick(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: integer); override;
+    procedure OnButtonClick(Sender: TObject; {%H-}Button: TMouseButton;
+      {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: integer); override;
     procedure PressVirtKey(p: longint);
   public
     constructor Create(AOwner: TComponent); override;

+ 2 - 2
bcpanel.pas

@@ -73,8 +73,8 @@ type
     procedure SetFontEx(AValue: TBCFont);
     procedure SetRounding(AValue: TBCRounding);
     procedure Render;
-    procedure OnChangeProperty(Sender: TObject; {%H-}AData: PtrInt);
-    procedure OnChangeFont(Sender: TObject; {%H-}AData: PtrInt);
+    procedure OnChangeProperty({%H-}Sender: TObject; {%H-}AData: PtrInt);
+    procedure OnChangeFont({%H-}Sender: TObject; {%H-}AData: PtrInt);
   protected
     { Protected declarations }
     procedure AdjustClientRect(var aRect: TRect); override;

+ 2 - 2
bcradialprogressbar.pas

@@ -37,7 +37,7 @@ type
   protected
     { Protected declarations }
     procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
-      WithThemeSpace: boolean); override;
+      {%H-}WithThemeSpace: boolean); override;
     procedure DrawControl; override;
     procedure RenderControl; override;
   public
@@ -223,7 +223,7 @@ begin
   textStr := FloatToStr((Value / MaxValue) * 100) + '%';
 
   textBmp := TextShadow(Width, Height, textStr, Font.Height,
-    ColorToBGRA(Font.Color), ColorToBGRA(FontShadowColor), FontShadowOFfsetX,
+    Font.Color, FontShadowColor, FontShadowOFfsetX,
     FontShadowOffsetY, FontSHadowRadius, Font.Style, Font.Name) as TBGRABitmap;
   FBitmap.PutImage(0, 0, textBmp, dmDrawWithTransparency);
   textBmp.Free;

+ 0 - 1
bcrtti.pas

@@ -258,7 +258,6 @@ function GetSectionData(const AFileName, ASectionName: String): TStrings;
 var
   f: TextFile;
   s: String;
-  sl: TStringList;
   bReading: Boolean;
 begin
   Result := TStringList.Create;

+ 4 - 4
bcsamples.pas

@@ -179,7 +179,7 @@ procedure DrawWindows7ToolBar(ABitmap: TBGRABitmap; ADir: TAlign;
 procedure DrawiOSBar(ABitmap: TBGRABitmap);
 procedure DrawiOSToolBar(ABitmap: TBGRABitmap; Shadow: boolean = True);
 procedure DrawiOSBackground(ABitmap: TBGRABitmap);
-procedure DrawWindows8Background(ABitmap: TBGRABitmap; cl1, cl2: TColor);
+procedure DrawWindows8Background(ABitmap: TBGRABitmap; {%H-}cl1, cl2: TColor);
 
 implementation
 
@@ -417,7 +417,7 @@ begin
   if odSelected in State then
     DrawSample(temp, Style, alNone);
 
-  temp.TextOut(2, 0, str, BGRABlack);
+  temp.TextOut(2, 0, {%H-}str, BGRABlack);
 
   if Control is TListBox then
     temp.Draw(TListBox(Control).Canvas, ARect, False)
@@ -734,7 +734,7 @@ end;
 procedure BCButtonWindows8(AButton: TBCButton; cl1, cl2: TBGRAPixel;
   rounding: integer = 1);
 begin
-  BCButtonWindows8(AButton, BGRAToColor(cl1), BGRAToColor(cl2), rounding);
+  BCButtonWindows8(AButton, cl1, cl2, rounding);
 end;
 
 procedure BCButtonWindows7(AButton: TBCButtonFocus);
@@ -1045,7 +1045,7 @@ end;
 procedure BCButtonWindows8(AButton: TBCButtonFocus; cl1, cl2: TBGRAPixel;
   rounding: integer = 1);
 begin
-  BCButtonWindows8(AButton, BGRAToColor(cl1), BGRAToColor(cl2), rounding);
+  BCButtonWindows8(AButton, cl1, cl2, rounding);
 end;
 
 procedure DrawFlashPlayerBody(ABitmap: TBGRABitmap);

+ 8 - 8
bcstylesform.pas

@@ -65,12 +65,12 @@ type
     ToolButton1: TToolButton;
     btnNewFromFile: TToolButton;
     btnRefresh: TToolButton;
-    procedure ActionDeleteExecute(Sender: TObject);
-    procedure ActionNewFromCtrlExecute(Sender: TObject);
-    procedure ActionNewFromFileExecute(Sender: TObject);
-    procedure ActionRefreshExecute(Sender: TObject);
-    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
-    procedure lvFilesSelectItem(Sender: TObject; Item: TListItem;
+    procedure ActionDeleteExecute({%H-}Sender: TObject);
+    procedure ActionNewFromCtrlExecute({%H-}Sender: TObject);
+    procedure ActionNewFromFileExecute({%H-}Sender: TObject);
+    procedure ActionRefreshExecute({%H-}Sender: TObject);
+    procedure FormCloseQuery({%H-}Sender: TObject; var CanClose: boolean);
+    procedure lvFilesSelectItem({%H-}Sender: TObject; Item: TListItem;
       Selected: Boolean);
   private
     { private declarations }
@@ -83,7 +83,7 @@ type
     function GetStylesDir: String;
   public
     { public declarations }
-    constructor Create(AControl: TControl; const AFileExt: String);
+    constructor {%H-}Create(AControl: TControl; const AFileExt: String);
 
     property FileName: String read GetFileName;
   end;
@@ -98,7 +98,7 @@ type
     procedure DoShowEditor;
   public
     procedure ExecuteVerb(Index: Integer); override;
-    function  GetVerb(Index: Integer): String; override;
+    function  GetVerb({%H-}Index: Integer): String; override;
     function  GetVerbCount: Integer; override;
   end;
 

+ 1 - 1
bctoolbar.pas

@@ -94,7 +94,7 @@ begin
   if AColor = clDefault then
     g_hue := -1
   else
-    g_hue := BGRAToGSBA(ColorToBGRA(ColorToRGB(AColor))).hue;
+    g_hue := BGRAToGSBA(AColor).hue;
   ARect := Rect(0, 0, Bitmap.Width, Bitmap.Height);
   // Font: RGBToColor(30,57,91)
 

+ 3 - 3
bctools.pas

@@ -219,7 +219,7 @@ begin
     shd.Free;
   end;
 
-  ATargetBGRA.TextRect(ARect,ARect.Left,ARect.Top,AText,st,ColorToBGRA(ColorToRGB(AFont.Color)));
+  ATargetBGRA.TextRect(ARect,ARect.Left,ARect.Top,AText,st,AFont.Color);
 
 end;
 
@@ -259,7 +259,7 @@ begin
   // FontAntialias is only backward compability for FontQuality property.
   // FontQuality is published in TBCFont so we don't need FontAntialias anymore.
   //ATargetBGRA.FontAntialias := AFont.FontAntialias;
-  ATargetBGRA.FontStyle     := AFont.Style;
+  {%H-}ATargetBGRA.FontStyle     := AFont.Style;
 
   // If font quality is system, then we can leave default values. LCL will
   // handle everything (when name is "default" or height 0)
@@ -433,7 +433,7 @@ begin
   case ABackground.Style of
     bbsClear, bbsColor:
       { Solid background color }
-      ATargetBGRA.FillRoundRectAntialias(x1,y1,x2,y2, rx, ry, backcolor, ropt);
+      ATargetBGRA.FillRoundRectAntialias(x1,y1,x2,y2, rx, ry, {%H-}backcolor, ropt);
     bbsGradient:
     begin
       { Using multishape filler to merge background gradient and border }

+ 6 - 6
bctrackbarupdown.pas

@@ -80,8 +80,8 @@ type
     procedure SetBCButtonBackground(AValue: TBCBackground);
     procedure SetBCButtonDownBackground(AValue: TBCBackground);
     procedure SetBCRounding(AValue: TBCRounding);
-    procedure OnChangeProperty(Sender: TObject; {%H-}AData: PtrInt);
-    procedure Timer(Sender: TObject);
+    procedure OnChangeProperty({%H-}Sender: TObject; {%H-}AData: PtrInt);
+    procedure Timer({%H-}Sender: TObject);
     procedure RenderOnBitmap(ABitmap: TBGRABitmap);
     procedure DrawControl; override;
     procedure DoSelectAll;
@@ -436,7 +436,7 @@ begin
   ABitmap.FontName := Font.Name;
   ABitmap.FontStyle := Font.Style;
   ABitmap.FontHeight := ((ty-FBarHeight+1)*8+4) div 9;
-  fgcolor := ColorToBGRA(ColorToRGB(Font.Color));
+  fgcolor := Font.Color;
 
   x := FTextLeft;
   y := bounds.top+1;
@@ -463,8 +463,8 @@ begin
     else
     begin
       s := ABitmap.TextSize(inSel);
-      ABitmap.FillRect(x,y+1,x+s.cx,y+s.cy,ColorToBGRA(ColorToRGB(clHighlight)),dmSet);
-      ABitmap.TextOut(x,y,inSel,ColorToBGRA(ColorToRGB(clHighlightText)));
+      ABitmap.FillRect(x,y+1,x+s.cx,y+s.cy,clHighlight,dmSet);
+      ABitmap.TextOut(x,y,inSel,clHighlightText);
       inc(x,s.cx);
     end;
     ABitmap.TextOut(x,y,afterSel,fgcolor);
@@ -481,7 +481,7 @@ begin
     ABitmap.FillPolyAntialias([PointF(barx,FBarTop),PointF(barx+FBarHeight,FBarTop+FBarHeight),
       PointF(barx-FBarHeight,FBarTop+FBarHeight)],fgcolor);
   midx := FUpDownLeft+(FUpDownWidth-1)/2;
-  btntext := ColorToBGRA(ColorToRGB(FArrowColor));
+  btntext := FArrowColor;
   ABitmap.FillPolyAntialias([PointF(FUpDownLeft+2,midy*4/5),PointF(midx,midy/5),PointF(FUpDownLeft+FUpDownWidth-3,midy*4/5)],btntext);
   ABitmap.FillPolyAntialias([PointF(FUpDownLeft+2,midy*6/5),PointF(midx,ABitmap.Height-midy/5),PointF(FUpDownLeft+FUpDownWidth-3,midy*6/5)],btntext);
 end;

+ 4 - 4
bctypes.pas

@@ -163,7 +163,7 @@ type
     FGradient1EndPercent: single;
     FGradient2: TBCGradient;
     FStyle: TBCBackgroundStyle;
-    procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+    procedure OnChangeChildProperty({%H-}Sender: TObject; AData: PtrInt);
     procedure SetColor(AValue: TColor);
     procedure SetColorOpacity(AValue: byte);
     procedure SetGradient1(AValue: TBCGradient);
@@ -310,7 +310,7 @@ end;
 
 procedure TBCPixel.Assign(Source: TColor; Opacity: byte);
 begin
-  Pixel := ColorToBGRA(Source, Opacity);
+  Pixel.FromColor(Source, Opacity);
 end;
 
 procedure TBCPixel.Assign(Source: string);
@@ -320,12 +320,12 @@ end;
 
 function TBCPixel.Color: TColor;
 begin
-  Result := BGRAToColor(Pixel);
+  Result := Pixel;
 end;
 
 function TBCPixel.Hex: string;
 begin
-  Result := BGRAToStr(Pixel);
+  Result := Pixel.ToString;
 end;
 
 procedure TBCPixel.ApplyLightness(lightness: word);

+ 8 - 9
bgracontrols.pas

@@ -8,16 +8,15 @@ unit bgracontrols;
 interface
 
 uses
-  BCBaseCtrls, BCButton, BCButtonFocus, BCDefaultThemeManager, BCEffect, 
-  bcfilters, BCGameGrid, BCImageButton, BCLabel, BCMaterialDesignButton, 
+  BCButton, BCButtonFocus, BCDefaultThemeManager, BCEffect, bcfilters, 
+  BCGameGrid, BCImageButton, BCLabel, BCMaterialDesignButton, 
   BCNumericKeyboard, BCPanel, BCRadialProgressBar, BCRTTI, BCSamples, 
-  BCStylesForm, BCThemeManager, BCToolBar, BCTools, BCTrackbarUpdown, BCTypes, 
-  BGRACustomDrawn, BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, 
-  BGRAImageManipulation, BGRAKnob, BGRAResizeSpeedButton, BGRAScript, 
-  BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, 
-  DTAnalogClock, DTAnalogCommon, DTAnalogGauge, dtthemedclock, dtthemedgauge, 
-  MouseAndKeyInput, BCKeyboard, MaterialColors, bcbrightandcontrast, 
-  LazarusPackageIntf;
+  BCStylesForm, BCToolBar, BCTrackbarUpdown, BGRACustomDrawn, 
+  BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, 
+  BGRAImageManipulation, BGRAKnob, BGRAResizeSpeedButton, BGRAShape, 
+  BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, DTAnalogClock, 
+  DTAnalogGauge, dtthemedclock, dtthemedgauge, MouseAndKeyInput, BCKeyboard, 
+  MaterialColors, LazarusPackageIntf;
 
 implementation
 

+ 10 - 10
bgracustomdrawn.pas

@@ -184,30 +184,30 @@ type
       ASize: TSize; AState: TCDControlState; AStateEx: TCDButtonStateEx); override;
     { Edit }
     procedure DrawEditBackground(ADest: TCanvas; ADestPos: TPoint;
-      ASize: TSize; AState: TCDControlState; AStateEx: TCDEditStateEx); override;
+      ASize: TSize; AState: TCDControlState; {%H-}AStateEx: TCDEditStateEx); override;
     procedure DrawEditFrame(ADest: TCanvas; ADestPos: TPoint; ASize: TSize;
-      AState: TCDControlState; AStateEx: TCDEditStateEx); override;
+      AState: TCDControlState; {%H-}AStateEx: TCDEditStateEx); override;
     procedure DrawCaret(ADest: TCanvas; ADestPos: TPoint; ASize: TSize;
       AState: TCDControlState; AStateEx: TCDEditStateEx); override;
     procedure DrawEdit(ADest: TCanvas; ASize: TSize; AState: TCDControlState;
       AStateEx: TCDEditStateEx); override;
     { Panel }
-    procedure DrawPanel(ADest: TCanvas; ASize: TSize; AState: TCDControlState;
-      AStateEx: TCDPanelStateEx); override;
+    procedure DrawPanel(ADest: TCanvas; ASize: TSize; {%H-}AState: TCDControlState;
+      {%H-}AStateEx: TCDPanelStateEx); override;
     { Static Text }
     procedure DrawStaticText(ADest: TCanvas; ASize: TSize;
       AState: TCDControlState; AStateEx: TCDControlStateEx); override;
     { Progress Bar }
     procedure DrawProgressBar(ADest: TCanvas; ASize: TSize;
-      AState: TCDControlState; AStateEx: TCDProgressBarStateEx); override;
+      {%H-}AState: TCDControlState; AStateEx: TCDProgressBarStateEx); override;
     { CheckBox }
     procedure DrawCheckBoxSquare(ADest: TCanvas; ADestPos: TPoint;
-      ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx); override;
+      ASize: TSize; AState: TCDControlState; {%H-}AStateEx: TCDControlStateEx); override;
     procedure DrawCheckBox(ADest: TCanvas; ASize: TSize;
       AState: TCDControlState; AStateEx: TCDControlStateEx); override;
     { RadioButton }
-    procedure DrawRadioButtonCircle(ADest: TCanvas; ADestPos: TPoint;
-      ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx); override;
+    procedure DrawRadioButtonCircle(ADest: TCanvas; {%H-}ADestPos: TPoint;
+      {%H-}ASize: TSize; AState: TCDControlState; {%H-}AStateEx: TCDControlStateEx); override;
     procedure DrawRadioButton(ADest: TCanvas; ASize: TSize;
       AState: TCDControlState; AStateEx: TCDControlStateEx); override;
   end;
@@ -336,7 +336,7 @@ end;
 constructor TBCDProgressBar.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
-  Color := BGRAToColor(BGRA(102, 163, 226));
+  Color := BGRA(102, 163, 226);
 end;
 
 { TBGRADrawer }
@@ -749,7 +749,7 @@ procedure TBGRADrawer.DrawProgressBar(ADest: TCanvas; ASize: TSize;
   var
     lCol: TBGRAPixel;
   begin
-    lCol := ColorToBGRA(ColorToRGB(AStateEx.RGBColor));
+    lCol := AStateEx.RGBColor;
 
     DoubleGradientAlphaFill(Bitmap, bounds,
       ApplyLightness(lCol, 37000), ApplyLightness(lCol, 29000),

+ 3 - 3
bgraflashprogressbar.pas

@@ -160,7 +160,7 @@ var
   var
     lCol: TBGRAPixel;
   begin
-    lCol := ColorToBGRA(ColorToRGB(Color));
+    lCol := Color;
 
     DoubleGradientAlphaFill(FBmp, bounds,
       ApplyLightness(lCol, 37000), ApplyLightness(lCol, 29000),
@@ -225,7 +225,7 @@ begin
     end;
   end;
   if Assigned(OnRedraw) then
-    OnRedraw(Self, FBmp, xpos);
+    OnRedraw(Self, FBmp, {%H-}xpos);
   FBmp.Draw(Canvas, 0, 0, False);
 end;
 
@@ -248,7 +248,7 @@ begin
   FBmp := nil;
   randomize;
   FRandSeed := randseed;
-  Color := BGRAToColor(BGRA(102, 163, 226));
+  Color := BGRA(102, 163, 226);
 end;
 
 destructor TBGRAFlashProgressBar.Destroy;

+ 1 - 1
bgraimagelist.pas

@@ -36,7 +36,7 @@ interface
 
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
-  GraphType, BGRABitmap, BGRABitmapTypes, ImgList;
+  GraphType, BGRABitmap, BGRABitmapTypes, {%H-}ImgList;
 
 {$IFDEF LCLgtk}
   {$DEFINE BGRA_DRAW}

+ 5 - 7
bgraimagemanipulation.pas

@@ -588,7 +588,7 @@ begin
       end;
 
       // Apply calculated dimensions of width on height
-      if (RecalculatesOtherAxis) then
+      if {%H-}(RecalculatesOtherAxis) then
       begin
         if (calcHeight > 0) then
           calcHeight := Trunc(calcWidth * (fRatio.Vertical / fRatio.Horizontal))
@@ -1323,9 +1323,9 @@ begin
 
   // Draw 3D border
   fBackground.CanvasBGRA.Frame3D(Border, 1, bvLowered,
-    ColorToBGRA(ColorToRGB(clBtnHighlight)), ColorToBGRA(ColorToRGB(cl3DDkShadow)));
+    clBtnHighlight, cl3DDkShadow);
   fBackground.CanvasBGRA.Frame3D(Border, 1, bvLowered,
-    ColorToBGRA(ColorToRGB(cl3DLight)), ColorToBGRA(ColorToRGB(clBtnShadow)));
+    cl3DLight, clBtnShadow);
 
   DrawCheckers(fBackground, Border);
 end;
@@ -2112,7 +2112,6 @@ end;
 procedure TBGRAImageManipulation.setKeepAspectRatio(const Value: boolean);
 Var
    i           :Integer;
-   curCropArea :TCropArea;
 
 begin
   if (Value <> fKeepAspectRatio) then
@@ -2157,7 +2156,6 @@ var
   Count, XValue, YValue: integer;
   AspectRatioText: string;
    i           :Integer;
-   curCropArea :TCropArea;
 
 begin
   if (Value <> fAspectRatio) then
@@ -2337,7 +2335,7 @@ begin
     fMouseCaught := True;
     fStartPoint  := Point(X - WorkRect.Left, Y - WorkRect.Top);
 
-    rSelectedCropArea :=Self.isOverAnchor(fStartPoint, fAnchorSelected, ACursor);
+    rSelectedCropArea :=Self.isOverAnchor(fStartPoint, fAnchorSelected, {%H-}ACursor);
 
     if (fAnchorSelected <> []) then
     begin
@@ -2370,7 +2368,7 @@ var
   Direction: TDirection;
   Bounds: TRect;
   overControl: boolean;
-  overCropArea :TCropArea;
+  {%H-}overCropArea :TCropArea;
   ACursor      :TCursor;
 
 begin

+ 2 - 2
bgraknob.pas

@@ -103,7 +103,7 @@ type
     { Streaming }
     procedure SaveToFile(AFileName: string);
     procedure LoadFromFile(AFileName: string);
-    procedure OnFindClass(Reader: TReader; const AClassName: string;
+    procedure OnFindClass({%H-}Reader: TReader; const AClassName: string;
       var ComponentClass: TComponentClass);
   published
     { Published declarations }
@@ -164,7 +164,7 @@ begin
 
   FKnobBmp := TBGRABitmap.Create(tx, ty);
   center := PointF((tx - 1) / 2, (ty - 1) / 2);
-  BGRAKnobColor := ColorToBGRA(ColorToRGB(KnobColor));
+  BGRAKnobColor := KnobColor;
 
   if UsePhongLighting then
   begin

+ 1 - 1
bgrapascalscriptcomponent.pas

@@ -8,7 +8,7 @@ unit bgrapascalscriptcomponent;
 interface
 
 uses
-  BGRAPascalScript, uPSI_BGRAPascalScript, LazarusPackageIntf;
+  uPSI_BGRAPascalScript, LazarusPackageIntf;
 
 implementation
 

+ 3 - 2
bgraresizespeedbutton.pas

@@ -50,8 +50,8 @@ type
   protected
     { Protected declarations }
     function DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
-      const AOffset: TPoint; AState: TButtonState; ATransparent: boolean;
-      BiDiFlags: longint): TRect; override;
+      const {%H-}AOffset: TPoint; AState: TButtonState; {%H-}ATransparent: boolean;
+      {%H-}BiDiFlags: longint): TRect; override;
   public
     { Public declarations }
     constructor Create(AOwner: TComponent); override;
@@ -69,6 +69,7 @@ function TBGRAResizeSpeedButton.DrawGlyph(ACanvas: TCanvas;
   ATransparent: boolean; BiDiFlags: longint): TRect;
 
 begin
+  Result := Rect(0, 0, 0, 0);
   if Glyph = nil then
     Exit;
   Result := AClient;

+ 1 - 1
bgraspriteanimation.pas

@@ -82,7 +82,7 @@ type
     function DoCalculateDestRect(AWidth, AHeight: integer): TRect;
     function DoCalculatePosition(AValue: integer): integer;
     function DoCalculateSize(AValue: cardinal): cardinal;
-    procedure DoAnimTimerOnTimer(Sender: TObject);
+    procedure DoAnimTimerOnTimer({%H-}Sender: TObject);
     procedure DoSpriteDraw(ABitmap: TBGRABitmap);
     procedure DoSpriteFillOpacity(ABitmap: TBGRABitmap);
     procedure DoSpriteFlip(ABitmap: TBGRABitmap);

+ 4 - 5
dtanalogclock.pas

@@ -40,7 +40,7 @@ interface
 
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
-  BGRABitmap, BGRABitmapTypes, BGRAGradients, DTAnalogCommon;
+  BGRABitmap, BGRABitmapTypes, BGRAGradients;
 
 type
   TClockStyle = (stlBlue, stlGreen, stlWhite);
@@ -57,9 +57,9 @@ type
     FTimer: TTimer;
     FResized: boolean;
     procedure SetClockStyle(AValue: TClockStyle);
-    procedure SetEnabled(AValue: boolean);
     { Private declarations }
   protected
+    procedure SetEnabled(AValue: boolean); override;
     { Protected declarations }
     procedure Paint; override;
     procedure DrawClock; virtual;
@@ -67,8 +67,8 @@ type
     procedure DrawMovingParts; virtual;
     procedure SwitchTimer;
 
-    procedure TimerEvent(Sender: TObject);
-    procedure ResizeEvent(Sender: TObject);
+    procedure TimerEvent({%H-}Sender: TObject);
+    procedure ResizeEvent({%H-}Sender: TObject);
   public
     { Public declarations }
     constructor Create(AOwner: TComponent); override;
@@ -140,7 +140,6 @@ end;
 procedure TDTCustomAnalogClock.DrawClockFace;
 var
   img: TBGRABitmap;
-  txt: TBGRACustomBitmap;
   A: integer;
   w, h, r, Xo, Yo, X, Y, Xt, Yt: integer;
   phong: TPhongShading;

+ 12 - 14
dtanalogcommon.pp

@@ -245,7 +245,7 @@ type
     procedure SetFaceSettings(AValue: TDTFaceSettings);
     procedure SetScaleSettings(AValue: TDTScaleSettings);
   protected
-    procedure DoChange(Sender: TObject);
+    procedure DoChange({%H-}Sender: TObject);
   public
     fGaugeBitmap: TBGRABitmap;
     FFrameBitmap: TBGRABitmap;
@@ -265,8 +265,6 @@ function Initializebitmap(var Bitmap: TBGRABitmap; Width, Height: integer): TDTO
 implementation
 
 function Initializebitmap(var Bitmap: TBGRABitmap; Width, Height: integer): TDTOrigin;
-var
-  x, y: integer;
 begin
 
   Bitmap.SetSize(Width, Height);
@@ -397,7 +395,7 @@ end;
 
 constructor TDTPointerSettings.Create;
 begin
-  FColor := BGRAToColor(BGRA(199, 199, 173));
+  FColor := BGRA(199, 199, 173);
   FLength := 100;
   FThickness := 3;
 end;
@@ -499,7 +497,7 @@ begin
   // Draw Bitmap frame
   FFrameBitmap.FillEllipseAntialias(Origin.CenterPoint.x,
     Origin.CenterPoint.y,
-    r, r, ColorToBGRA(FFaceSettings.ColorFrame));
+    r, r, FFaceSettings.ColorFrame);
 
   // Draw thin antialiased border to smooth against background
   FFrameBitmap.EllipseAntialias(Origin.CenterPoint.x,
@@ -522,7 +520,7 @@ begin
     fsGradient:
       FFaceBitmap.FillEllipseLinearColorAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, r, r, ColorToBGRA(FFaceSettings.ColorStart), ColorToBGRA(FFaceSettings.ColorEnd));
     fsnone:
-      FFaceBitmap.FillEllipseAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, r, r, ColorToBGRA(FFaceSettings.ColorStart));
+      FFaceBitmap.FillEllipseAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, r, r, FFaceSettings.ColorStart);
   end;
 
 end;
@@ -601,12 +599,12 @@ end;
 
 constructor TDTNeedleSettings.Create;
 begin
-  FCapColor := BGRAToColor(BGRA(63, 63, 63));
-  FCapEdgeColor := BGRAToColor(BGRA(220, 220, 204));
+  FCapColor := BGRA(63, 63, 63);
+  FCapEdgeColor := BGRA(220, 220, 204);
   FCapRadius := 10;
 
   FNeedleStyle := nsLine;
-  FNeedleColor := BGRAToColor(BGRA(255, 81, 81));
+  FNeedleColor := BGRA(255, 81, 81);
   FNeedleLength := 100;
 end;
 
@@ -619,8 +617,8 @@ end;
 
 constructor TDTScaleSettings.Create;
 begin
-  FTickColor := BGRAToColor(bgra(223, 196, 125));
-  FTextColor := BGRAToColor(bgra(140, 208, 211));
+  FTickColor := bgra(223, 196, 125);
+  FTextColor := bgra(140, 208, 211);
   FTextFont := 'Calibri';
   FTextSize := 15;
   FEnableMainTicks := True;
@@ -833,9 +831,9 @@ end;
 
 constructor TDTFaceSettings.Create;
 begin
-  FColorFrame := BGRAToColor(BGRA(35, 35, 35));
-  FColorStart := BGRAToColor(BGRA(63, 63, 63));
-  FColorEnd := BGRAToColor(BGRA(93, 93, 93));
+  FColorFrame := BGRA(35, 35, 35);
+  FColorStart := BGRA(63, 63, 63);
+  FColorEnd := BGRA(93, 93, 93);
   FFillStyle := fsGradient;
 end;
 

+ 13 - 16
dtanaloggauge.pp

@@ -62,7 +62,7 @@ type
     FGaugeNeedleBitmap: TBGRABitmap;
     FScaleSettings: TDTScaleSettings;
     procedure SetFaceSettings(AValue: TDTFaceSettings);
-    procedure DoChange(Sender: TObject);
+    procedure DoChange({%H-}Sender: TObject);
     procedure SetGaugeStyle(AValue: TDTGaugeStyle);
     procedure SetNeedleSettings(AValue: TDTNeedleSettings);
     procedure SetPosition(AValue: integer);
@@ -70,7 +70,7 @@ type
     { Private declarations }
   protected
     { Protected declarations }
-    procedure ResizeEvent(Sender: TObject);
+    procedure ResizeEvent({%H-}Sender: TObject);
     procedure ClearBitMap(var BitMap: TBGRABitmap);
   public
     { Public declarations }
@@ -202,7 +202,7 @@ end;
 
 procedure TDTCustomAnalogGauge.DrawGaugeBody;
 var
-  w, h, r, Xo, Yo: integer;
+  r: integer;
   origin: TDTOrigin;
 begin
 
@@ -214,7 +214,7 @@ begin
   // Draw Bitmap frame
   FGaugeBodyBitmap.FillEllipseAntialias(origin.CenterPoint.x,
     origin.CenterPoint.y,
-    r, r, ColorToBGRA(FFaceSettings.ColorFrame));
+    r, r, FFaceSettings.ColorFrame);
 
   // Draw thin antialiased border to smooth against background
   FGaugeBodyBitmap.EllipseAntialias(origin.CenterPoint.x,
@@ -225,9 +225,7 @@ end;
 
 procedure TDTCustomAnalogGauge.DrawGaugeRange;
 var
-  w, h, r, Xo, Yo, X, Y, Xt, Yt: integer;
-  n: integer;
-  j: single;
+  {%H-}r, w, h, Xo, Yo: integer;
 begin
 
   ClearBitMap(FGaugeScaleBitmap);
@@ -257,7 +255,6 @@ end;
 procedure TDTCustomAnalogGauge.DrawGaugeFace;
 var
   w, h, r, Xo, Yo: integer;
-  origin: TDTOrigin;
 begin
   ClearBitMap(FGaugeScaleBitmap);
 
@@ -285,9 +282,9 @@ begin
   // Draw face background
   case FFaceSettings.FillStyle of
     fsGradient:
-      FGaugeBodyBitmap.FillEllipseLinearColorAntialias(Xo, Yo, r, r, ColorToBGRA(FFaceSettings.ColorStart), ColorToBGRA(FFaceSettings.ColorEnd));
+      FGaugeBodyBitmap.FillEllipseLinearColorAntialias(Xo, Yo, r, r, FFaceSettings.ColorStart, ColorToBGRA(FFaceSettings.ColorEnd));
     fsnone:
-      FGaugeBodyBitmap.FillEllipseAntialias(Xo, Yo, r, r, ColorToBGRA(FFaceSettings.ColorStart));
+      FGaugeBodyBitmap.FillEllipseAntialias(Xo, Yo, r, r, FFaceSettings.ColorStart);
   end;
 
 
@@ -351,7 +348,7 @@ begin
       Xt := xo - Round(((r * 0.85) - FScaleSettings.LengthSubTick) * cos((j + i * FScaleSettings.Angle / n) * Pi / 180));
       Yt := yo - Round(((r * 0.85) - FScaleSettings.LengthSubTick) * sin((j + i * FScaleSettings.Angle / n) * Pi / 180));
 
-      FGaugeScaleBitmap.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(FScaleSettings.TickColor), FScaleSettings.ThicknessSubTick);
+      FGaugeScaleBitmap.DrawLineAntialias(x, y, xt, yt, FScaleSettings.TickColor, FScaleSettings.ThicknessSubTick);
 
     end;
   end;
@@ -376,7 +373,7 @@ begin
       Xt := xo - Round(((r * 0.85) - FScaleSettings.LengthMainTick) * cos((j + i * FScaleSettings.Angle / n) * Pi / 180));
       Yt := yo - Round(((r * 0.85) - FScaleSettings.LengthMainTick) * sin((j + i * FScaleSettings.Angle / n) * Pi / 180));
 
-      FGaugeScaleBitmap.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(FScaleSettings.TickColor), FScaleSettings.ThicknessMainTick);
+      FGaugeScaleBitmap.DrawLineAntialias(x, y, xt, yt, FScaleSettings.TickColor, FScaleSettings.ThicknessMainTick);
 
       // Draw text for main ticks
       Xt := xo - Round((r - FScaleSettings.LengthMainTick) * 0.7 * cos((j + i * FScaleSettings.Angle / n) * Pi / 180));
@@ -385,7 +382,7 @@ begin
       FGaugeScaleBitmap.TextOut(Xt, Yt - (FGaugeScaleBitmap.FontHeight / 1.7),
         IntToStr(i * FScaleSettings.Maximum div FScaleSettings.MainTickCount),
         //ColorToBGRA(FScaleSettings.TickColor),
-        ColorToBGRA(FScaleSettings.TextColor),
+        FScaleSettings.TextColor,
         taCenter);
     end;
   end;
@@ -419,7 +416,7 @@ begin
       Y := yo - Round(FNeedleSettings.NeedleLength * sin((j + Position * FScaleSettings.Angle / FScaleSettings.Maximum) * Pi / 180));
 
       FGaugeNeedleBitmap.DrawLineAntialias(xo, yo, x, y,
-        ColorToBGRA(FNeedleSettings.NeedleColor),
+        FNeedleSettings.NeedleColor,
         FScaleSettings.ThicknessMainTick);
     end;
     nsTriangle:
@@ -431,8 +428,8 @@ begin
   // Draw cap over needle
   FGaugeNeedleBitmap.EllipseAntialias(Xo, Yo, FNeedleSettings.CapRadius,
     FNeedleSettings.CapRadius,
-    ColorToBGRA(FNeedleSettings.CapEdgeColor),
-    2, ColorToBGRA(FNeedleSettings.CapColor));
+    FNeedleSettings.CapEdgeColor,
+    2, FNeedleSettings.CapColor);
 
 end;
 

+ 13 - 13
dtthemedclock.pas

@@ -57,7 +57,6 @@ type
     FPosition: integer;
     FSecondsPointerSettings: TDTPointerSettings;
     FTimer: TTimer;
-    procedure SetEnabled(AValue: boolean);
     procedure SetHoursPointerSettings(AValue: TDTPointerSettings);
     procedure SetMinutesPointerSettings(AValue: TDTPointerSettings);
     procedure SetPointerCapSettings(AValue: TDTPointerCapSettings);
@@ -65,6 +64,7 @@ type
     procedure SetSecondsPointerSettings(AValue: TDTPointerSettings);
     { Private declarations }
   protected
+    procedure SetEnabled(AValue: boolean); override;
     { Protected declarations }
     property SecondsPointerSettings: TDTPointerSettings read FSecondsPointerSettings write SetSecondsPointerSettings;
     property MinutesPointerSettings: TDTPointerSettings read FMinutesPointerSettings write SetMinutesPointerSettings;
@@ -72,7 +72,7 @@ type
     property PointerCapSettings: TDTPointerCapSettings read FPointerCapSettings write SetPointerCapSettings;
     property Position: integer read FPosition write SetPosition;
     property Enabled: boolean read FEnabled write SetEnabled;
-    procedure TimerEvent(Sender: TObject);
+    procedure TimerEvent({%H-}Sender: TObject);
   public
     { Public declarations }
     constructor Create(AOwner: TComponent); override;
@@ -191,15 +191,15 @@ begin
   FClockFace := TBGRABitmap.Create;
   FPointerBitmap := TBGRABitmap.Create;
 
-  FSecondsPointerSettings.Color := BGRAToColor(BGRA(255, 81, 81));
+  FSecondsPointerSettings.Color := BGRA(255, 81, 81);
   FSecondsPointerSettings.Length := 80;
   FSecondsPointerSettings.Thickness := 3;
 
-  FMinutesPointerSettings.Color := BGRAToColor(BGRA(199, 199, 173));
+  FMinutesPointerSettings.Color := BGRA(199, 199, 173);
   FMinutesPointerSettings.Length := 80;
   FMinutesPointerSettings.Thickness := 3;
 
-  FHoursPointerSettings.Color := BGRAToColor(BGRA(199, 199, 173));
+  FHoursPointerSettings.Color := BGRA(199, 199, 173);
   FHoursPointerSettings.Length := 60;
   FHoursPointerSettings.Thickness := 5;
 
@@ -265,7 +265,7 @@ begin
       xt := Origin.CenterPoint.x + Round((r - ScaleSettings.LengthSubTick) * sin(6 * i * Pi / 180));
       yt := Origin.CenterPoint.y - Round((r - ScaleSettings.LengthSubTick) * cos(6 * i * Pi / 180));
 
-      FClockFace.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(ScaleSettings.TickColor), ScaleSettings.ThicknessSubTick);
+      FClockFace.DrawLineAntialias(x, y, xt, yt, ScaleSettings.TickColor, ScaleSettings.ThicknessSubTick);
     end;
   end;
 
@@ -282,7 +282,7 @@ begin
       xt := Origin.CenterPoint.x + Round((r - ScaleSettings.LengthMainTick) * sin(30 * i * Pi / 180));
       yt := Origin.CenterPoint.y - Round((r - ScaleSettings.LengthMainTick) * cos(30 * i * Pi / 180));
 
-      FClockFace.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(ScaleSettings.TickColor), ScaleSettings.ThicknessMainTick);
+      FClockFace.DrawLineAntialias(x, y, xt, yt, ScaleSettings.TickColor, ScaleSettings.ThicknessMainTick);
 
       if ScaleSettings.EnableScaleText then
       begin
@@ -294,7 +294,7 @@ begin
         xt := Origin.CenterPoint.x + Round(ScaleSettings.TextRadius * sin(30 * i * Pi / 180));
         yt := Origin.CenterPoint.y - Round(ScaleSettings.TextRadius * cos(30 * i * Pi / 180));
 
-        FClockFace.TextOut(Xt, Yt - (FClockFace.FontHeight / 1.7), IntToStr(i), ColorToBGRA(ScaleSettings.TextColor), taCenter);
+        FClockFace.TextOut(Xt, Yt - (FClockFace.FontHeight / 1.7), IntToStr(i), ScaleSettings.TextColor, taCenter);
       end;
 
     end;
@@ -305,7 +305,7 @@ end;
 procedure TDTCustomThemedClock.DrawPointers;
 var
   Origin: TDTOrigin;
-  r, i, x, y, xt, yt: integer;
+  {%H-}r: integer;
   Xs, Ys, Xm, Ym, Xh, Yh: integer;
   th, tm, ts, tn: word;
 begin
@@ -329,12 +329,12 @@ begin
   Xh := Origin.CenterPoint.x + Round(HoursPointerSettings.Length * Sin((th * 30 + tm / 2) * Pi / 180));
   Yh := Origin.CenterPoint.y - Round(HoursPointerSettings.Length * Cos((th * 30 + tm / 2) * Pi / 180));
 
-  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xs, ys, ColorToBGRA(SecondsPointerSettings.Color), SecondsPointerSettings.Thickness);
-  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xm, ym, ColorToBGRA(MinutesPointerSettings.Color), MinutesPointerSettings.Thickness);
-  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xh, yh, ColorToBGRA(HoursPointerSettings.Color), HoursPointerSettings.Thickness);
+  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xs, ys, SecondsPointerSettings.Color, SecondsPointerSettings.Thickness);
+  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xm, ym, MinutesPointerSettings.Color, MinutesPointerSettings.Thickness);
+  FPointerBitmap.DrawLineAntialias(Origin.CenterPoint.x, Origin.CenterPoint.y, xh, yh, HoursPointerSettings.Color, HoursPointerSettings.Thickness);
 
   // Draw cap over needle
-  FPointerBitmap.EllipseAntialias(origin.CenterPoint.x, origin.CenterPoint.y, PointerCapSettings.Radius, PointerCapSettings.Radius, ColorToBGRA(PointerCapSettings.EdgeColor), 2, ColorToBGRA(PointerCapSettings.FillColor));
+  FPointerBitmap.EllipseAntialias(origin.CenterPoint.x, origin.CenterPoint.y, PointerCapSettings.Radius, PointerCapSettings.Radius, PointerCapSettings.EdgeColor, 2, ColorToBGRA(PointerCapSettings.FillColor));
 
 
 end;

+ 8 - 8
dtthemedgauge.pp

@@ -40,7 +40,7 @@ interface
 
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, DTAnalogCommon,
-  BGRABitmap, BGRABitmapTypes, DTAnalogClock;
+  BGRABitmap, BGRABitmapTypes;
 
 type
 
@@ -144,7 +144,7 @@ begin
 
   FPointerSettings := TDTPointerSettings.Create;
   FPointerSettings.OnChange := @DoChange;
-  FPointerSettings.Color := BGRAToColor(BGRA(255, 81, 81));
+  FPointerSettings.Color := BGRA(255, 81, 81);
 
   FPointerCapSettings := TDTPointerCapSettings.Create;
   FPointerCapSettings.OnChange := @DoChange;
@@ -209,7 +209,7 @@ begin
       Xt := Origin.CenterPoint.x - Round((r - ScaleSettings.LengthSubTick) * cos((j + i * 270 / n) * Pi / 180));
       Yt := Origin.CenterPoint.y - Round((r - ScaleSettings.LengthSubTick) * sin((j + i * 270 / n) * Pi / 180));
 
-      FScaleBitmap.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(ScaleSettings.TickColor), ScaleSettings.ThicknessSubTick);
+      FScaleBitmap.DrawLineAntialias(x, y, xt, yt, ScaleSettings.TickColor, ScaleSettings.ThicknessSubTick);
 
     end;
   end;
@@ -234,7 +234,7 @@ begin
       Xt := Origin.CenterPoint.x - Round((r - ScaleSettings.LengthMainTick) * cos((j + i * 270 / n) * Pi / 180));
       Yt := Origin.CenterPoint.y - Round((r - ScaleSettings.LengthMainTick) * sin((j + i * 270 / n) * Pi / 180));
 
-      FScaleBitmap.DrawLineAntialias(x, y, xt, yt, ColorToBGRA(ScaleSettings.TickColor), ScaleSettings.ThicknessMainTick);
+      FScaleBitmap.DrawLineAntialias(x, y, xt, yt, ScaleSettings.TickColor, ScaleSettings.ThicknessMainTick);
 
       if ScaleSettings.EnableScaleText then
       begin
@@ -242,7 +242,7 @@ begin
         Xt := Origin.CenterPoint.x - Round(ScaleSettings.TextRadius * cos((j + i * 270 / n) * Pi / 180));
         Yt := Origin.CenterPoint.y - Round(ScaleSettings.TextRadius * sin((j + i * 270 / n) * Pi / 180));
 
-        FScaleBitmap.TextOut(Xt, Yt - (FScaleBitmap.FontHeight / 1.7), IntToStr(i * ScaleSettings.Maximum div ScaleSettings.MainTickCount), ColorToBGRA(ScaleSettings.TextColor), taCenter);
+        FScaleBitmap.TextOut(Xt, Yt - (FScaleBitmap.FontHeight / 1.7), IntToStr(i * ScaleSettings.Maximum div ScaleSettings.MainTickCount), ScaleSettings.TextColor, taCenter);
       end;
     end;
   end;
@@ -251,7 +251,7 @@ end;
 procedure TDTCustomThemedGauge.DrawPointer;
 var
   Origin: TDTOrigin;
-  r, i, n, x, y, xt, yt: integer;
+  {%H-}r, x, y: integer;
   j: single;
 begin
 
@@ -264,10 +264,10 @@ begin
   X := origin.CenterPoint.x - Round(PointerSettings.Length * cos((j + Position * 270 / ScaleSettings.Maximum) * Pi / 180));
   Y := origin.CenterPoint.y - Round(PointerSettings.Length * sin((j + Position * 270 / ScaleSettings.Maximum) * Pi / 180));
 
-  FPointerBitmap.DrawLineAntialias(origin.CenterPoint.y, origin.CenterPoint.y, x, y, ColorToBGRA(PointerSettings.Color), PointerSettings.Thickness);
+  FPointerBitmap.DrawLineAntialias(origin.CenterPoint.y, origin.CenterPoint.y, x, y, PointerSettings.Color, PointerSettings.Thickness);
 
   // Draw cap over needle
-  FPointerBitmap.EllipseAntialias(origin.CenterPoint.x, origin.CenterPoint.y, PointerCapSettings.Radius, PointerCapSettings.Radius, ColorToBGRA(PointerCapSettings.EdgeColor), 2, ColorToBGRA(PointerCapSettings.FillColor));
+  FPointerBitmap.EllipseAntialias(origin.CenterPoint.x, origin.CenterPoint.y, PointerCapSettings.Radius, PointerCapSettings.Radius, PointerCapSettings.EdgeColor, 2, ColorToBGRA(PointerCapSettings.FillColor));
 end;
 
 end.

+ 2 - 2
mouseandkeyinput/mouseinputintf.pas

@@ -133,8 +133,8 @@ begin
   begin
     TimeStep := Min(Interval, Duration);
 
-    S := GetTickCount;
-    while GetTickCount - S < TimeStep do Application.ProcessMessages;
+    S := {%H-}GetTickCount;
+    while {%H-}GetTickCount - S < TimeStep do Application.ProcessMessages;
     
     X := Start.X + ((ScreenX - Start.X) * TimeStep) div Duration;
     Y := Start.Y + ((ScreenY - Start.Y) * TimeStep) div Duration;

+ 1 - 1
mouseandkeyinput/winkeyinput.pas

@@ -48,7 +48,7 @@ procedure SendKeyInput(Flag: DWORD; Key: Word);
 var
   Input: TInput;
 begin
-  FillChar(Input, SizeOf(Input), 0);
+  FillChar({%H-}Input, SizeOf(Input), 0);
   Input.type_ := INPUT_KEYBOARD;
   Input.ki.dwFlags := Flag;
   Input.ki.wVk := Key;

+ 3 - 3
test/BGRA Ribbon Custom/BGRA Ribbon.lpi

@@ -9,14 +9,14 @@
       <Title Value="BGRA Ribbon"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
       <Icon Value="0"/>
     </General>
     <i18n>
       <EnableI18N LFM="False"/>
     </i18n>
-    <VersionInfo>
-      <StringTable ProductVersion=""/>
-    </VersionInfo>
     <BuildModes Count="1">
       <Item1 Name="Default" Default="True"/>
     </BuildModes>

+ 1 - 1
test/BGRA Ribbon Custom/uMain.pas

@@ -612,7 +612,7 @@ begin
 
   { Determining the width/height of Caption. We need only width }
   tw := ABGRA.TextSize(mytext).cx;
-  c := ColorToBGRA(uRibbon.BtnFntColor);
+  c := uRibbon.BtnFntColor;
 
   if tw > TBCButton(Sender).Width then
   begin

+ 5 - 5
test/BGRA Ribbon Custom/uRibbon.pas

@@ -108,7 +108,7 @@ var
 begin
   with ABitmap do
   begin
-    Fill(ColorToBGRA(MainColor));
+    Fill(MainColor);
     try
     begin
 //      bmp := TBGRABitmap.Create('back5.png');
@@ -120,7 +120,7 @@ begin
     end;
 
 //    DrawHorizLine(0, 0, Width - 1, ColorToBGRA(MainColor));
-    DrawHorizLine(1, Height - 1, Width - 2, ColorToBGRA($00F1F1F1));
+    DrawHorizLine(1, Height - 1, Width - 2, $00F1F1F1);
   end;
 end;
 
@@ -130,7 +130,7 @@ var
 begin
   with ABitmap do
   begin
-    Fill(ColorToBGRA(MainColor));
+    Fill(MainColor);
     try
     begin
       bmp := TBGRABitmap.Create('back5.png');
@@ -150,7 +150,7 @@ begin
     Rectangle(0, 0, Width, Height - 2, BGRA(255, 255, 255, 75), BGRAPixelTransparent,
       dmDrawWithTransparency);
 }
-    DrawHorizLine(1, Height - 1, Width - 2, ColorToBGRA($00D2D2D2)); //Top
+    DrawHorizLine(1, Height - 1, Width - 2, $00D2D2D2); //Top
 //    DrawVertLine(Width-1, 0, Height-1, ColorToBGRA(MainColor));  //Right
 //    DrawVertLine(0, 0, Height-1, ColorToBGRA(MainColor)); //Left
 
@@ -164,7 +164,7 @@ begin
 //    DrawVertLine(Width-1, 0, Height-1, ColorToBGRA(MainColor));  //Right
 //    DrawHorizLine(0, Height - 1, Width - 1, ColorToBGRA(MainColor)); // Bottom
 //    DrawVertLine(0, 0, Height-1, ColorToBGRA(MainColor)); //Left
-    DrawHorizLine(1, 0, Width - 2, ColorToBGRA($00E6E6E6)); // Top
+    DrawHorizLine(1, 0, Width - 2, $00E6E6E6); // Top
 //    GradientFill(0, 0, Width, Height, BGRA(197, 207, 223, 255),
 //      BGRA(220, 229, 242, 255), gtLinear, PointF(0, 0), PointF(0, Height), dmSet);
   end;

+ 2 - 2
test/test_materialcolors/umain.pas

@@ -51,9 +51,9 @@ begin
   else
   begin
     BCMaterialDesignButton1.NormalColor :=
-      BGRAToColor(MaterialColorsList.KeyData[ComboBox1.Caption].M500);
+      MaterialColorsList.KeyData[ComboBox1.Caption].M500;
     BCMaterialDesignButton1.NormalColorEffect :=
-      BGRAToColor(MaterialColorsList.KeyData[ComboBox1.Caption].M50);
+      MaterialColorsList.KeyData[ComboBox1.Caption].M50;
     BCMaterialDesignButton1.TextColor :=
       GetContrastColor(BCMaterialDesignButton1.NormalColor);
   end;

+ 2 - 2
upsi_bgrapascalscript.pas

@@ -55,9 +55,9 @@ uses
 type 
 (*----------------------------------------------------------------------------*)
   TPSImport_BGRAPascalScript = class(TPSPlugin)
-  protected
+  public
     procedure CompileImport1(CompExec: TPSScript); override;
-    procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
+    procedure ExecImport1(CompExec: TPSScript; const {%H-}ri: TPSRuntimeClassImporter); override;
   end;