Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a Vcl-Theme-Style for my own Component?

I use the BitmapStyleDesigner.exe (shipped with delphi xe5) to edit vcl styles to my application.

How can i add a custom component to the styler palette? i want my TMyButton, which inherits TButton, have a different color, shape, etc than the standard TButton.

Can this be done only by editing the style, or do i have to edit the source of TMyButton?

The embarcadero wiki hadn't helped (so far).

Thanks in advance!

like image 472
linluk Avatar asked Oct 29 '14 13:10

linluk


1 Answers

Editing the VCL Style file is not enough. Unfortunately the VCL Styles are not designed to be extensible on the manner which your describe, Even if is technical possible do that, what you describe will require a lot of work. because you must modify the source of the Vcl.Themes and the Vcl.Styles units. My recommendation is not modify the style file, instead create a new style hook for your button and implement the paint code your self loading the images from a resource file.

like image 95
RRUZ Avatar answered Sep 30 '22 07:09

RRUZ