VCL.ActivityIndicator Sample

From RAD Studio Code Examples
Jump to: navigation, search

This is a sample that shows the use of the TActivityIndicator control.

Location

You can find the ActivityIndicator sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to either:
    • Object Pascal\VCL\ActivityIndicator
    • CPP\VCL\ActivityIndicator
  • 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 demonstrates the TActivityIndicator control and shows how to modify its various properties.

The application uses the following controls:

  • AI: The activity indicator.
  • grpIndicatorSize: Sets the size of the activity indicator.
  • grpIndicatorColor: Sets the color of the activity indicator.
  • grpIndicatorType: Sets the type of the activity indicator.
  • trkFrameDelay: Sets the frame delay of the activity indicator.
  • chkAnimate: Toggles the Animate property of the activity indicator.
  • cbxFormColor: Sets the Color of the form if the current style is Windows.
  • cbxVclStyles: A combo box that allows you to change the style of the application. You can choose between any style that is active in the Application Appearance - Custom Styles options for this project.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: ActivityIndicator.dproj.
    • C++: ActivityIndicator.cbproj.
  2. Press F9 or choose Run > Run.
  3. Change the different options on the form and test the functionlity of the activity indicator. Modify color, size, animation speed and the type of the activity indicator.

Implementation

TActivityIndicatorForm

On initialization, the FormCreate adds all the active styles to the cbxVclStyles combo box.

The application defines the following event handlers:

  • grpIndicatorTypeClick: Changes the type of the activity indicator.
  • grpIndicatorSizeClick: Changes the size of the activity indicator.
  • grpIndicatorColorClick: Changes the color of the activity indicator.
  • cbxFormColorChange: Changes the size of the activity indicator.
  • trkFrameDelayChange: Changes the frame delay of the activity indicator.
  • cbxVclStylesChange: Sets the style for the application.
  • chkAnimateClick: Enables or disables the animation of the activity indicator.

Uses

See Also