Back to Devexpress

TdxDBToggleSwitch Class

vcl-dxdbtoggleswitch.md

latest5.9 KB
Original Source

TdxDBToggleSwitch Class

A data-aware toggle switch editor.

Declaration

delphi
TdxDBToggleSwitch = class(
    TdxCustomToggleSwitch
)

Remarks

A toggle switch is a touch-friendly equivalent of a check box. Three available thumb positions in a toggle switch editor correspond to checked, unchecked, and intermediate states of a check box editor.

Users can drag the thumb, click the editor, or press the Space character when the editor has focus to switch between available check states.

Main API Members

The list below outlines key members of the TdxToggleSwitch class. These members allow you to configure toggle switch editors.

Appearance Settings

Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly

Allow you to define individual appearance settings for different editor states.

Tip

To apply the same style settings to multiple editors, use a TcxEditStyleController component. If you need to apply the same style settings to all editors in your application, you can use a TcxDefaultEditStyleController component.

StylesProvides access to individual styles applied to the editor in different states.TransparentSpecifies if the editor is transparent in GDI render mode.

Editor State-Related APIs

Checked | State

Specify the toggle switch editor’s state.

Note

The intermediate editor state is available only if the Properties.AllowGrayed property is set to True.

DataBindingAllows you to bind the toggle switch editor to data.EditValueSpecifies the edit value.OnEditingAllows you to prevent users from activating the editor.

Editor Settings and Repository Items

ActivePropertiesProvides access to the current editor settings regardless of their source. This property set does not allow you to customize editor settings.GetPropertiesClassReturns the actual editor settings type.PropertiesAllows you to customize editor settings directly if the editor does not have an assigned repository item.RepositoryItemSpecifies a repository item as an external source of editor settings. A repository item has priority over other editor settings.

General-Purpose API Members

EnabledSpecifies if the editor is enabled.CanModifyIdentifies if the editor is in read-only mode.IsEditValidating | IsHiding | IsPostingAllow you to identify the current operation in the editor.ShowHintSpecifies if the editor can display hints.Width | HeightAllow you to explicitly define editor dimensions.

Repository Item Class

You can create a TcxEditRepositoryToggleSwitchItem component in an edit repository to define an unbound toggle switch editor, store editor settings, and share them between multiple toggle switch editors.

Limitations

You cannot use a data-aware toggle switch editor as an in-place editor in container controls. You can embed only the TdxToggleSwitch component as an in-place editor.

Inheritance

Show 14 items

TObject TPersistent TComponent TControl TWinControl TCustomControl TcxCustomControl TcxControl TcxContainer TcxCustomEditContainer TcxCustomEdit TcxCustomCheckBox TdxCustomToggleSwitch TdxDBToggleSwitch

See Also

TdxToggleSwitch Class

TdxDBToggleSwitch Members

dxDBToggleSwitch Unit