5
votes

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.

1
Here's a blog post showing how to change the resource for the default style within the IDE: infotipc.blog.com/2012/06/12/…Mike Sutton
@KenWhite That is painfully inaccurate. This is precisely what FMX.Types.TStyleBook was made for.b1nary.atr0phy
@b1naryatr0phy: You did notice that the comment was made more than a year ago, very shortly after XE2 and FM were first released?Ken White
@KenWhite Are you trying to imply that FMX.Types.TStyleBook didn't exist at that time? Because if so, you're wrong again. And in fact, it looks to me like a proper answer was provided the very next day. So I fail to say how the timing of your comment excuses its inaccuracy.b1nary.atr0phy
@b1naryatr0phy: First, my intent was to tell you I didn't know at the time the comment was made it was wrong. Second, if you had enough rep you'd see that I wrote a long answer that was correct, and then deleted it because Robert's turned out to be better. Third, what does it matter to you that I made what turned out to be an erroneous comment 13 months ago, unless you're just looking to make noise, and we don't do that here. But fine; if it matters that much to you that you'll lose sleep over it, I'll delete it. I'd suggest you spend your time trying to do more constructive things, though.Ken White

1 Answers

14
votes

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.