FMX.MetropolisUIFlipViewDemo Sample

From RAD Studio XE3 Code Examples
Jump to: navigation, search

Language:

Versions:

A FlipView is a scrollable Windows 8 control that lets you flip through a collection of items, one at a time. This sample illustrates how to create and use flipviews using FireMonkey.

Contents

Location

You can find the FireMonkey FlipView sample project at:

  • Start | Programs | Embarcadero RAD Studio XE3 | Samples | FireMonkey | MetropolisUIFlipViewDemo.

Or you can go to C:\Users\Public\Documents\RAD Studio\n.n\Samples\FireMonkey.

Description

This application uses TLayout, TImage and a transition effect of your choice to flip between images.

How to Use the Sample

  1. Navigate to the location of the MetropolisUIFlipViewDemo sample and open FlipViewDemo.dproj.
  2. Press F9 or choose Run > Run.

To transition through the images loaded in the sample, click the Next button on the right side of the picture or the Previous button on the left side.

To apply transition effects to the images, enable the Transition Effect check box, and then select one of the transitions listed in the TComboBox. For example, you can select TCrumpleTransitionEffect, TBlindTransitionEffect, or TPixelateTransitionEffect.

You can also check the Slide Show check box, which activates a timer in order to go through the images at a regular interval.

For more information, see the comments in the code (MainFrm.pas).

Classes

MainFrm represents the main window unit of the sample. It contains the FormMain class, which defines the main form and contains:

Implementation

  • When running the application, the main window of the sample is displayed.
  • The images are designed using TLayout and TImage.
  • This sample application:
    • Attaches the two images to the main layout of the form, in order to flip them to any side.
    • Implements the proper actions to flip the content: 'ActionNext' and 'ActionPrevious'.
    • Adds OnClick events to the buttons that trigger the transitions between images.

Uses

See Also

Personal tools