diff --git a/Demo/Projects/D10_4/ModernAppDemo.dproj b/Demo/Projects/D10_4/ModernAppDemo.dproj index 058522b..95a97a6 100644 --- a/Demo/Projects/D10_4/ModernAppDemo.dproj +++ b/Demo/Projects/D10_4/ModernAppDemo.dproj @@ -166,13 +166,6 @@ - Microsoft Office XP Sample Automation Server Wrapper Components - Ethea InstantSolutions 6 ReportBuilder Components - Ethea InstantSolutions 6 Rtl Library - Ethea InstantSolutions 6 Vcl Library - Ethea InstantSolutions 6 LibreOffice/OpenOffice Components - Ethea InstantSolutions 6 Framework Library - Microsoft Office 2000 Sample Automation Server Wrapper Components ModernAppDemo.dpr diff --git a/Demo/Projects/D10_4/VCLThemeSelectorLauncher.dproj b/Demo/Projects/D10_4/VCLThemeSelectorLauncher.dproj index 68715f1..ee0f802 100644 --- a/Demo/Projects/D10_4/VCLThemeSelectorLauncher.dproj +++ b/Demo/Projects/D10_4/VCLThemeSelectorLauncher.dproj @@ -54,7 +54,7 @@ false false false - "Aqua Light Slate|VCLSTYLE|$(BDSCOMMONDIR)\Styles\AquaLightSlate.vsf";CopperDark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\CopperDark.vsf;Glow|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Glow.vsf;"Iceberg Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\IcebergClassico.vsf";"Lavender Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\LavenderClassico.vsf";Sky|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Sky.vsf;"Slate Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\SlateClassico.vsf";"Tablet Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\TabletDark.vsf";"Tablet Light|VCLSTYLE|$(BDSCOMMONDIR)\Styles\TabletLight.vsf";Windows10|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10.vsf;"Windows10 Blue|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Blue.vsf";"Windows10 Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Dark.vsf";"Windows10 Green|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Green.vsf";"Windows10 Purple|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Purple.vsf";"Windows10 SlateGray|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10SlateGray.vsf" + "Aqua Light Slate|VCLSTYLE|$(BDSCOMMONDIR)\Styles\AquaLightSlate.vsf";CopperDark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\CopperDark.vsf;Glow|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Glow.vsf;"Iceberg Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\IcebergClassico.vsf";"Lavender Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\LavenderClassico.vsf";Sky|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Sky.vsf;"Slate Classico|VCLSTYLE|$(BDSCOMMONDIR)\Styles\SlateClassico.vsf";"Tablet Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\TabletDark.vsf";"Tablet Light|VCLSTYLE|$(BDSCOMMONDIR)\Styles\TabletLight.vsf";Windows10|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10.vsf;"Windows10 Blue|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Blue.vsf";"Windows10 Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Dark.vsf";"Windows10 Green|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Green.vsf";"Windows10 Purple|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Purple.vsf";"Windows10 SlateGray|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10SlateGray.vsf";"Windows11 Modern Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows11_Modern_Dark.vsf";"Windows11 Modern Light|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows11_Modern_Light.vsf" 1033 @@ -129,8 +129,6 @@ VCLThemeSelectorLauncher.dpr - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components diff --git a/Demo/Projects/D10_4/VCLThemeSelectorLauncher.res b/Demo/Projects/D10_4/VCLThemeSelectorLauncher.res index bcad57e..409278c 100644 Binary files a/Demo/Projects/D10_4/VCLThemeSelectorLauncher.res and b/Demo/Projects/D10_4/VCLThemeSelectorLauncher.res differ diff --git a/Demo/Source/DImageCollections.dfm b/Demo/Source/DImageCollections.dfm index fdfc756..88e1c91 100644 --- a/Demo/Source/DImageCollections.dfm +++ b/Demo/Source/DImageCollections.dfm @@ -1,7 +1,7 @@ object ImageCollectionDataModule: TImageCollectionDataModule + OldCreateOrder = True Height = 302 Width = 584 - PixelsPerInch = 144 object SVGIconImageCollection: TSVGIconImageCollection SVGIconItems = < item diff --git a/Demo/Source/DImageCollections.pas b/Demo/Source/DImageCollections.pas index 18c0bc6..c748a97 100644 --- a/Demo/Source/DImageCollections.pas +++ b/Demo/Source/DImageCollections.pas @@ -3,7 +3,7 @@ { A full example of an HighDPI - VCL Themed enabled application } { See how to select the application Theme using VCLThemeSelector Form } { } -{ Copyright (c) 2020, 2021 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { https://github.com/EtheaDev/VCLThemeSelector } { } diff --git a/Demo/Source/EditForm.pas b/Demo/Source/EditForm.pas index 8b833b7..8e2647c 100644 --- a/Demo/Source/EditForm.pas +++ b/Demo/Source/EditForm.pas @@ -3,7 +3,7 @@ { A full example of an HighDPI - VCL Themed enabled application } { See how to select the application Theme using VCLThemeSelector Form } { } -{ Copyright (c) 2020, 2021 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { https://github.com/EtheaDev/VCLThemeSelector } { } diff --git a/Demo/Source/LauncherForm.pas b/Demo/Source/LauncherForm.pas index 171c0e6..c9d149a 100644 --- a/Demo/Source/LauncherForm.pas +++ b/Demo/Source/LauncherForm.pas @@ -2,7 +2,7 @@ { VCLThemeSelector Launcher by Carlo Barazzetta } { A simple example to launch VCLThemeSelector } { } -{ Copyright (c) 2020, 2021 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { https://github.com/EtheaDev/VCLThemeSelector } { } @@ -113,4 +113,10 @@ procedure TLauncher.Loaded; inherited; end; +initialization + //Example: how to add a new style not present into VCLThemeSelectorLauncher.InitDefaultThemesAttributes + //download 'Radiant VCL Premium Style' from GetIt Package Manager and add to the + //appearance section of this application + RegisterThemeAttributes('Radiant', ttLight, clWebLightYellow, clWebLightgrey); + end. diff --git a/Demo/Source/uSplitView.pas b/Demo/Source/uSplitView.pas index c3c1e82..b0bff41 100644 --- a/Demo/Source/uSplitView.pas +++ b/Demo/Source/uSplitView.pas @@ -3,7 +3,7 @@ { A full example of an HighDPI - VCL Themed enabled application } { See how to select the application Theme using VCLThemeSelector Form } { } -{ Copyright (c) 2020, 2021 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { https://github.com/EtheaDev/VCLThemeSelector } { } diff --git a/Ext/VCLStyleUtils/Common/VCL.Styles.Utils.inc b/Ext/VCLStyleUtils/Common/VCL.Styles.Utils.inc index 5c44b23..087efdf 100644 --- a/Ext/VCLStyleUtils/Common/VCL.Styles.Utils.inc +++ b/Ext/VCLStyleUtils/Common/VCL.Styles.Utils.inc @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************ diff --git a/Ext/VCLStyleUtils/Common/Vcl.PlatformVclStylesActnCtrls.pas b/Ext/VCLStyleUtils/Common/Vcl.PlatformVclStylesActnCtrls.pas index 3b0dece..670c0e4 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.PlatformVclStylesActnCtrls.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.PlatformVclStylesActnCtrls.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.PlatformVclStylesActnCtrls // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** @@ -409,7 +409,7 @@ procedure TThemedDropDownButtonEx.DrawBackground(var PaintRect: TRect); const CheckedState: array[Boolean] of TThemedToolBar = (ttbButtonHot, ttbButtonCheckedHot); var - LIndex : Integer; + LIndex: Integer; begin LIndex := SaveDC(Canvas.Handle); try diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.ColorTabs.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.ColorTabs.pas index ea11239..8137fbc 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.ColorTabs.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.ColorTabs.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.ColorTabs // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -84,9 +84,11 @@ TTabControlStyleHookHelper = class helper for TTabControlStyleHook End; class function TCustomStyleEngineHelper.GetRegisteredStyleHooks - : TStyleHookDictionary; +: TStyleHookDictionary; +{$IF (CompilerVersion >=31)} var p: Pointer; +{$IFEND} begin {$IF (CompilerVersion <31)} Result := Self.FRegisteredStyleHooks; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.ControlColor.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.ControlColor.pas index 5012b09..73a46cf 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.ControlColor.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.ControlColor.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.ControlColor // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.DPIAware.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.DPIAware.pas index 757815e..cde0918 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.DPIAware.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.DPIAware.pas @@ -5,7 +5,7 @@ TMyForm = class(TForm) private - FStyleDPIAwareness : TStyleDPIAwareness; + FStyleDPIAwareness: TStyleDPIAwareness; procedure TFrmMain.FormCreate(Sender: TObject); begin @@ -40,7 +40,7 @@ TMyForm = class(TForm) procedure TFrmMain.FormCreate(Sender: TObject); Var - StyleDPIAwareness : TStyleDPIAwareness; + StyleDPIAwareness: TStyleDPIAwareness; begin StyleDPIAwareness := TStyleDPIAwareness.Create(Self); StyleDPIAwareness.Parent := Self; @@ -75,10 +75,10 @@ TStyleDPI = class(TObject) TStyleDPIAwareness = class(TControl) private - FScaledStyles : TStringList; - FRoundScalingFactor : Boolean; - FUseCustomScalingFactor : Boolean; - FCustomPPI : integer; + FScaledStyles: TStringList; + FRoundScalingFactor: Boolean; + FUseCustomScalingFactor: Boolean; + FCustomPPI: integer; FOldDPI: Integer; protected procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED; @@ -88,14 +88,14 @@ TStyleDPIAwareness = class(TControl) destructor Destroy; override; procedure AfterDPIChange(OldDPI, NewDPI: Integer); procedure BeforeDPIChange(OldDPI, NewDPI: Integer); - procedure ScaleStyle(Style : TCustomStyleServices); + procedure ScaleStyle(Style: TCustomStyleServices); property OldDPI: Integer read FOldDPI write FOldDPI; published - property RoundScalingFactor : Boolean read FRoundScalingFactor + property RoundScalingFactor: Boolean read FRoundScalingFactor write FRoundScalingFactor default True; - property UseCustomScalingFactor : Boolean read FUseCustomScalingFactor + property UseCustomScalingFactor: Boolean read FUseCustomScalingFactor write FUseCustomScalingFactor default False; - property CustomPPI : integer read FCustomPPI write FCustomPPI default 96; + property CustomPPI: integer read FCustomPPI write FCustomPPI default 96; end; implementation @@ -141,7 +141,7 @@ constructor TStyleDPIAwareness.Create(AOwner: TComponent); destructor TStyleDPIAwareness.Destroy; var - i : Integer; + i: Integer; begin for i := 0 to FScaledStyles.Count - 1 do TStyleDPI(FScaledStyles.Objects[i]).Free; @@ -161,7 +161,7 @@ procedure TStyleDPIAwareness.BeforeDPIChange(OldDPI, NewDPI: Integer); procedure TStyleDPIAwareness.RecreateForms; Var - i : Integer; + i: Integer; begin for i := 0 to Screen.FormCount - 1 do begin @@ -172,19 +172,19 @@ procedure TStyleDPIAwareness.RecreateForms; procedure TStyleDPIAwareness.ScaleStyle(Style: TCustomStyleServices); Var - NewDPI : integer; - SeStyle : TObject; - SeStyleSource : TObject; - BitmapList : TList; - BitMap : TBitmap; - StyleObjectList : Tlist; + NewDPI: integer; + SeStyle: TObject; + SeStyleSource: TObject; + BitmapList: TList; + BitMap: TBitmap; + StyleObjectList: Tlist; i,n: integer; - StyleObject : TComponent; + StyleObject: TComponent; obj: TStyleDPI; - procedure ProcessBitmapLink(BL : TObject); + procedure ProcessBitmapLink(BL: TObject); Var - BLType : TRTTIType; + BLType: TRTTIType; begin BLType := TRttiContext.Create.GetType(BL.ClassType); BLType.GetProperty('Bottom').SetValue(BL, Round((BLType.GetProperty('Bottom').GetValue(BL).AsInteger * NewDPI - 1) / OldDPI)); @@ -193,7 +193,7 @@ procedure TStyleDPIAwareness.ScaleStyle(Style: TCustomStyleServices); BLType.GetProperty('Top').SetValue(BL, Round(BLType.GetProperty('Top').GetValue(BL).AsInteger * NewDPI / OldDPI)); end; - procedure ProcessSO(aSO : TComponent; aSOType : TRTTIType); + procedure ProcessSO(aSO: TComponent; aSOType: TRTTIType); begin aSOType.GetProperty('Top').SetValue(aSO, Round(aSOType.GetProperty('Top').GetValue(aSO).AsInteger * NewDPI / OldDPI)); aSOType.GetProperty('Left').SetValue(aSO, Round(aSOType.GetProperty('Left').GetValue(aSO).AsInteger * NewDPI / OldDPI)); @@ -208,12 +208,12 @@ procedure TStyleDPIAwareness.ScaleStyle(Style: TCustomStyleServices); aSOType.GetProperty('TextMarginRight').SetValue(aSO, Round(aSOType.GetProperty('TextMarginRight').GetValue(aSO).AsInteger * NewDPI / OldDPI)); end; - procedure ProcessStyleObject(SO : TComponent); + procedure ProcessStyleObject(SO: TComponent); var i: integer; - ChildSo : TComponent; - SOType : TRTTIType; - BitmapLink : TObject; + ChildSo: TComponent; + SOType: TRTTIType; + BitmapLink: TObject; begin SOType := TRttiContext.Create.GetType(SO.ClassType); ProcessSO(SO, SOType); @@ -318,14 +318,14 @@ procedure TStyleDPIAwareness.ScaleStyle(Style: TCustomStyleServices); TGetBorderSize = function: TRect of object; TFormStyleHookFix = class helper for TFormStyleHook - procedure SetStretchedCaptionInc(Value : Integer); + procedure SetStretchedCaptionInc(Value: Integer); function GetBorderSizeAddr: Pointer; function Detour_GetBorderSize: TRect; end; var - Trampoline_TFormStyleHook_GetBorderSize : TGetBorderSize; - Detour_TFormStyleHook_GetBorderSize : TGetBorderSize; + Trampoline_TFormStyleHook_GetBorderSize: TGetBorderSize; + Detour_TFormStyleHook_GetBorderSize: TGetBorderSize; { TFormStyleHookFix } diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.DateTimePickers.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.DateTimePickers.pas index 27374b6..df4f7dd 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.DateTimePickers.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.DateTimePickers.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.DateTimePickers // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2016 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** @@ -66,8 +66,8 @@ TDateTimePickerStyleHookHelper = class helper for TDateTimePickerStyleHook procedure SetMouseOnButton(const Value: Boolean); public function GetButtonRect_: TRect; - property _FDroppedDown : Boolean read GetDroppedDown Write SetDroppedDown; - property _FMouseOnButton : Boolean read GetMouseOnButton Write SetMouseOnButton; + property _FDroppedDown: Boolean read GetDroppedDown Write SetDroppedDown; + property _FMouseOnButton: Boolean read GetMouseOnButton Write SetMouseOnButton; end; { TDateTimePickerStyleHookHelper } @@ -99,8 +99,8 @@ procedure TDateTimePickerStyleHookHelper.SetMouseOnButton(const Value: Boolean); { TDateTimePickerStyleHookFix } procedure TDateTimePickerStyleHookFix.SetColorsCalendar; Var - LTextColor, LBackColor : TColor; - LDateTimePicker : TDateTimePicker; + LTextColor, LBackColor: TColor; + LDateTimePicker: TDateTimePicker; begin LDateTimePicker:=TDateTimePicker(Control); //get the vcl styles colors @@ -176,7 +176,7 @@ procedure TDateTimePickerStyleHookFix.WMPaint(var Message: TMessage); LPaintStruct: TPaintStruct; LRect: TRect; LDetails: TThemedElementDetails; - sDateTime : string; + sDateTime: string; begin DC := Message.WParam; LCanvas := TCanvas.Create; @@ -203,8 +203,8 @@ procedure TDateTimePickerStyleHookFix.WMPaint(var Message: TMessage); //only works for DateFormat = dfShort case TDateTimePicker(Control).Kind of - dtkDate : sDateTime:=DateToStr(TDateTimePicker(Control).DateTime); - dtkTime : sDateTime:=TimeToStr(TDateTimePicker(Control).DateTime); + dtkDate: sDateTime:=DateToStr(TDateTimePicker(Control).DateTime); + dtkTime: sDateTime:=TimeToStr(TDateTimePicker(Control).DateTime); end; //draw the current date/time value diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.DbGrid.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.DbGrid.pas index 8d982dd..1dde326 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.DbGrid.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.DbGrid.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.DbGrid.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** @@ -57,7 +57,7 @@ TDbGridHelper = class helper for TCustomDBGrid function GetSelRow: Integer; procedure SetSelRow(const Value: Integer); public - property TitleOffset : Byte read GetTitleOffset; + property TitleOffset: Byte read GetTitleOffset; property Indicators: TCustomImageList read GetIndicators; property SelRow: Integer read GetSelRow write SetSelRow; end; @@ -95,7 +95,7 @@ procedure _WriteText(ACanvas: TCanvas; ARect: TRect; DX, DY: Integer; const ATex if (ACanvas.CanvasOrientation = coRightToLeft) and (not ARightToLeft) then ChangeBiDiModeAlignment(Alignment); case Alignment of - taLeftJustify : X := ARect.Left + DX; + taLeftJustify: X := ARect.Left + DX; taRightJustify: X := ARect.Right - ACanvas.TextWidth(AText) - 3; else X := ARect.Left + (ARect.Right - ARect.Left) shr 1 - (ACanvas.TextWidth(AText) shr 1); diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Ext.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Ext.pas index 7996af2..9fe3752 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Ext.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Ext.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.Ext.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -1665,9 +1665,11 @@ procedure TVclStylesPreview.Paint; TextRect.Right := ButtonRect.Left; // Draw text + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then CaptionBitmap.Canvas.Font.Size := Round(8*Application.MainForm.Monitor.PixelsPerInch / 96) else + {$IFEND} CaptionBitmap.Canvas.Font.Size := Round(8*Screen.PixelsPerInch / 96); Style.DrawText(CaptionBitmap.Canvas.Handle, CaptionDetails, FCaption, TextRect, [tfLeft, tfSingleLine, tfVerticalCenter]); @@ -1694,9 +1696,11 @@ procedure TVclStylesPreview.Paint; LDetails := Style.GetElementDetails(twFrameBottomActive); DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then FBitmap.Canvas.Font.Size := Round(8 * Application.MainForm.Monitor.PixelsPerInch / Screen.PixelsPerInch) else + {$IFEND} FBitmap.Canvas.Font.Size := 8; // Draw Main Menu @@ -1742,12 +1746,14 @@ procedure TVclStylesPreview.Paint; for i := 1 to 3 do begin ButtonRect.Top := LRect.Top + 30; + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then begin ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); end else + {$IFEND} begin ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); @@ -1764,12 +1770,14 @@ procedure TVclStylesPreview.Paint; LDetails := Style.GetElementDetails(tbPushButtonNormal); ButtonRect.Left := BorderRect.Left + 2; ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then begin ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); end else + {$IFEND} begin ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); @@ -1784,12 +1792,14 @@ procedure TVclStylesPreview.Paint; LDetails := Style.GetElementDetails(tbPushButtonHot); ButtonRect.Left := ButtonRect.Right + 2; ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then begin ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); end else + {$IFEND} begin ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); @@ -1804,12 +1814,14 @@ procedure TVclStylesPreview.Paint; LDetails := Style.GetElementDetails(tbPushButtonPressed); ButtonRect.Left := ButtonRect.Right + 2; ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then begin ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); end else + {$IFEND} begin ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); @@ -1824,12 +1836,14 @@ procedure TVclStylesPreview.Paint; LDetails := Style.GetElementDetails(tbPushButtonDisabled); ButtonRect.Left := ButtonRect.Right + 2; ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} if Assigned(Application.Mainform) then begin ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); end else + {$IFEND} begin ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Fixes.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Fixes.pas index 9337546..00561ce 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Fixes.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Fixes.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.Fixes // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // Contributors @@ -163,7 +163,7 @@ TComboBoxStyleHookHelper = class helper for TComboBoxStyleHook strict private function _getDroppedDown: Boolean; private - property _DroppedDown : Boolean read _getDroppedDown; + property _DroppedDown: Boolean read _getDroppedDown; end; {$IFEND} diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.FontAwesome.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.FontAwesome.pas index 474e04a..d183c3b 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.FontAwesome.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.FontAwesome.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.FontAwesome.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** @@ -577,25 +577,25 @@ interface //http://fortawesome.github.io/Font-Awesome/cheatsheet/ TFontAwesome = class private - FPrivateFontCollection : TGPPrivateFontCollection; + FPrivateFontCollection: TGPPrivateFontCollection; procedure LoadFontFromResource; public constructor Create; Destructor Destroy; override; - procedure DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; - procedure DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AFontHeight : Integer; AColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; + procedure DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; + procedure DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AFontHeight: Integer; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; - procedure DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; - procedure DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AFontHeight : Integer; AColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; + procedure DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; + procedure DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AFontHeight: Integer; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); overload; - function GetIcon(const ACode: Word; Width, Height : Integer; AColor, ABackColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft) : HICON; overload; - function GetIcon(const ACode: Word; Width, Height, CharX, CharY : Integer; AColor, ABackColor : TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft) : HICON; overload; + function GetIcon(const ACode: Word; Width, Height: Integer; AColor, ABackColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft): HICON; overload; + function GetIcon(const ACode: Word; Width, Height, CharX, CharY: Integer; AColor, ABackColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft): HICON; overload; end; {$IFDEF WinXCtrls} TFontAwesomeAnimated = class(TCustomActivityIndicator) private - FFontAwesomeCode : Word; - FColor, FBackColor : TColor; + FFontAwesomeCode: Word; + FColor, FBackColor: TColor; procedure SetFontAwesomeCode(const Value: Word); procedure SetColor(const Value: TColor); procedure SetBackColor(const Value: TColor); @@ -611,14 +611,14 @@ TFontAwesomeAnimated = class(TCustomActivityIndicator) property IndicatorColor; property IndicatorSize; property IndicatorType; - property Color : TColor read FColor write SetColor; - property BackColor : TColor read FBackColor write SetBackColor; - property FontAwesomeCode : Word read FFontAwesomeCode write SetFontAwesomeCode; + property Color: TColor read FColor write SetColor; + property BackColor: TColor read FBackColor write SetBackColor; + property FontAwesomeCode: Word read FFontAwesomeCode write SetFontAwesomeCode; end; {$ENDIF} var - FontAwesome : TFontAwesome; + FontAwesome: TFontAwesome; implementation @@ -656,8 +656,8 @@ destructor TFontAwesome.Destroy; procedure TFontAwesome.LoadFontFromResource; var - LStream : TResourceStream; - LStatus : TStatus; + LStream: TResourceStream; + LStatus: TStatus; cFonts: DWord; begin LStream := TResourceStream.Create(HInstance, 'fontawesome', RT_RCDATA); @@ -726,13 +726,13 @@ function TFontAwesome.GetIcon(const ACode: Word; Width, Height: Integer; AColor, Result := GetIcon(ACode, Width, Height, Width, Height, AColor, ABackColor, Orientation, ImageAlignment); end; -procedure TFontAwesome.DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AColor: TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); +procedure TFontAwesome.DrawChar(DC: HDC; const ACode: Word; DestRect: TRect; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); begin DrawChar(DC, Chr(ACode), DestRect, AColor, Orientation, ImageAlignment); end; -procedure TFontAwesome.DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AColor: TColor; Orientation : Integer = 0; ImageAlignment: TImageAlignment = iaLeft); +procedure TFontAwesome.DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AColor: TColor; Orientation: Integer = 0; ImageAlignment: TImageAlignment = iaLeft); begin DrawChar(DC, AChar, DestRect, DestRect.Height, AColor, Orientation, ImageAlignment); end; @@ -748,11 +748,11 @@ procedure TFontAwesome.DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; AFontHeight: Integer; AColor: TColor; Orientation: Integer; ImageAlignment: TImageAlignment); var - LFont : TGPFont; - LGPGraphics : TGPGraphics; - LBrush : TGPSolidBrush; - LColor : Cardinal; - LGPStringFormat : TGPStringFormat; + LFont: TGPFont; + LGPGraphics: TGPGraphics; + LBrush: TGPSolidBrush; + LColor: Cardinal; + LGPStringFormat: TGPStringFormat; LRect: TGPRectF; begin LGPGraphics := TGPGraphics.Create(DC); @@ -785,11 +785,11 @@ procedure TFontAwesome.DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; //var // LogFont: TLogFont; -// AFont : HFONT; +// AFont: HFONT; // pOldFont: HGDIOBJ; // LColorRef: COLORREF; // OldMode: integer; -// uFormat : Cardinal; +// uFormat: Cardinal; //begin // if FFontHandle = 0 then exit; // @@ -821,11 +821,11 @@ procedure TFontAwesome.DrawChar(DC: HDC; const AChar: Char; DestRect: TRect; // uFormat := DT_SINGLELINE; // // case ImageAlignment of -// iaLeft : uFormat := uFormat or DT_LEFT; -// iaRight : uFormat := uFormat or DT_RIGHT; -// iaCenter : uFormat := uFormat or DT_CENTER; -// iaTop : uFormat := uFormat or DT_TOP; -// iaBottom : uFormat := uFormat or DT_BOTTOM; +// iaLeft: uFormat := uFormat or DT_LEFT; +// iaRight: uFormat := uFormat or DT_RIGHT; +// iaCenter: uFormat := uFormat or DT_CENTER; +// iaTop: uFormat := uFormat or DT_TOP; +// iaBottom: uFormat := uFormat or DT_BOTTOM; // end; // // uFormat := uFormat or DT_NOCLIP; @@ -934,8 +934,8 @@ procedure RotateBitmap(ABitmap: TBitmap; Degs: Integer; Resize: Boolean; ABackCo procedure TFontAwesomeAnimated.ReloadFrames; var - i, LFrameSize, LAngleDelta, LAngle : Integer; - LBitmap : TBitmap; + i, LFrameSize, LAngleDelta, LAngle: Integer; + LBitmap: TBitmap; begin TCustomActivityIndicatorShadow(Self).FFrameSize := 48; LFrameSize := TCustomActivityIndicatorShadow(Self).FFrameSize; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.FormStyleHooks.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.FormStyleHooks.pas index 64c0952..13edcaf 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.FormStyleHooks.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.FormStyleHooks.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.FormStyleHooks.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -195,7 +195,7 @@ function RectVCenter(var R: TRect; Bounds: TRect): TRect; { TFormStyleHookRgn } procedure TFormStyleHookRgn.WMWindowPosChanging(var Message - : TWMWindowPosChanging); +: TWMWindowPosChanging); var Changed: Boolean; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Hooks.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Hooks.pas index 38dfc21..23743a2 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Hooks.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Hooks.pas @@ -16,7 +16,7 @@ // // The Initial Developer of the Original Code is Rodrigo Ruz V. // -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // // Contributor(s): Mahdi Safsafi. // @@ -74,11 +74,11 @@ TCommonCalendarClass = class(TCommonCalendar); VCLStylesLock: TCriticalSection = nil; LSetStylePtr: TSetStyle; - Trampoline_SetStyle : procedure(Self: TObject; Style: TCustomStyleServices); - Trampoline_user32_FillRect : function(hDC: hDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall; - Trampoline_user32_DrawEdge : function(hDC: hDC; var qrc: TRect; edge: UINT; grfFlags: UINT): BOOL; stdcall = nil; - Trampoline_user32_DrawFrameControl : function (DC: HDC; Rect: PRect; uType, uState: UINT): BOOL; stdcall = nil; - Trampoline_user32_LoadIconW : function (hInstance: HINST; lpIconName: PWideChar): HICON; stdcall = nil; + Trampoline_SetStyle: procedure(Self: TObject; Style: TCustomStyleServices); + Trampoline_user32_FillRect: function(hDC: hDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall; + Trampoline_user32_DrawEdge: function(hDC: hDC; var qrc: TRect; edge: UINT; grfFlags: UINT): BOOL; stdcall = nil; + Trampoline_user32_DrawFrameControl: function (DC: HDC; Rect: PRect; uType, uState: UINT): BOOL; stdcall = nil; + Trampoline_user32_LoadIconW: function (hInstance: HINST; lpIconName: PWideChar): HICON; stdcall = nil; Trampoline_user32_GetSysColorBrush: function(nIndex: Integer): HBRUSH; stdcall; {$IFDEF HOOK_UXTHEME} Trampoline_user32_LoadImageW: function (hInst: HINST; ImageName: LPCWSTR; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; stdcall = nil; @@ -148,7 +148,7 @@ function Detour_GetSysColorBrush(nIndex: Integer): HBRUSH; stdcall; The reason to change the previous code implementation is that the win32 graphics may differ with the VCL graphics: Eg: TColor is signed in VCL and Unsigned in Win32Api. - When hooking : keep always using the native way ! + When hooking: keep always using the native way ! Need Color ? Use GetObject with LOGBRUSH ! or use TBrushColorPair ! } @@ -216,7 +216,7 @@ function Detour_WinApi_DrawFrameControl(DC: HDC; Rect: PRect; uType, uState: UIN var LRect: TRect; LDetails: TThemedElementDetails; - CanDraw : Boolean; + CanDraw: Boolean; LThemedButton: TThemedButton; LThemedComboBox: TThemedComboBox; @@ -446,7 +446,7 @@ function Detour_WinApi_DrawFrameControl(DC: HDC; Rect: PRect; uType, uState: UIN Exit(Trampoline_user32_DrawFrameControl(DC, Rect, uType, uState)); end; -function GetStyleHighLightColor : TColor; +function GetStyleHighLightColor: TColor; begin if ColorIsBright(StyleServices.GetSystemColor(clBtnFace)) or not ColorIsBright(StyleServices.GetSystemColor(clHighlight)) then Result := StyleServices.GetSystemColor(clBtnText) @@ -456,10 +456,10 @@ function GetStyleHighLightColor : TColor; function Detour_LoadIconW(_hInstance: HINST; lpIconName: PWideChar): HICON; stdcall; var - s : string; - LIcon : TIcon; - LHandle : THandle; - MustRelease : Boolean; + s: string; + LIcon: TIcon; + LHandle: THandle; + MustRelease: Boolean; procedure DrawIcon(const ACode: Word); begin @@ -496,12 +496,12 @@ function Detour_LoadIconW(_hInstance: HINST; lpIconName: PWideChar): HICON; stdc if _hInstance=0 then case NativeUInt(lpIconName) of - 32518 : DrawIcon(fa_shield); - 32516 : DrawIcon(fa_info_circle); - 32515 : DrawIcon(fa_warning); - 32513 : DrawIcon(fa_minus_circle); - 32514 : DrawIcon(fa_question_circle); - 32517 : DrawIcon(fa_windows); + 32518: DrawIcon(fa_shield); + 32516: DrawIcon(fa_info_circle); + 32515: DrawIcon(fa_warning); + 32513: DrawIcon(fa_minus_circle); + 32514: DrawIcon(fa_question_circle); + 32517: DrawIcon(fa_windows); end; finally @@ -519,11 +519,11 @@ function Detour_LoadImageW(hInst: HINST; ImageName: LPCWSTR; ImageType: UINT; X, const ExplorerFrame = 'explorerframe.dll'; var - hModule : WinApi.Windows.HMODULE; - LBitmap : TBitmap; - s : string; - LRect, LRect2 : TRect; - LBackColor, LColor : TColor; + hModule: WinApi.Windows.HMODULE; + LBitmap: TBitmap; + s: string; + LRect, LRect2: TRect; + LBackColor, LColor: TColor; begin if not(ExecutingInMainThread) or StyleServices.IsSystemStyle or not(TSysStyleManager.Enabled) then Exit(Trampoline_user32_LoadImageW(hInst, ImageName, ImageType, X, Y, Flags)); @@ -694,10 +694,10 @@ function Detour_LoadImageW(hInst: HINST; ImageName: LPCWSTR; ImageType: UINT; X, 581: begin case NativeUInt(ImageName) of - 577 : LColor := StyleServices.GetSystemColor(clBtnText); - 578 : LColor := StyleServices.GetSystemColor(clHighlight); - 579 : LColor := StyleServices.GetSystemColor(clGrayText); - 581 : LColor := StyleServices.GetSystemColor(clBtnText); + 577: LColor := StyleServices.GetSystemColor(clBtnText); + 578: LColor := StyleServices.GetSystemColor(clHighlight); + 579: LColor := StyleServices.GetSystemColor(clGrayText); + 581: LColor := StyleServices.GetSystemColor(clBtnText); else LColor:= StyleServices.GetSystemColor(clBtnText); end; @@ -718,9 +718,9 @@ function Detour_LoadImageW(hInst: HINST; ImageName: LPCWSTR; ImageType: UINT; X, 582..584: begin case NativeUInt(ImageName) of - 582 : LColor := StyleServices.GetSystemColor(clBtnText); - 583 : LColor := StyleServices.GetSystemColor(clHighlight); - 584 : LColor := StyleServices.GetSystemColor(clGrayText); + 582: LColor := StyleServices.GetSystemColor(clBtnText); + 583: LColor := StyleServices.GetSystemColor(clHighlight); + 584: LColor := StyleServices.GetSystemColor(clGrayText); else LColor := StyleServices.GetSystemColor(clBtnText); end; @@ -796,7 +796,7 @@ function Detour_LoadImageW(hInst: HINST; ImageName: LPCWSTR; ImageType: UINT; X, {$IF CompilerVersion>=29} function Detour_SetWindowTheme(hwnd: HWND; pszSubAppName: LPCWSTR; pszSubIdList: LPCWSTR): HRESULT; stdcall; var - LControl : TWinControl; + LControl: TWinControl; begin if not(ExecutingInMainThread) then Exit(Trampoline_SetWindowTheme(hwnd, pszSubAppName, pszSubIdList)); diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.NC.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.NC.pas index 6256140..ea25369 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.NC.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.NC.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.NC.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2014-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2014-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -2296,7 +2296,7 @@ procedure TNCControl.SetVisible(const Value: Boolean); begin if FVisible <> Value then FVisible := Value; - // TODO : Add parent notification + // TODO: Add parent notification end; procedure TNCControl.SetWidth(const Value: Integer); diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.OwnerDrawFix.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.OwnerDrawFix.pas index 2c95d2b..fc0576a 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.OwnerDrawFix.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.OwnerDrawFix.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.OwnerDrawFix.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Preview.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Preview.pas index 9e6fdec..6fc8c44 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Preview.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Preview.pas @@ -11,37 +11,37 @@ interface TVisualStylePreview = class(TCustomControl) protected - FStyle : TCustomStyleServices; - FIcon : HICON; - FCaption : TCaption; - FRegion : HRGN; - FBitmap : TBitmap; - FPreviewType : TPreviewType; - FFormBorderSize : TRect; - FBkgColor : TColor; - FUnavailableText : string; - FSelectedText : string; - FHotText : string; - FNormalText : string; - FDisabledText : string; - FPressedText : string; - FButtonText : string; - FFileMenuText : string; - FEditMenuText : string; - FViewMenuText : string; - FHelpMenuText : string; - - procedure SetStyle(const aStyle : TCustomStyleServices); - - function GetFormBorderSize : TRect; - function GetMainMenuRect : TRect; - function GetTabsRect : TRect; - - function GetCaptionHeight : integer; - function GetLeftFormBorderWidth : integer; - function GetRightFormBorderWidth : integer; - function GetBottomFormBorderHeight : integer; - function RectVCenter(var aRect : TRect; aBounds : TRect): TRect; + FStyle: TCustomStyleServices; + FIcon: HICON; + FCaption: TCaption; + FRegion: HRGN; + FBitmap: TBitmap; + FPreviewType: TPreviewType; + FFormBorderSize: TRect; + FBkgColor: TColor; + FUnavailableText: string; + FSelectedText: string; + FHotText: string; + FNormalText: string; + FDisabledText: string; + FPressedText: string; + FButtonText: string; + FFileMenuText: string; + FEditMenuText: string; + FViewMenuText: string; + FHelpMenuText: string; + + procedure SetStyle(const aStyle: TCustomStyleServices); + + function GetFormBorderSize: TRect; + function GetMainMenuRect: TRect; + function GetTabsRect: TRect; + + function GetCaptionHeight: integer; + function GetLeftFormBorderWidth: integer; + function GetRightFormBorderWidth: integer; + function GetBottomFormBorderHeight: integer; + function RectVCenter(var aRect: TRect; aBounds: TRect): TRect; procedure DrawCaption; procedure DrawFormBorders; @@ -60,25 +60,25 @@ TVisualStylePreview = class(TCustomControl) destructor Destroy; override; procedure AfterConstruction; override; - property Icon : HICON read FIcon write FIcon; - property Style : TCustomStyleServices read FStyle write SetStyle; - property Caption : TCaption read FCaption write FCaption; - property Bitmap : TBitmap read FBitmap write FBitmap; - property UnavailableText : string read FUnavailableText write FUnavailableText; - property SelectedText : string read FSelectedText write FSelectedText; - property HotText : string read FHotText write FHotText; - property NormalText : string read FNormalText write FNormalText; - property DisabledText : string read FDisabledText write FDisabledText; - property PressedText : string read FPressedText write FPressedText; - property ButtonText : string read FButtonText write FButtonText; - property FileMenuText : string read FFileMenuText write FFileMenuText; - property EditMenuText : string read FEditMenuText write FEditMenuText; - property ViewMenuText : string read FViewMenuText write FViewMenuText; - property HelpMenuText : string read FHelpMenuText write FHelpMenuText; + property Icon: HICON read FIcon write FIcon; + property Style: TCustomStyleServices read FStyle write SetStyle; + property Caption: TCaption read FCaption write FCaption; + property Bitmap: TBitmap read FBitmap write FBitmap; + property UnavailableText: string read FUnavailableText write FUnavailableText; + property SelectedText: string read FSelectedText write FSelectedText; + property HotText: string read FHotText write FHotText; + property NormalText: string read FNormalText write FNormalText; + property DisabledText: string read FDisabledText write FDisabledText; + property PressedText: string read FPressedText write FPressedText; + property ButtonText: string read FButtonText write FButtonText; + property FileMenuText: string read FFileMenuText write FFileMenuText; + property EditMenuText: string read FEditMenuText write FEditMenuText; + property ViewMenuText: string read FViewMenuText write FViewMenuText; + property HelpMenuText: string read FHelpMenuText write FHelpMenuText; published - property PreviewType : TPreviewType read FPreviewType write FPreviewType; - property BkgColor : TColor read FBkgColor write FBkgColor; + property PreviewType: TPreviewType read FPreviewType write FPreviewType; + property BkgColor: TColor read FBkgColor write FBkgColor; property Align; property Anchors; property Visible; @@ -144,7 +144,7 @@ procedure TVisualStylePreview.AfterConstruction; FBitmap.PixelFormat := pf32bit; end; -procedure TVisualStylePreview.SetStyle(const aStyle : TCustomStyleServices); +procedure TVisualStylePreview.SetStyle(const aStyle: TCustomStyleServices); begin if (FStyle <> nil) then FreeAndNil(FStyle); @@ -152,10 +152,10 @@ procedure TVisualStylePreview.SetStyle(const aStyle : TCustomStyleServices); Refresh; end; -function TVisualStylePreview.GetCaptionHeight : integer; +function TVisualStylePreview.GetCaptionHeight: integer; var - LSize : TSize; - LDetails : TThemedElementDetails; + LSize: TSize; + LDetails: TThemedElementDetails; begin LDetails := FStyle.GetElementDetails(twCaptionActive); if Assigned(Application.Mainform) then @@ -165,10 +165,10 @@ function TVisualStylePreview.GetCaptionHeight : integer; Result := LSize.cy; end; -function TVisualStylePreview.GetLeftFormBorderWidth : integer; +function TVisualStylePreview.GetLeftFormBorderWidth: integer; var - LSize : TSize; - LDetails : TThemedElementDetails; + LSize: TSize; + LDetails: TThemedElementDetails; begin LDetails := FStyle.GetElementDetails(twFrameLeftActive); if Assigned(Application.Mainform) then @@ -178,10 +178,10 @@ function TVisualStylePreview.GetLeftFormBorderWidth : integer; Result := LSize.cx; end; -function TVisualStylePreview.GetRightFormBorderWidth : integer; +function TVisualStylePreview.GetRightFormBorderWidth: integer; var - LSize : TSize; - LDetails : TThemedElementDetails; + LSize: TSize; + LDetails: TThemedElementDetails; begin LDetails := FStyle.GetElementDetails(twFrameRightActive); if Assigned(Application.Mainform) then @@ -191,10 +191,10 @@ function TVisualStylePreview.GetRightFormBorderWidth : integer; Result := LSize.cx; end; -function TVisualStylePreview.GetBottomFormBorderHeight : integer; +function TVisualStylePreview.GetBottomFormBorderHeight: integer; var - LSize : TSize; - LDetails : TThemedElementDetails; + LSize: TSize; + LDetails: TThemedElementDetails; begin LDetails := FStyle.GetElementDetails(twFrameBottomActive); if Assigned(Application.Mainform) then @@ -212,7 +212,7 @@ function TVisualStylePreview.GetFormBorderSize: TRect; Result.Bottom := GetBottomFormBorderHeight; end; -function TVisualStylePreview.GetMainMenuRect : TRect; +function TVisualStylePreview.GetMainMenuRect: TRect; const MENU_ITEM_HEIGHT = 20; begin @@ -225,7 +225,7 @@ function TVisualStylePreview.GetMainMenuRect : TRect; Result.Bottom := Result.Top + MulDiv(MENU_ITEM_HEIGHT, Screen.PixelsPerInch, ORIGINAL_PPI); end; -function TVisualStylePreview.GetTabsRect : TRect; +function TVisualStylePreview.GetTabsRect: TRect; const TABS_HEIGHT = 27; begin @@ -238,7 +238,7 @@ function TVisualStylePreview.GetTabsRect : TRect; Result.Bottom := Result.Top + MulDiv(TABS_HEIGHT, Screen.PixelsPerInch, ORIGINAL_PPI); end; -function TVisualStylePreview.RectVCenter(var aRect : TRect; aBounds : TRect): TRect; +function TVisualStylePreview.RectVCenter(var aRect: TRect; aBounds: TRect): TRect; begin OffsetRect(aRect, - aRect.Left, - aRect.Top); OffsetRect(aRect, 0, (aBounds.Height - aRect.Height) div 2); @@ -249,9 +249,9 @@ function TVisualStylePreview.RectVCenter(var aRect : TRect; aBounds : TRect): TR procedure TVisualStylePreview.DrawDefaultPanel; var - LDetails : TThemedElementDetails; - LColor : TColor; - LRect : TRect; + LDetails: TThemedElementDetails; + LColor: TColor; + LRect: TRect; begin LRect := rect(0, 0, FBitmap.Width, FBitmap.Height); @@ -293,15 +293,15 @@ procedure TVisualStylePreview.DrawDefaultPanel; procedure TVisualStylePreview.DrawCaption; var - LClientRect : TRect; - LCaptionRect : TRect; - LTextRect : TRect; - LIconRect : TRect; - LButtonRect : TRect; - LDetails : TThemedElementDetails; - LCaptionDetails : TThemedElementDetails; - LIconDetails : TThemedElementDetails; - LRegion : HRGN; + LClientRect: TRect; + LCaptionRect: TRect; + LTextRect: TRect; + LIconRect: TRect; + LButtonRect: TRect; + LDetails: TThemedElementDetails; + LCaptionDetails: TThemedElementDetails; + LIconDetails: TThemedElementDetails; + LRegion: HRGN; begin LClientRect := ClientRect; LCaptionRect := Rect(0, 0, FBitmap.Width, FFormBorderSize.Top); @@ -374,8 +374,8 @@ procedure TVisualStylePreview.DrawCaption; procedure TVisualStylePreview.DrawFormBorders; var - LRect : TRect; - LDetails : TThemedElementDetails; + LRect: TRect; + LDetails: TThemedElementDetails; begin //Draw left border LRect := Rect(0, FFormBorderSize.Top, FFormBorderSize.Left, FBitmap.Height - FFormBorderSize.Bottom); @@ -397,11 +397,11 @@ procedure TVisualStylePreview.DrawMainMenu; const MENU_ITEM_WIDTH = 30; var - LMenuRect : TRect; - LItemRect : TRect; - LDetails : TThemedElementDetails; - LColor : TColor; - LWidth : integer; + LMenuRect: TRect; + LItemRect: TRect; + LDetails: TThemedElementDetails; + LColor: TColor; + LWidth: integer; begin LMenuRect := GetMainMenuRect; @@ -447,14 +447,14 @@ procedure TVisualStylePreview.DrawToolButtons; BUTTON_HEIGHT = 25; PANEL_PADDING = 10; var - LMenuRect : TRect; - LButtonRect : TRect; - LDetails : TThemedElementDetails; - LColor : TColor; - i : integer; - LWidth : integer; - LHeight : integer; - LPadding : integer; + LMenuRect: TRect; + LButtonRect: TRect; + LDetails: TThemedElementDetails; + LColor: TColor; + i: integer; + LWidth: integer; + LHeight: integer; + LPadding: integer; begin LMenuRect := GetMainMenuRect; if Assigned(Application.Mainform) then @@ -494,14 +494,14 @@ procedure TVisualStylePreview.DrawButtons; BUTTON_HEIGHT = 25; PANEL_PADDING = 10; var - LButtonRect : TRect; - LDetails : TThemedElementDetails; - LColor : TColor; - i : integer; - LCaption : string; - LWidth : integer; - LHeight : integer; - LPadding : integer; + LButtonRect: TRect; + LDetails: TThemedElementDetails; + LColor: TColor; + i: integer; + LCaption: string; + LWidth: integer; + LHeight: integer; + LPadding: integer; begin if Assigned(Application.Mainform) then begin @@ -563,13 +563,13 @@ procedure TVisualStylePreview.DrawTabs; TAB_WIDTH = 80; TAB_OFFSET = 3; var - LDetails : TThemedElementDetails; - LTabsRect : TRect; - LItemRect : TRect; - LWidth : integer; - LColor : TColor; - LFlags : TTextFormat; - LOffset : integer; + LDetails: TThemedElementDetails; + LTabsRect: TRect; + LItemRect: TRect; + LWidth: integer; + LColor: TColor; + LFlags: TTextFormat; + LOffset: integer; begin if Assigned(Application.Mainform) then begin @@ -650,8 +650,8 @@ procedure TVisualStylePreview.Paint; DrawDefaultPanel else case FPreviewType of - ptOriginal : DrawOriginalPreview; - ptTabs : DrawTabsPreview; + ptOriginal: DrawOriginalPreview; + ptTabs: DrawTabsPreview; end; Canvas.Draw(0, 0, FBitmap); diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ComCtrls.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ComCtrls.pas index 80f74c3..edbc16e 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ComCtrls.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ComCtrls.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************ @@ -276,7 +276,7 @@ TSysToolbarButton = class TSysProgressBarStyleHook = class(TSysStyleHook) strict private FStep: Integer; - // FLastPos : Integer; + // FLastPos: Integer; FOrientation: TProgressBarOrientation; FTimer: TTimer; procedure TimerAction(Sender: TObject); @@ -2674,7 +2674,7 @@ procedure TSysLinkStyleHook.Paint(Canvas: TCanvas); var LDetails: TThemedElementDetails; LRect: TRect; - s : string; + s: string; begin LRect := SysControl.ClientRect; if GetBkMode(Canvas.Handle) = TRANSPARENT then diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Forms.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Forms.pas index 565671e..abe4f15 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Forms.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Forms.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -100,8 +100,8 @@ TSysScrollingStyleHook = class(TMouseTrackSysControlStyleHook) function IsHorzScrollDisabled: Boolean; function IsVertScrollDisabled: Boolean; protected - property LstPos : Integer read FLstPos write FLstPos; - property AllowScrolling : Boolean read FAllowScrolling write FAllowScrolling; + property LstPos: Integer read FLstPos write FLstPos; + property AllowScrolling: Boolean read FAllowScrolling write FAllowScrolling; function NormalizePoint(const P: TPoint): TPoint; procedure Scroll(const Kind: TScrollBarKind; const ScrollType: TSysScrollingType; Pos, Delta: Integer); virtual; procedure DoScroll(const Kind: TScrollBarKind; const ScrollType: TSysScrollingType; Pos, Delta: Integer); @@ -1108,11 +1108,9 @@ procedure TSysDialogStyleHook.PaintNC(Canvas: TCanvas); Inc(TextRect.Left, R.Left); MoveWindowOrg(Canvas.Handle, 0, TextTopOffset); if Assigned(Application.Mainform) then - StyleServices.DrawText(Canvas.Handle, CaptionDetails, LText, TextRect, TextFormat, clRed - {$IF (CompilerVersion >= 33)}, Application.MainForm.Monitor.PixelsPerInch{$ENDIF}) + StyleServices.DrawText(Canvas.Handle, CaptionDetails, LText, TextRect, TextFormat, clRed{$IF RTLVersion > 32}, Application.MainForm.Monitor.PixelsPerInch{$IFEND}) else - StyleServices.DrawText(Canvas.Handle, CaptionDetails, LText, TextRect, TextFormat, clRed - {$IF (CompilerVersion >= 33)}, Screen.PixelsPerInch{$ENDIF}); + StyleServices.DrawText(Canvas.Handle, CaptionDetails, LText, TextRect, TextFormat, clRed{$IF RTLVersion > 32}, Screen.PixelsPerInch{$IFEND}); MoveWindowOrg(Canvas.Handle, 0, -TextTopOffset); end else @@ -1359,7 +1357,7 @@ procedure TSysDialogStyleHook.WMPaint(var Message: TMessage); procedure TSysDialogStyleHook.WMSetText(var Message: TMessage); var FRedraw: Boolean; - LBorderStyle : TFormBorderStyle; + LBorderStyle: TFormBorderStyle; begin LBorderStyle := BorderStyle; if (LBorderStyle = bsNone) or (WindowState = wsMinimized) or (StyleServices.IsSystemStyle) then diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Graphics.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Graphics.pas index 00b2df6..2086466 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Graphics.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Graphics.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.Utils.Graphics.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -146,7 +146,7 @@ TColorFilter = class TBitmapFilter = class(TColorFilter) private - // FColorValue : Integer; + // FColorValue: Integer; FUseBitmap: Boolean; FSourceBitmap: TBitmap; public diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Menus.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Menus.pas index da0d525..28d88d5 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Menus.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Menus.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -140,10 +140,10 @@ TSysPopupItem = class {$ENDREGION} var - FOffset : Integer; - FOffsetCache : Integer; - FSeparatorHeightCache : Integer; - FItemHeightCache : Integer; + FOffset: Integer; + FOffsetCache: Integer; + FSeparatorHeightCache: Integer; + FItemHeightCache: Integer; FItemsPainted: Boolean; FParentSubItemPainted: Boolean; FPreviousHotItemIndex: integer; @@ -153,11 +153,11 @@ TSysPopupItem = class FCount: integer; FMenu: HMENU; FVCLMenuItems: TMenuItem; - FNCRect : TRect; - FEnterWithKeyboard : Boolean; - FPersistentHotKeys : Boolean; + FNCRect: TRect; + FEnterWithKeyboard: Boolean; + FPersistentHotKeys: Boolean; - FMenuBarHook : TObject; + FMenuBarHook: TObject; function GetMenuFromHandle(AHandle: HWND): HMENU; function GetItemsCount: integer; procedure MNSELECTITEM(var Message: TMessage); message MN_SELECTITEM; @@ -171,20 +171,20 @@ TSysPopupItem = class const Style: TSysPopupItemStyle); Virtual; procedure PaintBackground(Canvas: TCanvas); override; procedure GetNbSeparator(var PNbSeparator: Integer; const PIndex: Integer); - function GetMenuItemHeight(const Index: Integer) : Integer; - function GetOffset(UseCache: Boolean) : Integer; + function GetMenuItemHeight(const Index: Integer): Integer; + function GetOffset(UseCache: Boolean): Integer; function ItemIsVisible(const Index: Integer): Boolean; procedure SetMaxOffset(); procedure RefreshMenu(); procedure GetItemHeight(); procedure GetSeparatorHeight(); function GetClientRectHeight(var PValue: TRect): Integer; - function GetItemClicked(var PButton: Byte; PInitPos: TPoint) : Integer; - function GetMousePos() : TPoint; + function GetItemClicked(var PButton: Byte; PInitPos: TPoint): Integer; + function GetMousePos(): TPoint; procedure WndProc(var Message: TMessage); override; procedure UpdateColors; override; procedure SetOffset(PValue: Integer); - function GetBottom(const Index: Integer) : Integer; + function GetBottom(const Index: Integer): Integer; public constructor Create(AHandle: THandle); override; Destructor Destroy; override; @@ -1269,7 +1269,7 @@ procedure TSysPopupStyleHook.GetNbSeparator(var PNbSeparator: Integer; const PIn end; end; -function TSysPopupStyleHook.GetMenuItemHeight(const Index: Integer) : Integer; +function TSysPopupStyleHook.GetMenuItemHeight(const Index: Integer): Integer; var LItemRect: TRect; begin @@ -1277,7 +1277,7 @@ function TSysPopupStyleHook.GetMenuItemHeight(const Index: Integer) : Integer; Result := LItemRect.Height; end; -function TSysPopupStyleHook.GetBottom(const Index: Integer) : Integer; +function TSysPopupStyleHook.GetBottom(const Index: Integer): Integer; var LItemRect: TRect; P: TPoint; @@ -1288,7 +1288,7 @@ function TSysPopupStyleHook.GetBottom(const Index: Integer) : Integer; Result := P.Y; end; -function TSysPopupStyleHook.GetOffset(UseCache: Boolean) : Integer; +function TSysPopupStyleHook.GetOffset(UseCache: Boolean): Integer; var LNbSeparator: Integer; begin @@ -1478,7 +1478,7 @@ procedure TSysPopupStyleHook.SetOffset(PValue: Integer); FOffsetCache := 0; end; -function TSysPopupStyleHook.GetItemClicked(var PButton: Byte; PInitPos: TPoint) : Integer; +function TSysPopupStyleHook.GetItemClicked(var PButton: Byte; PInitPos: TPoint): Integer; var ArrowHeight, i: Integer; R, LItemRect: TRect; @@ -1529,7 +1529,7 @@ function TSysPopupStyleHook.GetItemClicked(var PButton: Byte; PInitPos: TPoint) Result := -1; end; -function TSysPopupStyleHook.GetMousePos() : TPoint; +function TSysPopupStyleHook.GetMousePos(): TPoint; begin Result := Mouse.CursorPos; ScreenToClient(Handle, Result); @@ -2034,7 +2034,7 @@ function TSysPopupStyleHook.TSysPopupItem.GetVCLRealItem: TMenuItem; windows will delete this item but the VCL will not delete the item from Items property .And thats can cause the item to be painted ! Do not access VCLMenuItems.Items[Index] directly - => Instead , use this one : VCLItem . + => Instead , use this one: VCLItem . } VisibleItems := nil; Result := nil; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Misc.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Misc.pas index 9ba1f55..4e3fd0d 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Misc.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.Misc.pas @@ -14,7 +14,7 @@ // // The Original Code is Vcl.Styles.Utils.Misc.pas. // -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -812,7 +812,7 @@ function WM_To_String(const WM_Message: Integer): string; Result := 'LM_SETITEM'; LM_GETITEM: Result := 'LM_GETITEM'; - // LM_GETIDEALSIZE : Result:= 'LM_GETIDEALSIZE'; + // LM_GETIDEALSIZE: Result:= 'LM_GETIDEALSIZE'; else begin diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ScreenTips.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ScreenTips.pas index afadcde..ac85d93 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ScreenTips.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.ScreenTips.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.StdCtrls.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.StdCtrls.pas index 7ee9ffe..20781d4 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.StdCtrls.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.StdCtrls.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -2021,8 +2021,8 @@ function TSysComboBoxStyleHook.CallDefaultListBoxProc(var Msg: TMessage): LRESUL if (FDefListBoxProc <> nil) then Result := CallWindowProc(FDefListBoxProc, FListHandle, Msg.Msg, Msg.wParam, Msg.lParam); except - on e : exception do - OutputDebugString(PWideChar('CallDefaultListBoxProc error : ' + e.message + chr(0))); + on e: exception do + OutputDebugString(PWideChar('CallDefaultListBoxProc error: ' + e.message + chr(0))); end; end; @@ -2586,7 +2586,7 @@ constructor TSysCheckBoxStyleHook.Create(AHandle: THandle); end; function TSysCheckBoxStyleHook.GetDrawState(State: TSysCheckBoxState) - : TThemedButton; +: TThemedButton; begin Result := tbButtonDontCare; @@ -2815,7 +2815,7 @@ constructor TSysRadioButtonStyleHook.Create(AHandle: THandle); end; function TSysRadioButtonStyleHook.GetDrawState(State: TSysCheckBoxState) - : TThemedButton; +: TThemedButton; begin Result := tbButtonDontCare; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysControls.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysControls.pas index 4531ee2..8999f0b 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysControls.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysControls.pas @@ -14,7 +14,7 @@ // // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -134,7 +134,7 @@ TSysStyleManager = class(TComponent) /// Collection of Styled Child Controls /// class property ChildRegSysStylesList: TObjectDictionary read FChildRegSysStylesList; - class procedure AddControlDirectly(Handle: HWND; const sClassName : string; IncludeChildControls : Boolean = False); + class procedure AddControlDirectly(Handle: HWND; const sClassName: string; IncludeChildControls: Boolean = False); end; @@ -242,16 +242,16 @@ procedure HookNotification(Action: TSysHookAction; Info: PControlInfo); inherited; end; -class procedure TSysStyleManager.AddControlDirectly(Handle: HWND; const sClassName : string; IncludeChildControls : Boolean = False); +class procedure TSysStyleManager.AddControlDirectly(Handle: HWND; const sClassName: string; IncludeChildControls: Boolean = False); var - LStyleHook : TSysStyleHook; - ParentStyle : DWORD; + LStyleHook: TSysStyleHook; + ParentStyle: DWORD; procedure AddChildControl(ChildHandle: HWND); var Info: TChildControlInfo; - sChildClassName : string; - LStyleHook : TSysStyleHook; + sChildClassName: string; + LStyleHook: TSysStyleHook; begin { Hook the control directly ! } ZeroMemory(@Info, sizeof(TChildControlInfo)); @@ -269,7 +269,7 @@ class procedure TSysStyleManager.AddControlDirectly(Handle: HWND; const sClassNa end; end; - function EnumChildProc(const hWindow: hWnd; const LParam : LParam): boolean; stdcall; + function EnumChildProc(const hWindow: hWnd; const LParam: LParam): boolean; stdcall; begin AddChildControl(hWindow); Result:= True; @@ -318,7 +318,7 @@ class function TSysStyleManager.HookActionCallBackCBT(nCode: Integer; wParam: wP procedure RemoveUnusedHooks; var - LHandle : THandle; + LHandle: THandle; begin for LHandle in TSysStyleManager.SysStyleHookList.Keys do if TSysStyleClass(TSysStyleManager.SysStyleHookList.Items[LHandle]).MustRemove then @@ -343,7 +343,7 @@ class function TSysStyleManager.HookActionCallBackCBT(nCode: Integer; wParam: wP procedure AddControl(Handle: HWND); var - LStyleHook : TSysStyleHook; + LStyleHook: TSysStyleHook; begin { Hook the control directly ! } RemoveUnusedHooks; diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysStyleHook.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysStyleHook.pas index 6d93b8a..ac535ba 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysStyleHook.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SysStyleHook.pas @@ -15,7 +15,7 @@ // The Original Code is uSysStyleHook.pas. // // Portions created by Mahdi Safsafi [SMP3] e-mail SMP@LIVE.FR -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -67,8 +67,8 @@ TSysControl = class FFont: TFont; FParent: TSysControl; FHandle: THandle; - FWindowClassName : string; - FDestroyed : Boolean; + FWindowClassName: string; + FDestroyed: Boolean; function GetParent: TSysControl; function GetParentHandle: THandle; function GetText: String; @@ -124,7 +124,7 @@ TSysControl = class property ControlID: Integer read GetControlID; property BoundsRect: TRect read GetBoundsRect; property IsChild: Boolean read IsControlChild; - property Destroyed : Boolean read FDestroyed write FDestroyed; //WM_DESTROY + property Destroyed: Boolean read FDestroyed write FDestroyed; //WM_DESTROY function DrawTextBiDiModeFlags(const Flags: Longint): Longint; function UseRightToLeftAlignment: Boolean; dynamic; function DrawTextBiDiModeFlagsReadingOnly: Longint; @@ -193,7 +193,7 @@ TSysStyleHook = class procedure UpdateColors; virtual; function PaintControls(AControl: HWND; DC: HDC): Boolean; property HookedDirectly: Boolean read FHookedDirectly write FHookedDirectly; - property MustRemove : Boolean read FMustRemove; + property MustRemove: Boolean read FMustRemove; public constructor Create(AHandle: THandle); virtual; Destructor Destroy; override; @@ -582,8 +582,8 @@ function TSysStyleHook.CallDefaultProc(var Msg: TMessage): LRESULT; if (FOrgWndProc <> 0) then Result := CallWindowProc(Pointer(FOrgWndProc), Handle, Msg.Msg, Msg.wParam, Msg.lParam); except - on e : exception do - OutputDebugString(PWideChar('CallDefaultProc error : ' + e.message + chr(0))); + on e: exception do + OutputDebugString(PWideChar('CallDefaultProc error: ' + e.message + chr(0))); end; end; @@ -1159,7 +1159,7 @@ procedure TSysStyleHook.WndProc(var Message: TMessage); var TempResult: LRESULT; ChildHandle: HWND; - ItemRemoved : Boolean; + ItemRemoved: Boolean; begin case Message.Msg of diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SystemMenu.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SystemMenu.pas index 629ea67..e36b41d 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SystemMenu.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.SystemMenu.pas @@ -13,7 +13,7 @@ // and limitations under the License. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2014-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2014-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.pas index 2242e2a..38efbe0 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.Utils.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.Utils.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2016 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // //************************************************************************************************** @@ -36,27 +36,27 @@ interface TVclStylesUtils = class private - FClone : Boolean; - FStream : TStream; - FStyleExt : TCustomStyleExt; - FElements : TVCLStylesElements; + FClone: Boolean; + FStream: TStream; + FStyleExt: TCustomStyleExt; + FElements: TVCLStylesElements; //FSourceInfo: TSourceInfo; public - procedure SetFilters(Filters : TObjectList); + procedure SetFilters(Filters: TObjectList); procedure ApplyChanges; procedure SaveToFile(const FileName: string); //property SourceInfo: TSourceInfo read FSourceInfo; - property StyleExt : TCustomStyleExt read FStyleExt; - property Elements : TVCLStylesElements read FElements write FElements; - constructor Create(const StyleName : string;Clone:Boolean=False); + property StyleExt: TCustomStyleExt read FStyleExt; + property Elements: TVCLStylesElements read FElements write FElements; + constructor Create(const StyleName: string;Clone:Boolean=False); destructor Destroy;override; - class procedure SaveSettings(const FileName:String;Elements :TVCLStylesElements; FilterType : TVCLStylesFilter;Filters : TObjectList); - class procedure LoadSettings(const FileName:String;var Elements :TVCLStylesElements; var FilterType : TVCLStylesFilter;Filters : TObjectList); + class procedure SaveSettings(const FileName:String;Elements :TVCLStylesElements; FilterType: TVCLStylesFilter;Filters: TObjectList); + class procedure LoadSettings(const FileName:String;var Elements :TVCLStylesElements; var FilterType: TVCLStylesFilter;Filters: TObjectList); //class procedure LoadAndApplySettings(const FileName:String); end; const - VCLStylesFilterNames : Array[TVCLStylesFilter] of string = ('HSL','RGB','Blend','Texture Blend'); + VCLStylesFilterNames: Array[TVCLStylesFilter] of string = ('HSL','RGB','Blend','Texture Blend'); implementation @@ -70,7 +70,7 @@ implementation { TVclStylesUtils } -constructor TVclStylesUtils.Create(const StyleName : string;Clone:Boolean=False); +constructor TVclStylesUtils.Create(const StyleName: string;Clone:Boolean=False); var FSourceInfo: TSourceInfo; begin @@ -117,11 +117,11 @@ procedure TVclStylesUtils.ApplyChanges; end; end; -class procedure TVclStylesUtils.SaveSettings(const FileName:String;Elements :TVCLStylesElements; FilterType : TVCLStylesFilter;Filters : TObjectList); +class procedure TVclStylesUtils.SaveSettings(const FileName:String;Elements :TVCLStylesElements; FilterType: TVCLStylesFilter;Filters: TObjectList); var - Doc : IXMLDocument; - RootNode, ChildNode, oNode : IXMLNode; - LFilter : TBitmapFilter; + Doc: IXMLDocument; + RootNode, ChildNode, oNode: IXMLNode; + LFilter: TBitmapFilter; begin Doc :=TXMLDocument.Create(nil); try @@ -149,16 +149,16 @@ class procedure TVclStylesUtils.SaveSettings(const FileName:String;Elements :TVC end; end; -class procedure TVclStylesUtils.LoadSettings(const FileName:String;var Elements :TVCLStylesElements; var FilterType : TVCLStylesFilter;Filters : TObjectList); +class procedure TVclStylesUtils.LoadSettings(const FileName:String;var Elements :TVCLStylesElements; var FilterType: TVCLStylesFilter;Filters: TObjectList); var - Doc : IXMLDocument; - RootNode, ChildNode, oNode : IXMLNode; + Doc: IXMLDocument; + RootNode, ChildNode, oNode: IXMLNode; LFilterType :TVCLStylesFilter; - i : Integer; - LClassName : string; - Ctx : TRttiContext; - RttiInstanceType : TRttiInstanceType; - Value : TValue; + i: Integer; + LClassName: string; + Ctx: TRttiContext; + RttiInstanceType: TRttiInstanceType; + Value: TValue; begin Doc :=LoadXMLDocument(FileName); try @@ -215,14 +215,14 @@ procedure TVclStylesUtils.SaveToFile(const FileName: string); procedure TVclStylesUtils.SetFilters(Filters: TObjectList); var - LBitmap : TBitmap; + LBitmap: TBitmap; BitmapList: TObjectList; - Index : Integer; - Filter : TBitmapFilter; - Element : TIdentMapEntry; - LColor : TColor; + Index: Integer; + Filter: TBitmapFilter; + Element: TIdentMapEntry; + LColor: TColor; StyleColor: TStyleColor; - StyleFont : TStyleFont; + StyleFont: TStyleFont; begin if vseBitmaps in FElements then begin diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.UxTheme.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.UxTheme.pas index 52daccf..074306c 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.UxTheme.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.UxTheme.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.UxTheme.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2020 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -154,30 +154,30 @@ implementation type TDrawThemeBackground = function(hTheme: hTheme; hdc: hdc; iPartId, iStateId: Integer; const pRect: TRect; Foo: Pointer): HRESULT; stdcall; - TFuncDrawThemeBackground = function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; Foo: Pointer; Trampoline : TDrawThemeBackground; LThemeClass : string; hwnd : HWND): HRESULT; stdcall; + TFuncDrawThemeBackground = function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; Foo: Pointer; Trampoline: TDrawThemeBackground; LThemeClass: string; hwnd: HWND): HRESULT; stdcall; var - Trampoline_UxTheme_OpenThemeDataEx : function(hwnd: HWND; pszClassList: LPCWSTR; dwFlags: DWORD): HTHEME; stdcall = nil; - Trampoline_UxTheme_OpenThemeData : function(hwnd: HWND; pszClassList: LPCWSTR): HTHEME; stdcall = nil; + Trampoline_UxTheme_OpenThemeDataEx: function(hwnd: HWND; pszClassList: LPCWSTR; dwFlags: DWORD): HTHEME; stdcall = nil; + Trampoline_UxTheme_OpenThemeData: function(hwnd: HWND; pszClassList: LPCWSTR): HTHEME; stdcall = nil; {$IF CompilerVersion >= 30} - Trampoline_UxTheme_OpenThemeDataForDPI : function(hwnd: HWND; pszClassList: LPCWSTR; dpi: UINT): HTHEME; stdcall = nil; + Trampoline_UxTheme_OpenThemeDataForDPI: function(hwnd: HWND; pszClassList: LPCWSTR; dpi: UINT): HTHEME; stdcall = nil; {$IFEND} - Trampoline_UxTheme_CloseThemeData : function(hTheme: HTHEME): HRESULT; stdcall = nil; - Trampoline_UxTheme_DrawThemeBackground : function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; pClipRect: Pointer): HRESULT; stdcall = nil; - Trampoline_UxTheme_DrawThemeBackgroundEx : function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; pOptions: Pointer): HResult; stdcall = nil; - Trampoline_UxTheme_GetThemeColor : function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var pColor: COLORREF): HRESULT; stdcall = nil; - Trampoline_UxTheme_GetThemeSysColor : function(hTheme: HTHEME; iColorId: Integer): COLORREF; stdcall = nil; - Trampoline_UxTheme_GetThemeSysColorBrush : function(hTheme: HTHEME; iColorId: Integer): HBRUSH; stdcall = nil; - Trampoline_UxTheme_DrawThemeText : function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; pszText: LPCWSTR; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; const pRect: TRect): HRESULT; stdcall = nil; - Trampoline_UxTheme_DrawThemeTextEx : function(hTheme: HTHEME; hdc: HDC; iPartId: Integer; iStateId: Integer; pszText: LPCWSTR; cchText: Integer; dwTextFlags: DWORD; pRect: PRect; var pOptions: TDTTOpts): HResult; stdcall = nil; - Trampoline_UxTheme_DrawThemeEdge : function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pDestRect: TRect; uEdge, uFlags: UINT; pContentRect: PRECT): HRESULT; stdcall = nil; + Trampoline_UxTheme_CloseThemeData: function(hTheme: HTHEME): HRESULT; stdcall = nil; + Trampoline_UxTheme_DrawThemeBackground: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; pClipRect: Pointer): HRESULT; stdcall = nil; + Trampoline_UxTheme_DrawThemeBackgroundEx: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pRect: TRect; pOptions: Pointer): HResult; stdcall = nil; + Trampoline_UxTheme_GetThemeColor: function(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer; var pColor: COLORREF): HRESULT; stdcall = nil; + Trampoline_UxTheme_GetThemeSysColor: function(hTheme: HTHEME; iColorId: Integer): COLORREF; stdcall = nil; + Trampoline_UxTheme_GetThemeSysColorBrush: function(hTheme: HTHEME; iColorId: Integer): HBRUSH; stdcall = nil; + Trampoline_UxTheme_DrawThemeText: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; pszText: LPCWSTR; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; const pRect: TRect): HRESULT; stdcall = nil; + Trampoline_UxTheme_DrawThemeTextEx: function(hTheme: HTHEME; hdc: HDC; iPartId: Integer; iStateId: Integer; pszText: LPCWSTR; cchText: Integer; dwTextFlags: DWORD; pRect: PRect; var pOptions: TDTTOpts): HResult; stdcall = nil; + Trampoline_UxTheme_DrawThemeEdge: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; const pDestRect: TRect; uEdge, uFlags: UINT; pContentRect: PRECT): HRESULT; stdcall = nil; - THThemesClasses : TDictionary; - THThemesHWND : TDictionary; + THThemesClasses: TDictionary; + THThemesHWND: TDictionary; - FuncsDrawThemeBackground : TDictionary; + FuncsDrawThemeBackground: TDictionary; - VCLStylesLock : TCriticalSection = nil; + VCLStylesLock: TCriticalSection = nil; { Helper methods } @@ -530,7 +530,7 @@ function Detour_UxTheme_GetThemeSysColorBrush(hTheme: hTheme; iColorId: Integer) Doesn't affect Compressed files font color (blue) } -function Detour_UxTheme_GetThemeColor(hTheme: hTheme; iPartId, iStateId, iPropId: Integer; var pColor: COLORREF) : HRESULT; stdcall; +function Detour_UxTheme_GetThemeColor(hTheme: hTheme; iPartId, iStateId, iPropId: Integer; var pColor: COLORREF): HRESULT; stdcall; var LThemeClass: string; begin @@ -677,8 +677,8 @@ function Detour_UxTheme_GetThemeColor(hTheme: hTheme; iPartId, iStateId, iPropId case iPartId of 9: case iStateId of - 1 : pColor := ColorToRGB(StyleServices.GetSystemColor(clWindow)); - 2 : pColor := ColorToRGB(StyleServices.GetSystemColor(clHighlight)); + 1: pColor := ColorToRGB(StyleServices.GetSystemColor(clWindow)); + 2: pColor := ColorToRGB(StyleServices.GetSystemColor(clHighlight)); end; end; @@ -699,7 +699,7 @@ function Detour_UxTheme_GetThemeColor(hTheme: hTheme; iPartId, iStateId, iPropId case iPartId of 13: case iStateId of - 0 : pColor := ColorToRGB(StyleServices.GetSystemColor(clBtnFace)); + 0: pColor := ColorToRGB(StyleServices.GetSystemColor(clBtnFace)); end; end; @@ -721,7 +721,7 @@ function Detour_UxTheme_GetThemeColor(hTheme: hTheme; iPartId, iStateId, iPropId case iPartId of 11: case iStateId of - 0 : pColor := ColorToRGB(StyleServices.GetStyleColor(scPanel)); + 0: pColor := ColorToRGB(StyleServices.GetStyleColor(scPanel)); end; end; @@ -1181,12 +1181,12 @@ function Detour_UxTheme_DrawThemeText(hTheme: hTheme; hdc: hdc; iPartId, iStateI LDetails := StyleServices.GetElementDetails(tmPopupItemNormal); MPI_HOT: LDetails := StyleServices.GetElementDetails(tmPopupItemHot); - // MPI_PUSHED : LDetails := StyleServices.GetElementDetails(tmMenuBarItemPushed); + // MPI_PUSHED: LDetails := StyleServices.GetElementDetails(tmMenuBarItemPushed); MPI_DISABLED: LDetails := StyleServices.GetElementDetails(tmPopupItemDisabled); MPI_DISABLEDHOT: LDetails := StyleServices.GetElementDetails(tmPopupItemDisabledHot); - // MPI_DISABLEDPUSHED : LDetails := StyleServices.GetElementDetails(tmMenuBarItemDisabledPushed); + // MPI_DISABLEDPUSHED: LDetails := StyleServices.GetElementDetails(tmMenuBarItemDisabledPushed); else LDetails := StyleServices.GetElementDetails(tmPopupItemNormal); end; @@ -1280,11 +1280,11 @@ function Detour_UxTheme_DrawThemeText(hTheme: hTheme; hdc: hdc; iPartId, iStateI MC_TRAILINGGRIDCELLUPPER, MC_GRIDCELLUPPER, MC_GRIDCELL: begin // case iStateId of - // MCGCB_SELECTED : LDetails := StyleServices.GetElementDetails(tgCellSelected); - // MCGCB_HOT : LDetails := StyleServices.GetElementDetails(tgFixedCellHot); - // MCGCB_SELECTEDHOT : LDetails := StyleServices.GetElementDetails(tgCellSelected); - // MCGCB_SELECTEDNOTFOCUSED : LDetails := StyleServices.GetElementDetails(tgCellSelected); - // MCGCB_TODAY : LDetails := StyleServices.GetElementDetails(tgFixedCellHot); + // MCGCB_SELECTED: LDetails := StyleServices.GetElementDetails(tgCellSelected); + // MCGCB_HOT: LDetails := StyleServices.GetElementDetails(tgFixedCellHot); + // MCGCB_SELECTEDHOT: LDetails := StyleServices.GetElementDetails(tgCellSelected); + // MCGCB_SELECTEDNOTFOCUSED: LDetails := StyleServices.GetElementDetails(tgCellSelected); + // MCGCB_TODAY: LDetails := StyleServices.GetElementDetails(tgFixedCellHot); // else // LDetails := StyleServices.GetElementDetails(tgCellNormal); // end; @@ -2169,8 +2169,8 @@ function UxTheme_Header(hTheme: hTheme; hdc: hdc; iPartId, iStateId: Integer; co HP_HEADERSORTARROW: begin // case iStateId of - // HSAS_SORTEDUP : LDetails := StyleServices.GetElementDetails(thHeaderSortArrowSortedUp); - // HSAS_SORTEDDOWN : LDetails := StyleServices.GetElementDetails(thHeaderSortArrowSortedDown); + // HSAS_SORTEDUP: LDetails := StyleServices.GetElementDetails(thHeaderSortArrowSortedUp); + // HSAS_SORTEDDOWN: LDetails := StyleServices.GetElementDetails(thHeaderSortArrowSortedDown); // end; LColor := GetStyleHighLightColor(); @@ -3585,7 +3585,7 @@ function UxTheme_ProgressBar(hTheme: hTheme; hdc: hdc; iPartId, iStateId: Intege LDetails := StyleServices.GetElementDetails(tpChunkVert); // GetElementDetails(tpFillVert); not defined // Use the Native PP_PULSEOVERLAY part to get better results. - // PP_PULSEOVERLAY : if SameText(THThemesClasses.Items[hTheme], VSCLASS_PROGRESS) then + // PP_PULSEOVERLAY: if SameText(THThemesClasses.Items[hTheme], VSCLASS_PROGRESS) then // LDetails := StyleServices.GetElementDetails(tpChunk)//GetElementDetails(tpPulseOverlay); // else // LDetails := StyleServices.GetElementDetails(tpBar); @@ -3596,8 +3596,8 @@ function UxTheme_ProgressBar(hTheme: hTheme; hdc: hdc; iPartId, iStateId: Intege else LDetails := StyleServices.GetElementDetails(tpChunk); - // PP_PULSEOVERLAYVERT : LDetails := StyleServices.GetElementDetails(tpPulseOverlayVert); - // PP_MOVEOVERLAYVERT : LDetails := StyleServices.GetElementDetails(tpMoveOverlayVert); + // PP_PULSEOVERLAYVERT: LDetails := StyleServices.GetElementDetails(tpPulseOverlayVert); + // PP_MOVEOVERLAYVERT: LDetails := StyleServices.GetElementDetails(tpMoveOverlayVert); PP_TRANSPARENTBAR: LDetails := StyleServices.GetElementDetails(tpBar); // GetElementDetails(tpTransparentBarNormal); not defined diff --git a/Ext/VCLStyleUtils/Common/Vcl.Styles.WebBrowser.pas b/Ext/VCLStyleUtils/Common/Vcl.Styles.WebBrowser.pas index ec575dc..f9df32e 100644 --- a/Ext/VCLStyleUtils/Common/Vcl.Styles.WebBrowser.pas +++ b/Ext/VCLStyleUtils/Common/Vcl.Styles.WebBrowser.pas @@ -15,7 +15,7 @@ // The Original Code is Vcl.Styles.WebBrowser.pas. // // The Initial Developer of the Original Code is Rodrigo Ruz V. -// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2019 Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2021 Rodrigo Ruz V. // All Rights Reserved. // // ************************************************************************************************** @@ -67,14 +67,14 @@ TDocHostUIInfo = record function GetHostInfo(var pInfo: TDocHostUIInfo): HRESULT; stdcall; function ShowUI(const dwID: DWORD; const pActiveObject: IOleInPlaceActiveObject; const pCommandTarget: IOleCommandTarget; const pFrame: IOleInPlaceFrame; const pDoc: IOleInPlaceUIWindow) - : HRESULT; stdcall; +: HRESULT; stdcall; function HideUI: HRESULT; stdcall; function UpdateUI: HRESULT; stdcall; function EnableModeless(const fEnable: BOOL): HRESULT; stdcall; function OnDocWindowActivate(const fActivate: BOOL): HRESULT; stdcall; function OnFrameWindowActivate(const fActivate: BOOL): HRESULT; stdcall; function ResizeBorder(const prcBorder: PRECT; const pUIWindow: IOleInPlaceUIWindow; const FrameWindow: BOOL) - : HRESULT; stdcall; +: HRESULT; stdcall; function TranslateAccelerator(const lpMsg: PMSG; const pguidCmdGroup: PGUID; const nCmdID: DWORD): HRESULT; stdcall; function GetOptionKeyPath(var pchKey: POLESTR; const dw: DWORD): HRESULT; stdcall; function GetDropTarget(const pDropTarget: IDropTarget; out ppDropTarget: IDropTarget): HRESULT; stdcall; diff --git a/Source/CBVCLStylePreview.pas b/Source/CBVCLStylePreview.pas index cc6b9e4..751020b 100644 --- a/Source/CBVCLStylePreview.pas +++ b/Source/CBVCLStylePreview.pas @@ -4,7 +4,7 @@ { based on: VCLStylePreview Vcl.Styles.Ext } { https://github.com/RRUZ/vcl-styles-utils/ } { } -{ Copyright (c) 2020 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { } { https://github.com/EtheaDev/VCLThemeSelector } diff --git a/Source/CBVCLStylePreviewForm.pas b/Source/CBVCLStylePreviewForm.pas index 7eb8915..b09c9f8 100644 --- a/Source/CBVCLStylePreviewForm.pas +++ b/Source/CBVCLStylePreviewForm.pas @@ -4,7 +4,7 @@ { based on: VCLStylePreview Vcl.Styles.Ext } { https://github.com/RRUZ/vcl-styles-utils/ } { } -{ Copyright (c) 2020 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { } { https://github.com/EtheaDev/VCLThemeSelector } diff --git a/Source/FVCLThemeSelector.dfm b/Source/FVCLThemeSelector.dfm index 6951b80..5774811 100644 --- a/Source/FVCLThemeSelector.dfm +++ b/Source/FVCLThemeSelector.dfm @@ -7,13 +7,14 @@ object VCLThemeSelectorForm: TVCLThemeSelectorForm ClientWidth = 1065 Color = clBtnFace ParentFont = True + OldCreateOrder = True Position = poScreenCenter ShowHint = True OnAfterMonitorDpiChanged = FormAfterMonitorDpiChanged OnCreate = FormCreate OnResize = FormResize PixelsPerInch = 96 - TextHeight = 25 + TextHeight = 13 object paButtons: TPanel Left = 0 Top = 464 diff --git a/Source/FVCLThemeSelector.pas b/Source/FVCLThemeSelector.pas index 7ff1145..dddd50c 100644 --- a/Source/FVCLThemeSelector.pas +++ b/Source/FVCLThemeSelector.pas @@ -2,7 +2,7 @@ { } { VCLThemeSelector: Form for Preview and Selection of VCL Style } { } -{ Copyright (c) 2020, 2021 (Ethea S.r.l.) } +{ Copyright (c) 2020-2022 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributor: Nicola Tambascia } { } @@ -37,7 +37,8 @@ interface , Vcl.Forms , Vcl.StdCtrls , Vcl.Graphics - , Vcl.Controls; + , Vcl.Controls + , Vcl.DBCtrls; const VCLThemeSelectorVersion = '1.3.1'; @@ -45,6 +46,32 @@ interface DEFAULT_MAXCOLUMNS = 4; resourcestring +{$IFDEF LANGUAGE_ITA} + SELECT_THEME = 'Seleziona il tema chiaro o scuro'; + APPLY_THEME = 'Applica'; + CANCEL_THEME = 'Annulla'; + LIGHT_THEMES = 'Temi chiari'; + DARK_THEMES = 'Temi scuri'; + + PREVIEW_THEME = 'Anteprima'; + THEME_SELECTED = 'Nuovo tema selezionato: %s'; + THEME_PREVIEW_VALUES = + 'File'+sLineBreak+ + 'Modifica'+sLineBreak+ + 'Visualizza'+sLineBreak+ + 'Help'+sLineBreak+ + 'Editor di testo'+sLineBreak+ + 'Normale'+sLineBreak+ + 'Caldo'+sLineBreak+ + 'Premuto'+sLineBreak+ + 'Disabilitato'+sLineBreak+ + 'Obbligatorio'+sLineBreak+ + 'Sola lettura'+sLineBreak+ + 'Spunta'+sLineBreak+ + 'Pag. 1'+sLineBreak+ + 'Pag. 2'+sLineBreak+ + 'Pag. 3'+sLineBreak; +{$ELSE} SELECT_THEME = 'Select Light or Dark theme'; APPLY_THEME = 'Apply'; CANCEL_THEME = 'Cancel'; @@ -69,6 +96,7 @@ interface 'Page 1'+sLineBreak+ 'Page 2'+sLineBreak+ 'Page 3'+sLineBreak; +{$ENDIF} type TVCLThemeSelectorForm = class(TForm) @@ -142,6 +170,13 @@ procedure ReadAppStyleAndFontFromReg(const CompanyName, ApplicationName: string; out AAppStyle: string; const AFont: TFont); procedure WriteAppStyleAndFontToReg(const CompanyName, ApplicationName: string; const AAppStyle: string; const AFont: TFont); +procedure SetEditorStyleAttributes(const AEditControl: TDBEdit); +procedure SetRequiredEditStyleAttributes(const AEdit: TCustomEdit); + +//To add new styles used from your application that are not managed by default +procedure RegisterThemeAttributes(const AVCLStyleName: string; + const AThemeType: TThemeType; const AEditRequiredColor: TColor; + const AEditReadonlyColor: TColor); implementation @@ -149,6 +184,7 @@ implementation uses Vcl.Themes + , System.TypInfo {$IF CompilerVersion > 33} , CBVCLStylePreviewForm {$IFEND} @@ -178,7 +214,8 @@ function GetStyleAttributes(const AStyleName: string; end; Result := False; AThemeAttribute := nil; - raise Exception.CreateFmt('Attributes for Style "%s" not found',[AStyleName]); + raise Exception.CreateFmt('Attributes for Style "%s" not found!'+sLineBreak+ + 'please call RegisterThemeAttributes in an initialization section to add your custom style',[AStyleName]); end; procedure FreeThemesAttributes; @@ -297,6 +334,8 @@ procedure ReadAppStyleAndFontFromReg(const CompanyName, ApplicationName: string; begin if FRegistry.ValueExists('FontName') then AFont.Name := FRegistry.ReadString('FontName'); + if FRegistry.ValueExists('PixelsPerInch') then + AFont.PixelsPerInch := FRegistry.ReadInteger('PixelsPerInch'); if FRegistry.ValueExists('FontHeight') then AFont.Height := FRegistry.ReadInteger('FontHeight'); if FRegistry.ValueExists('FontColor') then @@ -323,6 +362,7 @@ procedure WriteAppStyleAndFontToReg(const CompanyName, ApplicationName: string; begin FRegistry.WriteString('FontName',AFont.Name); FRegistry.WriteInteger('FontHeight',AFont.Height); + FRegistry.WriteInteger('PixelsPerInch',AFont.PixelsPerInch); FRegistry.WriteInteger('FontColor',AFont.Color); FRegistry.WriteBool('FontBold',fsBold in AFont.Style); FRegistry.WriteBool('FontItalic',fsItalic in AFont.Style); @@ -371,6 +411,89 @@ function ShowVCLThemeSelector(var AStyleName: string; End; end; +procedure SetEditorStyleAttributes(const AEditControl: TDBEdit); +var + LActiveStyleName: string; + LThemeAttribute: TThemeAttribute; + LDetails: TThemedElementDetails; + LFontColor: TColor; +begin + AEditControl.StyleElements := [seBorder]; + + //Retrieve info from my LThemeAttribute structure + LActiveStyleName := TStyleManager.ActiveStyle.Name; + if GetStyleAttributes(LActiveStyleName, LThemeAttribute) then + begin + if AEditControl.ReadOnly then + AEditControl.Color := LThemeAttribute.EditReadonlyColor + else + AEditControl.Color := LThemeAttribute.EditRequiredColor; + end + else + begin + AEditControl.Color := clWindow; + end; + + if StyleServices.Enabled then + begin + LDetails := StyleServices.GetElementDetails(teEditTextNormal); + StyleServices.GetElementColor(LDetails, ecTextColor, LFontColor); + end + else + LFontColor := clDefault; + + AEditControl.Font.Color := LFontColor; +end; + +procedure SetRequiredEditStyleAttributes(const AEdit: TCustomEdit); +var + LActiveStyleName: string; + LThemeAttribute: TThemeAttribute; + LDetails: TThemedElementDetails; + LFontColor: TColor; + LFont: TFont; + LReadOnly: Boolean; +begin + AEdit.StyleElements := [seBorder]; + + //Recupero le informazioni dalla mia struttura LThemeAttribute + LActiveStyleName := TStyleManager.ActiveStyle.Name; + if IsPublishedProp(AEdit, 'Color') then + begin + if GetStyleAttributes(LActiveStyleName, LThemeAttribute) then + begin + if IsPublishedProp(AEdit, 'ReadOnly') then + LReadOnly := Boolean(GetOrdProp(AEdit, 'ReadOnly')) + else + LReadOnly := AEdit.ReadOnly; + + //Imposto il colore del componente di Edit tramite RTTI + if LReadOnly then + SetOrdProp(AEdit, 'Color', LThemeAttribute.EditReadonlyColor) + else + SetOrdProp(AEdit, 'Color', LThemeAttribute.EditRequiredColor); + end + else + SetOrdProp(AEdit, 'Color', clWindow); + end; + + if StyleServices.Enabled and (LActiveStyleName <> 'Windows') then + begin + LDetails := StyleServices.GetElementDetails(teEditTextNormal); + StyleServices.GetElementColor(LDetails, ecTextColor, LFontColor); + end + else + LFontColor := clWindowText; + + if IsPublishedProp(AEdit, 'Font') then + begin + LFont := GetObjectProp(AEdit, 'Font', TFont) as TFont; + LFont.Color := LFontColor; + end; +end; + +{ TVCLThemeSelectorForm } + procedure TVCLThemeSelectorForm.acApplyStyleExecute(Sender: TObject); begin inherited;