VCL vs. FNC Styling

My first use of any kind of styling and I'm investigating how best to use styles in an app that has mixed FNC and VCL components. Although I'm using FNC where possible in order to future-proof for cross-platform, there are some VCL components I currently can't avoid.

One puzzle is FNCButton. A VCL style gets applied to it, but not an FNC style. To style an FNCButton I need to use a VCL style. Is this a bug? On the other hand, components that can use FNC styles (e.g. FNCCalendar) don't get styled by VCL styles.

I realise I can load styles per-component at runtime but I'm wondering if there will be changes to make the two types of style co-exist better, or if it's best to completely avoid mixing.

Thanks, Bob

Hi,

TTMSFNCButton is actually a TCustomButton, which listens to VCL styles automatically. The TTMSFNCButton is a separate case because it inherits from a default component. Most other FNC components such as the TTMSFNCCalendar, inherit from a TCustomControl, and have custom drawing. They also listen to VCL styles when setting the AdaptToStyle property to true in the constructor of the form, or after loading any kind of VCL style. Note though, that VCL styles are created for default components, and they don't match with FNC components. When setting AdaptToStyle to true, we try to retrieve the style of a component that matches the look and feel of an FNC component as close as possible. In some styles and some components this might not give a 100% satisfying result, therefore we are trying to improve the quality whenever there is a report of a style that doesn't closely match the style of the FNC component. Additionally, the HTML text that is hosted inside the button also needs to have this property set to true. Styles that are load via the context menu, or the styles manager are not VCL styles, but FNC styles, which are completely different.

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFNCCalendar1.AdaptToStyle := True;
  TMSFNCButton1.HTMLText.AdaptToStyle := True;
end;

when applying this for the "Carbon" VCL style we get the following result:

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.