Skip to content

Regenerate FMX StyleBook files and update styles for Delphi 13 FMX theme engine #12

@jimmckeeth

Description

@jimmckeeth

Overview

Labs 09 and 10 teach FMX styling using StyleBook files (.style) and the Material Design theme. StyleBook files created with Delphi 10.3 Rio may contain outdated style definitions, missing style elements added in later Delphi versions, or references to control styles that have been renamed or restructured in Delphi 13's updated FMX engine.

Background

FMX Style Changes Since Delphi 10.3

  • Delphi 10.4 Sydney: Updated Material and Cupertino platform themes; new default style format.
  • Delphi 11 Alexandria: New light/dark mode awareness in FMX styles; TStyleBook gains dark mode support.
  • Delphi 12 Athens: Continued style refinements; some legacy style selectors deprecated.
  • Delphi 13: Full FMX Theme Manager with system-level dark/light mode integration.

Old .style files opened in Delphi 13 may:

  • Show warnings about unrecognized style elements.
  • Fail to apply correctly to new control types added since 10.3.
  • Miss the dark mode variant styles, causing odd appearance on iOS/Android dark mode.

Lab 09 and 10 Scope

  • Lab 09: Applies the built-in Material and Cupertino styles to the app (no StyleBook).
  • Lab 10: Creates a custom StyleBook with a modified button style.

Both labs need verification that the styling APIs still work as documented in the training instructions.

Files Affected

lab-src/Lab09.../  (style application code in formMain.pas)
lab-src/Lab10.../  (StyleBook .style file + formMain.pas)
lab-src/Lab*/forms/formMain.fmx  (TStyleBook component references)

Steps to Address

  1. Open each lab in Delphi 13 and load the StyleBook in the FMX Style Designer.
  2. If the Style Designer reports missing or incompatible elements, use "Export Default Style" for the current platform and re-apply the custom modifications from Lab 10.
  3. Verify that the Material and Cupertino built-in style names used in Lab 09 still exist in Delphi 13 (they may have been renamed; e.g., AndroidMaterial).
  4. Add dark mode style variants to the Lab 10 StyleBook to demonstrate Delphi 13's light/dark mode support — update the lab instructions to cover this new capability.
  5. Verify that TStyleBook.UseStyleManager and TStyleManager.TrySetStyle APIs are still current in Delphi 13.
  6. Update the TStyleManager.SetStyle call pattern in the code if the API has changed.
  7. Save regenerated .style files and commit them.

Test Plan

  • Lab 09 compiles and applies the Material style on Android without any "style not found" runtime warnings.
  • Lab 09 applies the Cupertino style on iOS without any "style not found" runtime warnings.
  • Lab 10 custom StyleBook loads without errors in the Delphi 13 FMX Style Designer.
  • Lab 10 custom button style is visible and correct on Android 13 emulator.
  • Lab 10 custom button style is visible and correct on iOS 17 simulator.
  • On Android 13 in dark mode: the app does not show a plain white/unstyled interface (dark mode is handled gracefully).
  • On iOS 17 in dark mode: same verification.
  • No Delphi compiler warnings about deprecated style APIs in Labs 09 and 10.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions