The Road to Delphi

Delphi – Free Pascal – Oxygene

VCL Styles Utils – Major Update (Dialogs, ProgressBar, DateTimePicker, ListView and more)

20 Comments

A Major updated was made to the VCL Styles Utils project. This version include several fixes and new features.

Vcl.Styles.Hooks

The Vcl.Styles.Hooks unit is the most updated part of this new release. This unit is the responsible of hook some of the UxTheme and WinApi methods like DrawThemeBackground, GetSysColor and GetSysColorBrush. Which allows take the control of the painting process for the system themed (and owner-draw) controls.

ListView

This new release fix the highlight color used on the selected items and also replace the themed checkBox by a styled checkbox.

ListView with VCL Styles
2014-11-04 11_08_19-Demo

ListView with VCL Styles + Vcl.Styles.Hooks unit
2014-11-04 11_08_55-Demo

Also was added support for style the Listview groups.

ListView with VCL Styles

2014-11-04 11_11_23-Demo

ListView with VCL Styles + Vcl.Styles.Hooks unit

2014-11-04 11_12_45-Demo

DateTime Controls

The Styling of the TMonthCalendar and TDatetimepicker components is one of the limitations of the VCL Styles, because such components are owner-draw by the system and doesn’t allow to customize the look and feel when the native themes are enabled (for more information read these TMonthCalendar and TDatetimepicker ) also only the newest versions of Delphi includes a partial styling support for such components. With this new release the styling of these controls is now possible.

TDateTimePicker and TMonthCalendar with VCL Styles

2014-11-04 11_29_24-Demo - RAD Studio XE7 - uMain [Running] [Built]

TDateTimePicker and TMonthCalendar with VCL Styles + Vcl.Styles.Hooks unit

2014-11-04 11_54_31-Demo - Embarcadero RAD Studio XE2 - Vcl.Styles.Hooks [Running] [Built]

ProgressBar

Improved support for the TProgressbar component without flicker and with Marquee style.

2014-11-04 14_48_10-Demo

Select Directory Dialog

The styling for the select directory dialog was enhanced adding support for the open and close glyphs and fixing the color of the highlight bar.

VCL Styles Utils

2014-11-04 15_01_14-Browse For Folder

VCL Styles Utils + Vcl.Styles.Hooks unit

2014-11-04 15_01_52-Greenshot

Open/Save Dialog

The VCL Styles support of the Open and Save dialogs was improved adding styling for groups and highlight items. Also a fix for the select folder combobox was introduced.

VCL Styles Utils

2014-11-04 15_12_50-Open

2014-11-04 15_20_49-Open

2014-11-04 15_26_07-ThemedSysControls - Embarcadero RAD Studio XE2 - ThemedSysControls.dproj [Runnin

VCL Styles Utils + Vcl.Styles.Hooks unit

2014-11-04 15_14_27-Open

2014-11-04 15_21_25-Open

2014-11-04 15_25_16-Edit Post ‹ The Road to Delphi - a Blog about programming — WordPress

Author: Rodrigo

Just another Delphi guy.

20 thoughts on “VCL Styles Utils – Major Update (Dialogs, ProgressBar, DateTimePicker, ListView and more)

  1. Pingback: TDateTimePicker Win 8.1 - Delphi-PRAXiS

  2. Hello, when i try to add vcl.styles.hooks and vcl.styles.utils to a project I get exception in the system.generics.collections unit. function TDictionary.GetItem(const key : TKey): TValue The error is Item not found.
    If I remove your two units and just style as normal all works fine. Any ideas?

  3. Rodrigo, you are my hero!
    You find a way to style the ListView Group Header!
    That’s sooo great!!!

    But I found one issue with the background drawing of the calendar.
    The hot items (days) remain selected painted.

    Please replace in Vcl.Styles.Hooks.pas function Detour_UxTheme_DrawThemeMain line 587 this code with the following code with local canvas to clear the background:

    { old version
    MC_BACKGROUND,
    MC_BORDERS,
    MC_GRIDBACKGROUND : begin
    SaveIndex := SaveDC(hdc);
    try
    LDetails:=StyleServices.GetElementDetails(teBackgroundNormal);
    StyleServices.DrawElement(hdc, LDetails, pRect, nil);
    finally
    RestoreDC(hdc, SaveIndex);
    end;
    Result:=S_OK;
    end;”
    }

    MC_BACKGROUND,
    MC_BORDERS,
    MC_GRIDBACKGROUND :
    begin
    SaveIndex := SaveDC(hdc);
    LCanvas := TCanvas.Create;
    try
    LCanvas.Handle := hdc;
    LCanvas.Brush.Color := StyleServices.GetStyleColor(scGenericBackground);
    LCanvas.FillRect(pRect);

    LDetails := StyleServices.GetElementDetails(teBackgroundNormal);
    StyleServices.DrawElement(hdc, LDetails, pRect, nil);
    finally
    LCanvas.Handle := 0;
    LCanvas.Free;
    RestoreDC(hdc, SaveIndex);
    end;
    Result := S_OK;
    end;

  4. Pingback: VCL Styles Utils – Major Update (Dialogs,...

  5. Can this be used with Delphi XE7 Starter Edition?

    I tried but will not compile due cannot find StyleUtils.inc StylesAPI.inc.

  6. Hi Bob, I just edited my original answer (sorry for that), the Vcl.Styles.Utils unit cannot be used in the starter edition, but this is just a very small part of the library.

  7. OK. Thanks for your replies.

  8. Can you apply styles to TTreeView Delphi component?

  9. Hi Rodrigo,,
    How to excluding “Title bar” from VCL style?
    Thanks :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s