Does anyone use VCL Styles?  I'm using XE3 but cannot find documentation on using fonts in VCL Styles.  I can change font properties in the Style Designer but they never take effect when applying the style.  Any ideas or good resources I can read regarding this?

Comments

  1. I don't use styles.  Personally, I don't like apps that doesn't follow the Windows style settings.

    ReplyDelete
  2. You have StyleElements property in every control that defines which parts will be drawn using styles and which not. If you disable seFont setting you can change font attributes.

    http://docwiki.embarcadero.com/RADStudio/XE7/en/Tutorial:_Using_TControl.StyleElements_in_VCL_Applications

    ReplyDelete
  3. Dalija Prasnikar Thanks. The style elements are enabled by default and I left them enabled. Even when designing from the Style Designer and testing there, font changes have no effect.

    ReplyDelete
  4. Mark Eason I think I got you completely wrong. I managed to read only half of what you wrote :(

    You are trying to create style with custom fonts. If so that does not work AFAIK.

    ReplyDelete
  5. Dalija Prasnikar I thought as much but it seems strange that they put the Font properties in the designer if fonts are not supported.  Pity.

    ReplyDelete
  6. Has anyone done a review of VCL Styles functionality? Pros, cons, and other observations?

    ReplyDelete
  7. Bill Meyer I found this quite a useful resource but not a review as such, just some useful code and info: https://theroadtodelphi.wordpress.com/vcl-style-utils/

    ReplyDelete
  8. Bill Meyer Do not use unless you really have to. 

    VCL Styles are not high DPI aware, not all controls are properly styled, have some drawing issues in certain situations, do not play well with multiple monitors. 

    I recently pulled half of my hair trying to get along with them.

    ReplyDelete
  9. Bill Meyer Just go to QC and look at VCL Styles bugs.
    If you want to use them the best would be to create sample project with all controls you would like to use and see if they work in acceptable way. 
    Of course, you have to forget about making your app DPI aware if you use styles.

    ReplyDelete
  10. Dalija Prasnikar Wow! Nice collection of issues. Is it just me, or does it seem VCL is getting too little attention these days?

    ReplyDelete
  11. Dalija Prasnikar Seems pretty basic, to have been overlooked, and still present.

    ReplyDelete
  12. Bill Meyer Actually, issue while pretty obvious and basic, has its roots in the way VCL streaming reads controls and calculates their Width/Height and ClientWidth/ClientHeight values.

    Width/Height depends on border Width/Height sizes, and those are different for different styles. And while setting ClientWidth/ClientHeight or Width/Height works mostly well during run-time because border size is known at the time (didn't check how it behaves when you change styles in run-time), during streaming Width/Height and ClientWidth/ClientHeight get set before style is applied, and when style is applied instead of honoring ClientWidth/ClientHeight values, VCL preserves Width/Height values causing the issue at hand.

    I haven't looked at the issue recently (it is there since VCL Styles were introduced), so I may be wrong in some details of how it actually works and what is calculated at which moment.

    This can be solved, but I failed to draw more attention to it. While it is not dismissed "As designed" I think it has very low priority. 

    This is just another example of "let's add new feature" without really thinking about all the design angles and feature functionality.

    ReplyDelete

Post a Comment