FMX.Controls Sample

From RAD Studio Code Examples
Jump to: navigation, search

This is a sample that shows component styling in mobile applications using FireMonkey.

Location

You can find the FireMonkeyMobile Controls sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and navigate to:
    • Object Pascal\Multi-Device Samples\User Interface\Controls
    • CPP\Multi-Device Samples\User Interface\Controls
  • Subversion Repository:
    • You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

This application uses tabbed pages (TTabControls), on which you can see various FireMonkey mobile controls, such as ToolBars, Tool Buttons, ListBoxes, Tabs, Controls, and Editors.

How to Use the Sample

  1. Navigate to the one of the locations given above, and open:
    • Delphi: MobileControls.dproj
    • C++: MobileControls.cbproj
  2. Press F9 or choose Run > Run.
Note: The Back button will navigate tabs until the leftmost tab is reached, and will exit at the leftmost tab. So when you capture Back events, consider how to control when this 'falling off' occurs.

Classes

TForm1 is the main form of the application and contains all the visual controls that are displayed.

Implementation

For different stylings of the same control, the StyleLookup property is used:

  • On the first tab, the StyleLookup property for one TSpeedButton is set to deletetoolbutton, and therefore the button is rendered red and labeled Delete.
  • The StyleLookup property of the speed button next to the Delete button is set to donetoolbutton and therefore, the button is rendered blue and labeled Done.

Uses

See Also