Skip to main content

Integrated Touch Gesture Support

  • 3 minutes to read

Most of DevExpress controls provide built-in support for Windows Touch gestures – no additional coding or links to a standard VCL gesture manager are required. Touch support is available in all supported IDEs, including Delphi 2007 and C++Builder 2007. Refer to the “Windows Touch Gestures Overview (Windows)” MSDN article at https://docs.microsoft.com/windows/desktop/wintouch/windows-touch-gestures-overview for general information on Windows Touch gestures.

The following touch capabilities are available to your end-users out of the box:

Touch Mode

Touch mode is designed to enhance the touch experience for our VCL controls and makes it easy to enable the enhancements in your application. The enhancements include touch-friendly sizes of UI elements and their touchable areas, adjusted text alignment settings, and other control-specific improvements. You can toggle the Touch mode using the TouchMode property in a look and feel controller or skin controller.

The screenshot below illustrates Touch mode adjustments in a Ribbon UI.

Touch-Friendly Scrollbar Mode

This mode, enabled by default, enhances the content control scrolling experience both in the default and Touch UI interaction modes. In this mode, the scrollbar buttons are never displayed, and the horizontal or vertical scrollbar thumb appears when an end-user hovers the mouse pointer over a control or scrolls through its content. The mouse pointer disappears if it remains stationary or the control’s content is not scrolled for some time:

All DevExpress controls, except for TcxTreeView, TcxListView, and their descendants, support the Touch-friendly scrollbar mode. To disable it for all DevExpress controls in your project, switch the skin or look & feel controller’s ScrollbarMode property to sbmClassic. If you prefer to use classic scrollbars in all new projects by default, set the cxDefaultIsTouchScrollUIModeEnabled global constant to False in the cxLookAndFeels unit and recompile the installed DevExpress VCL products by using the corresponding option in the installer.

Additionally, you can disable or enable the Touch-friendly scrolling for an individual control by setting its LookAndFeel.ScrollbarMode property to sbmClassic or sbmTouch, respectively. The global scrollbar mode setting imported via the MasterLookAndFeel.ScrollbarMode property affects a control only if its LookAndFell.ScrollbarMode property is set to sbmDefault.

Note

Size adjustment calculations in Touch mode are based on the minimum square size of a touchable element defined by the cxTouchElementMinSize global constant. You can customize the default value of the constant to meet the requirements of your users. Standalone ExpressEditors located in a layout control are automatically resized in Touch mode, provided that their AutoSize property is set to True.