Firemonkey default Windows style? - delphi

Delphi XE6
When I create a new Firemonkey Desktop Application, and drop a TGrid on the form, and edit the default style, it shows the TImage as:
"StyleBook1Windows 7style.png"
Where is the *.vsf file for this image. I would like to export the PNG from it and modify it and create a new style.

If you are trying to create your own style, you can get the bitmap used by an existing style using the following steps.
Launch the Bitmap Style Designer from the Delphi IDE menu - Tools |
Bitmap Style Designer.
Then from the Style Designer, select File | Open followed by selecting the .vsf file you wish to extract the bitmap from. You'll find a bunch of these in your c:\users\public\documents\embarcadero\studio\17.0\Styles directory. Change the 17.0 in the directory name to 14.0 for Delphi 6.
From the list of objects on the left, select Images. Expand images and you should see style.png
Now select Export (which is above the bitmap) which allows you to save the bitmap to a file

You don't really need the original file. If you click on the SourceLink property (click on the (TBitmapLinks)--not on the '...' button)) the Bitmaplinks Editor opens. There you can upload your own png file and define the areas you want to use in the style.

Related

Where can I find the Styles I downloaded from GetIt Manager

I downloaded a bunch of styles from the GetIt Manager in RAD Studio and was wondering where I could possibly find them now?
They can be found within the CatalogRepository folder. You can find that folder at C:\Users\YourNameOrWhatever\Documents\Embarcadero\Studio\22.0\CatalogRepository.
Using the styles in VCL:
Go to the appearance item under Project Settings. From there you can choose a custom style for your app. All the GetIt downloaded styles will appear there.
Using the styles in FMX:
Add a TStylebook component onto the form and then import the style you want into the component. After that, go to your form's properties and set the Stylebook property equal to your Stylebook component.

Default Firemonkey style sheet (file) for Delphi XE-6 Firemonkey Desktop Application?

Delphi XE-6 Firemonkey
I am trying to custom style the checkbox in a TGrid's TCheckColumn
I want to first understand how the default style is created. What all the elements are that make up its style.
Anyone know how to get the default style sheet for a default Firemonkey desktop application in Delphi XE-6?
If I drop a TGrid on a Firemonkey desktop application, and add a TCheckColumn to the grid, where is this default style of the grid, TCheckColumn / CheckCellStyle coming from?
I am trying to obtain its file (*.style), name. or the text.
If I add a TStyleBook, and then double click it and choose save, it only saves the StyleContainer, none of the styles for any control - especially the grid. Its just empty
object TStyleContainer
end
I have also tried to see if there was a default name in the StyleManager
for s in TStyleManager.StyleNames do
ShowMessage(S);
Anyone know how to get the default style sheet for a default firemonkey desktop application in Delphi XE-6?
Right click on the component (eg. Grid) and choose "Edit Style..." or "Edit Default Style" (can't remember which menu was in XE6). This will reveal the style elements of the component. Then you can save them to a .style file.

How can I extract a PNG from a delphi XE5 firemonkey style?

I'm trying to change the color used when elements of the MetropolisUIBlack.Style XE5 style (Firemonkey). It seems that, in order to do so, the simplest way would be to edit the PNG image that contains all these elements i the style (MetroBluestyle.png).
Unfortunately, I can't find a way to save the PNG that is contained in the style element to a file so I can manipulate it safely and reload it once the color has been changed.
Use the Bitmap Style Designer provided with the product.
You can find it in the Tools menĂ¹ and, once started, you simply have to open the MetropolisUIBlack.vsf file, select the "style.png" item under Images and click the Export button (above the right panel where you can see a preview of the picture).
Edit the picture with your favorite editor (i.e. The Gimp), save the picture, and load it back in the style using the Update button (just left the Export one).
You can save your style with a different name and use it as usual.
HTH

How to use different icon size on delphi?

Does anybody knows how to use diferent icons sizes on delphi,
I ask because the windows choose the best icon size when showing on explorer,
But how do I put many icons in different sizes on resource.
Thanks again
Here's how I do it:
Prepare an icon file with an icon editing program. This file is a .ico file and contains multiple versions of the same icon with different sizes and pixel formats.
Reference that icon file in a .rc file that is used as source to the resource compiler.
As part of the compilation, the .rc file is processed, resulting in a .res file.
Link the .res file to the executable with a $R directive.
At runtime load the appropriate version of the icon with one of the Windows API functions that loads images from resources.
I use these steps for all the icons that I use on toolbars and menus. That allows me to have a GUI that scales with the user's font scaling settings. The way that the Delphi IDE leads you to do it is to make a TImageList and fill it up with icons that are stored in the .dfm file. That's pretty hopeless because it doesn't readily allow you to have different sized icons. And it also means that your visual assets are stored in a .dfm file in a great big glob representing all icons. If you want to swap out a single icon, then you can do so but it's rather opaque. The history trail left in your VCS is meaningless beyond any comments you leave.
If you are just talking about the main program icon, then you can add your .ico file to the project in the Project | Options | Application dialog and the IDE will take care of the rest of the details.

FireMonkey property editor at runtime

In an HD form in FireMonkey, can I invoke the Brush property editor at runtime?
e.g. when the application is running, upon click of a button, I want to show the TBrush property editor in Modal. When the user selects the brush type, I want to apply it on the form or other components. Can this be achieved?
The brush property editor is TBrushDesigner in unit FMX.Design.Brush. It is a design time editor.
I doubt it is possible to show it at run-time as it has design-time dependencies. But if you have the FMX source code, you can try to work around that.

Resources