Back to Devexpress

TcxCustomTrackBarProperties Class

vcl-cxtrackbar-9095003b.md

latest12.0 KB
Original Source

TcxCustomTrackBarProperties Class

The base class for track bar editor settings.

Declaration

delphi
TcxCustomTrackBarProperties = class(
    TcxCustomEditProperties
)

Remarks

A simple track bar editor (TcxTrackBar/TcxDBTrackBar) uses a thumb to specify a numeric value.

You can arrange a track bar editor horizontally or vertically, flip the scale direction, and customize the appearance of scale, thumb, tick marks, and other track bar elements.

End-User Options

Track bar editors (TcxCustomTrackBar descendants) support multiple mouse/touch and keyboard-based user interaction options.

Track Click & Thumb Drag Operations

Users can drag the thumb to modify the edit value.

In addition, a click on the track bar before or after the thumb changes its position in increments specified by the PageSize property value. If the ThumbStep property is set to cxtsJump, a click on the track bar moves the thumb directly to the target position.

Supported Keystrokes

If the track bar editor has focus, the following keys increment or decrement the edit value (depending on the ReverseDirection property value):

Page Up | Page DownIncrement/decrement the edit value by PageSize.→ | ↑ | ↓ | ← | + | -Increment/decrement the edit value by LineSize. These keys correspond to change buttons.

Mouse Wheel Support

Users can rotate the mouse wheel to increment/decrement[1] the editor value when the following conditions are met:

  • The track bar editor has focus
  • The mouse pointer is within the editor client area
  • The UseMouseWheel property is set to True ( default )

Note

TdxRangeTrackBar and TdxDBRangeTrackBar editors do not support the mouse wheel because it is impossible to associate individual track thumbs with input focus.

Main API Members

The list below outlines key members of the TcxCustomTrackBarProperties class. These members allow you to configure track bar editors.

Appearance Options

AlignmentAllows you to position track bar UI elements horizontally or vertically within the editor client area (depending on the Orientation property value).AutoSizeSpecifies if track bar UI element dimensions are calculated automatically.OrientationAllows you to switch between horizontal and vertical track bar layouts.ShowChangeButtons | ShowTicks | ShowTrackSpecify if change buttons, tick marks, and the underlying track bar are visible.TextOrientationAllows you to switch between horizontal and vertical tick label orientation options.ThumbColor | ThumbHeight | ThumbHighlightColor | ThumbType | ThumbWidthAllow you to customize thumb appearance.TickColor | TickMarks | TickTypeAllow you to configure scale/tick mark appearance.TrackColor | TrackSizeSpecify track bar color and width.

User Interaction Options

Automation

Provides access to UI Automation and accessibility-related settings.

Tip

Use Automation.Name, Automation.Description, and other API members to specify information visible to third-party assistive tools as UIA node properties.

ReadOnlyEnables or disables read-only mode. You can use the editor’s Style.ReadOnly and StyleReadOnly properties to customize editor appearance options for the read-only state.ReverseMouseWheel

Specifies if the direction of the mouse wheel rotation is flipped for the track bar editor.

This property is in effect only if the UseMouseWheel property is set to True ( default ).

ShowPositionHintSpecifies if the track bar editor displays a hint that indicates the current thumb position.ThumbStepAllows you to switch between normal and jump thumb positioning modes (applicable when a user clicks the track bar).UseMouseWheelSpecifies if the mouse wheel moves the thumb when the track bar editor has focus and the mouse pointer is within the editor client area.

Track Bar Scale Settings

FrequencySpecifies the number of track bar scale units between every two tick marks.LineSize | PageSizeSpecify standard ( →, ↑, ↓, ←, +, and - ) and large ( Page Up and Page Down ) thumb position steps.Min | MaxSpecifies minimum and maximum values on the track bar scale.ReverseDirectionAllows you to flip the scale direction. If the scale direction is reversed, corresponding keystrokes ( →, ←, ↓, ↑, etc.) move the thumb in the opposite direction.

Selection Bar Settings

Users can hold the Shift key while moving the thumb to select a range within the track bar.

You can read selected range positions to use corresponding values in your application or select a track bar range in code.

SelectionColorAllows you to modify the selection bar color.SelectionStart | SelectionEndSpecify start and end positions of the selection bar on the track bar scale.

Custom Draw Events

OnDrawThumb | OnGetThumbRectAllow you to override built-in thumb draw routines if the ThumbType property is set to cxttCustom.OnGetTickLabelAllows you to customize the appearance of individual track bar tick marks.

General-Purpose API Members

AssignedValues | RestoreDefaultsAllow you to track the state of individual editor-specific settings and reset them.BeginUpdate | EndUpdate | LockUpdate | DoUpdate | Update | Changed | ChangedLocked | DataChangedAllow you to manage editor updates and avoid excessive redraw operations during batch editor setting changes.

Terminal TcxCustomTrackBarProperties Class Descendant

Do not use the TcxCustomTrackBarProperties class directly. Use the following descendants instead:

TcxTrackBarPropertiesStores track bar editor settings.TdxRangeTrackBarPropertiesContains range track bar settings.TdxZoomTrackBarPropertiesStores zoom track bar editor settings.

Repository Item Class

You can create a TcxEditRepositoryTrackBar component in an edit repository to define an unbound track bar editor (TcxTrackBar), store track bar settings, and share them between multiple track bar editors.

To see the TcxTrackBar editor in action, run the Data Editors and Controls demo in the VCL Demo Center installed with compiled DevExpress VCL demos. Click Track Bar in the sidebar on the left to activate the corresponding demo.

Download: Compiled VCL Demos

Tip

You can find full source code for the installed compiled editor demo in the following folder:

_%PUBLIC%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressEditors_

Inheritance

TObject TPersistent TInterfacedPersistent TcxInterfacedPersistent TcxCustomEditProperties TcxCustomTrackBarProperties

Footnotes

  1. To flip the direction of mouse wheel rotation, you can set the ReverseMouseWheel property to True.

See Also

TcxCustomTrackBar.ActiveProperties Property

TcxCustomTrackBar.Properties Property

TcxCustomTrackBarProperties Members

cxTrackBar Unit