|
Project Information
Members
|
IntroductionThe VCL Styles Utils is a collection of classes, which extend and add new features to the VCL Styles (introduced in Delphi XE2). This project consist of two parts 1) Introduces the Vcl.Styles.Ext unit which extend the TStyleManager Delphi class adding new properties and methods to list, remove and reload the vcl styles. The extension of the TStyleManager class was made using class helpers, because that only you must add the Vcl.Styles.Ext unit to your project to start to use it. Example to remove a vcl style TStyleManager.RemoveStyle('Carbon');This unit also a define a new class called TCustomStyleExt that descends of the TCustomStyle and allow you to access to the RAW data of the vcl styles like bitmaps, fonts and colors. For example you can modify the vcl styles colors in this way TCustomStyleExt(TStyleManager.ActiveStyle).SetStyleColor(scEdit, clRed); TCustomStyleExt(TStyleManager.Style[StyleName]).SetSystemColor(clBtnFace,clLime); TCustomStyleExt(TStyleManager.Style[StyleName]).SetStyleColor(scBorder, clBlue); TCustomStyleExt(TStyleManager.Style[StyleName]).SetStyleFontColor(sfButtonTextNormal, clYellow); 2) The Vcl.Styles.Utils unit contain classes to modify existing styles using color operations like Blend, HSL and RGB. Check this form with the Carbon style applied.
//This code shows how you can add a Overlay blend effect to an existing vcl style
//and then apply the changes in run-time.
procedure TFrmMain.FormCreate(Sender: TObject);
var
VclStylesUtils : TVclStylesUtils;
Filters : TObjectList<TBitmapFilter>;
begin
//create the instance to the TVclStylesUtils using the carbon vcl style
VclStylesUtils:=TVclStylesUtils.Create('Carbon');
//create the filter list to apply
Filters:=TObjectList<TBitmapFilter>.Create;
try
//create a TBitmap32BlendOverlay filter and add to the list
Filters.Add(TBitmap32BlendOverlay.Create(clYellow));
//set the elements to be affected
VclStylesUtils.Elements:=VclStylesUtils.Elements+ [vseBitmaps ,vseSysColors, vseStyleColors];
//set the filters
VclStylesUtils.SetFilters(Filters);
//Apply the changes to the style
VclStylesUtils.ApplyChanges;
//reload the modified style
TStyleManager.ReloadStyle('Carbon');
finally
VclStylesUtils.Free;
Filters.Free;
end;
end;
And this is the result after of apply the above code
The repository contains several demos projects to see all the features of the VCL Styles Utils in action. Enjoy. Screenshoots
Videos
|