Using Gesturing in Your Applications
Go Up to How To Create an Application that Uses Gesturing Components
Contents
To Add Gesturing Features to Your Application
- In the Form Designer, add the component or components that will use the gesturing features.
- Large components like panels and panel groups work well with gesturing.
- For desktop platforms add a GestureManager to your project, optionally give it a specific name, and assign the gesture manager:
- Note: Mobile platforms are gesture-enabled by default.
- On the Tool Palette, find and double-click the GestureManager, located in the Gestures category:
- (either Vcl.Touch.GestureMgr.TGestureManager or FMX.Types.TCustomTouchManager.GestureManager).
- This adds a GestureManager to your project, and gives it a default name such as GestureManager1.
- If you want to change the default name of the GestureManager, enter a name in the Name field for the GestureManager in the Object Inspector. The default name is typically GestureManager<n>.
- Assign a GestureManager for each component that you want to work with gestures:
- Select the GestureManager (either in the Form Designer or in the component dropdown in the Object Inspector).
- In the entry field for the GestureManager property in the Object Inspector (located under the Touch node), click the down-arrow
. This displays a list of available gesture managers in the GestureManager field.
- Select a gesture manager from the list of available gesture managers:
- Select the GestureManager (either in the Form Designer or in the component dropdown in the Object Inspector).
- With the containing component selected in the Form Designer, open the Touch node on the Object Inspector. Verify that the GestureManager field displays the name you assigned to the GestureManager for this component.
- For both desktop and mobile platforms:
- In the control's Touch | Gestures field in the Object Inspector, select the specific gesture(s) you want to enable.
- Implement an OnGesture event handler (procedure) for each gesture that you are enabling for the control, and handle the appropriate EventInfo.GestureId.
- For an event handler example, see Implementing the OnGesture Event Handler in Gestures in FireMonkey.
See Also
- Gesturing Overview
- Creating Custom Gestures
- TStandardGesture Enum
- Handling VCL Actions Using an Action List
- Gestures in FireMonkey
Platform-Specific Information
- Windows touch gestures
- Multi-Touch Gestures for OS X
- iOS Human Interface Guidelines: Platform Characteristics
- Gestures on Android