FMX.ControlsDemo Sample
This sample exemplifies how to use FireMonkey controls.
Contents |
Location
You can find the ControlsDemo sample project at:
- Start > Programs > Embarcadero RAD Studio XE2 > Samples and then navigate to FireMonkey\ControlsDemo
- Subversion Repository for Delphi: http://radstudiodemos.svn.sourceforge.net/viewvc/radstudiodemos/branches/RadStudio_XE2/FireMonkey/ControlsDemo/
Description
This application uses several controls, sorted by categories in a TabControl.
How to Use the Sample
- Navigate to Start > Programs > Embarcadero RAD Studio XE2 > Samples and open ControlsDemo.dproj.
- Press F9 or choose Run > Run.
Classes
FireMonkey 2D Animation represents the main window of the sample. It contains the following components:
- A TMenuBar with two TMenuItems, each of them containing several other TMenuItems
- A TOpenDialog
- A TLayout containing another TLayout, with a TTabControl with several TTabItems
- The first TTabItem, called Standard, contains the following controls:
- TAniIndicator
- TButton
- TCalloutPanel with four TRadioButtons and a TLabel
- Two TCheckBoxes
- Four TLabels
- A TPanel with a TLabel and two TButtons
- TProgressBar
- Two TRadioButtons
- Two TScrollBars
- TSmallScrollBar
- TComboBox with several TListBoxItems
- TListBox with several TListBoxItems
- TEdit
- TTrack
- The second TTabItem, called Additional, contains the following controls:
- Three TArcDials
- A TButton with a TLabel and a TImage
- TCalendar
- TCalendarBox
- TCalendarEdit
- TExpander with a TButton and a TLabel
- TGroupBox with a TButton and a TLabel
- Six TLabels
- TMemo
- TNumberBox with a TGlowEffect
- TPopupBox
- TEdit
- TTrackBar
- The third TTabItem, called ExtControls, contains the following controls:
- The fourth TTabItem, called Transformations, contains the following controls:
- TEllipse
- Two TLabels
- TListBox
- TEdit
- Two TTrackBars
- The fifth TTabItem, called TreeView and ListBox, contains the following controls:
- TCheckBox
- Two TLabels
- TListBox with several TListBoxItems, each of them containing one or more of the following components: TLabel, TButton, TEdit, TImage, TPath, TRectangle. The TRectangle also has two children: TEllipse and TLabel.
- The sixth TTabItem, called ScrollBox, contains the following controls:
- A TPanel with a TScrollBox
- A TRectangle with a TLabel and a TVertScrollBox; the TVertScrollBox contains three TExpanders, each of them having a TButton, a TEdit, and a TTrackBar as children.
- TSplitter
- The seventh TTabItem, called Memo, contains a TMemo.
- The eighth TTabItem, called New!, contains the following controls:
- TAlphaTrackBar
- TBWTrackBar
- THueTrackBar
- Four TCheckBoxes
- TButton
- TComboColorBox
- TComboTrackBar
- Six TCornerButtons, two of them containing TPaths as children.
- Three TLabels
- TListBox with several TListBoxItems
- TSpinBox
- TClearingEdit
- TTrackBar
- TTreeView with several TTreeViewItems
- A TStatusBar, containing the following controls:
Implementation
This sample uses all the FireMonkey controls and shows their functionality. The sample has a main menu, with two menu items. The first menu item (File) has two options: Load Style... (allows the user to load a different style) and Exit (closes the program). The second menu item (Help) can be used for accessing the About box, which can contain information about the project.
The form contains a layout with a tab control. The first tab item is called Standard and shows the standard controls, like labels, buttons, radio buttons, check box, and edit box. The progress bar has its BindingSource property set to ScrollBar1, so changing the value of the scroll bar automatically changes the value of the progress bar. When selecting the MultiSelect check box, the list box above allows the selection of multiple items. The callout panel changes the callout position according to the radio button selection.
The second tab item (Additional) contains controls like calendar edits, group box, expander, calendar, memo, number box, track bar, angle button. Clicking one of the angle buttons changes the value of the label to the value of the selected angle button.
The third tab item is named Ext Controls and it contains a drop target and a clearing edit.
The Transformations tab shows two track bars that can set the rotation angle and opacity of the edit box and list box. TreeView and ListBox is the fifth tab and it contains a list box with list box items with different content (labels, images, paths, buttons). The tree view has several tree view items, displayed on three levels. The check box labeled as UseSmallScrollBars can change the value of the property with the same name of the tree view and list box.
The ScrollBox tab contains a scroll box and a vertical scroll box with several expander objects.
The seventh tab, Memo, contains a memo.
The last tab item is named New! and it contains new FireMonkey-specific controls. The check boxes around the first button can be used for changing the style of the button's corners. The track bar's value sets the X and Y radius for the corners.
On the form's bottom there is a status bar containing a track bar for scaling the main layout and a button for changing the application to 3D and back.
Uses
- FMX.Colors.TAlphaTrackBar
- FMX.Colors.TBWTrackBar
- FMX.Colors.THueTrackBar
- FMX.Colors.TComboColorBox
- FMX.Controls.TAniIndicator
- FMX.Controls.TButton
- FMX.Controls.TCalloutPanel
- FMX.Controls.TRadioButton
- FMX.Controls.TLabel
- FMX.Controls.TPanel
- FMX.Controls.TProgressBar
- FMX.Controls.TScrollBars
- FMX.Controls.TSmallScrollBar
- FMX.Controls.TTrack
- FMX.Controls.TArcDials
- FMX.Controls.TExpander
- FMX.Controls.TGroupBox
- FMX.Controls.TCheckBox
- FMX.Controls.TSplitter
- FMX.Controls.TTrackBar
- FMX.Controls.TStatusBar
- FMX.Dialogs.TOpenDialog
- FMX.Edit.TEdit
- FMX.Edit.TNumberBox
- FMX.Edit.TComboTrackBar
- FMX.Edit.TSpinBox
- FMX.Edit.TClearingEdit
- FMX.Effects.TGlowEffect
- FMX.ExtCtrls.TCornerButtons
- FMX.ExtCtrls.TCalendar
- FMX.ExtCtrls.TCalendarBox
- FMX.ExtCtrls.TCalendarEdit
- FMX.ExtCtrls.TDropTarget
- FMX.Layouts.TScrollBox
- FMX.Layouts.TVertScrollBox
- FMX.Layouts.TLayout
- FMX.ListBox.TComboBox
- FMX.ListBox.TListBoxItem
- FMX.ListBox.TListBox
- FMX.Memo.TMemo
- FMX.Menus.TMenuBar
- FMX.Menus.TPopupBox
- FMX.Menus.TMenuItem
- FMX.Objects.TImage
- FMX.Objects.TPath
- FMX.Objects.TRectangle
- FMX.Objects.TEllipse
- FMX.TabControl.TTabControl
- FMX.TabControl.TTabItem
- FMX.TreeView.TTreeView
- FMX.TreeView.TTreeViewItems