How to change the default FireMonkey style in Delphi XE2 - delphi

I saw a youtube video (can't remember which one) where the user changed an option in Delphi XE2 to change the default style for an entire FireMonkey application. After much hunting I can't find the option.
IDE Insight for 'style' shows me 'Default Style - Custom Styles (Forms)' under 'Project Options'. But unless I'm being particularly thick, there's no such option there.

VCL Styles and Firemonkey Styles are fundamentally different.
Because of that I am not sure they should have used the same name.
VCL Styles
Edited through: Tools|Style Designer (External App)
Style Extension .VSF
Format is Binary
Can be set through: Project Options|Application| Appearance (Which just add TStyleManager.SetStyle('StyleName'); to your code
Runtime control of styles can occur through the TStyleManager class
Firemonkey Styles
Editor is Internal to the IDE
Accessed through TStyleBook Resource Property Editor
Can also be accessed by Right click on any visual control and selecting either
Edit Custom Style...
Edit Default Style...
Note: These two menu choices are only available in desktop apps, not mobile apps.
Once in editor you can select the Load.. button to change the style for the selected TStylebook. If the entire application is using the same TStyleBook it will change the whole application.
Style Extension .style
Format is like a DFM
Runtime control of styles can occur on each control and through the TStyleBook
On windows 7 all of the styles both VCL and Firemonkey by default are placed in the
C:\Users\Public\Documents\RAD Studio\9.0\Styles directory
One bullet point is a direct answer, but I felt like I had to give the long answer to help others.

Related

Delphi 11 theme export

I have recently installed RAD Studio 11 on a new VM. I have a huge active project in Delphi 10.2 in a different VM, that among other things uses themes. Migrating the D10.2 project to D11 is not an option right now. But I'd like to export the Windows 11 themes from the D11 IDE to use in the D10.2 project if that's possible. So far I haven't found a way to do the export. Am I missing something in the IDE, or is a 3rd-party tool available to do this? Or are the theme definitions in files stuck off in a folder somewhere that I'm not finding? Thanks.
OK, the downloaded .zip files containing the styles for D11 are stored in C:\Users\<user>\Documents\Embarcadero\Studio\22.0\CatalogRepository\<style name>, and the .vsf files from them are copied to the C:\Users\<user>\Documents\Embarcadero\Studio\19.0\Styles folder for D10.2. Restart the IDE and they show up in the list of available styles.
However, as David and Uwe noted, they don't work 100% as-is. They almost do - everything appears to work fine except forms with borderstyles that include a non-client title bar. On those forms, there's a large "X" in the middle of the title bar and a off-color square box on the left of that title bar underneath the form's icon (or underneath the title text for toolwindows without an icon.) Also, a few 3rd-party controls aren't quite right (TMS TAdvSpinEdits paint their up/down arrows wrong, etc.) These may be fixable with one of the style editors out there, or at least give a basis from which to create a new style .vsf that's D10.2 compatible. Or I can spend the money to get the D10.2 W11 styles pre-done from one of the styles vendors.

Can I enable texthint if styleservices is not enabled?

I'm injecting a number of forms into an existing application using a dll.
I don't control the existing application, nor do I have source code for it.
(I doubt the source code exists any more).
I want to show a TextHint in a TEdit.
In the form designer this works, but in the application it doesn't.
I traced it to the fact that StyleServices (This used to be called ThemeServices (now deprecated)) is not enabled, disabling the TextHint.
Obviously I cannot enable styles for the application, all I have is a dll.
Is there a way to show the texthint?
I prefer to use a stock TEdit.
The dll is written in DX and the old application is written in D7.
BTW I don't care a hood about any additional styling/theming or the like. I just want the texthint to display.
Is there a way to show the texthint?
Standard TextHint functionality in a stock TEdit is dependent on the EM_SETCUEBANNER message, which only works when Visual Styles are enabled:
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
If Visual Styles are not enabled in the app you are injecting your code into, then the only way to do what you are asking for is to subclass the TEdit window and custom-draw it manually when its text is empty.

Where should I store IDE component editor user preferences?

I'm writing a component editor for the Delphi 10 Seattle IDE which has some form layout customization, such as re-sizing the form, positioning it, splitters to re-side panels, etc. I would like to save these settings so that each time the user opens this editor, it opens in the same layout they last left it.
I'm assuming the location to save such settings should reside somewhere within the HKCU section of the registry, along-side the specific Delphi IDE version settings.
Where in the registry should I save such settings?
After digging further into the registry, I'm pretty sure I found it.
HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\17.0\Property Editors\
It appears that other property and component editors keep their properties here, for example the TActionList. There are traces of editors storing their dimensions in this node.

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!
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.

There is no "Edit Custom Style" on context menu of a control in Delphi XE4

I am using delphi xe4 for developing ios apps, for styling controls I have read that there should be a "Edit Custom Style" when you right-click on a control, but there is no such option for me.
I found the answer,
There is no "Edit Custom Style" on FireMonkey Mobile form, but instead you can do it as below,
1.Drop a StyleBook on the form and assign it to the form
2.Double click on StyleBook, the editor will open
3.Load one of default styles
4.Without closing the editor, open the Structure view, all of the styles are here
5.Select style you want to change, and change it via Property window
6.You can save the new style for future use
This is a relic of XE2...I think that's how it was done back then (the help file in XE4 still says so, but it also says its category is "FMX|XE2"). Nowadays you have to go via the StyleBook property of the form. See here for details: http://docwiki.embarcadero.com/RADStudio/XE4/en/Customizing_the_Design_of_a_FireMonkey_Application#Step_2:_Apply_an_existing_style_to_your_application_at_design_time

Resources