TdxVisualRefinements Class
Stores global visual adjustments for DevExpress container controls and editors.
Declaration
TdxVisualRefinements = class(
TObject
)
Remarks
Clean, simple, and minimalistic UI design is a common trend in modern software development. Global visual refinement settings allow you to address this trend and make the application UI more plain, simple, and readable.
Light Style replaces thick and double borders with lightweight one-pixel borders and adds extra padding to all cells and column headers in VCL Data Grid.
Main API Members
The list below outlines key members of the TdxVisualRefinements
class that allow you to manage extra paddings and Light Style settings.
Global Extra Padding Settings
- HeaderPadding | Padding
- Allow you to adjust extra cell and header paddings in container controls to improve UI readability.
- UsePaddingForStandaloneEditors
Specifies if extra cell paddings affect standalone DevExpress editors.
The ApplyLightStyle procedure can accept a new UsePaddingForStandaloneEditors property value as an optional parameter.
Light Style-Related API Members
- ApplyLightStyle
- Applies Light Style effects to all DevExpress controls that support them.
- LightBorders
- Specifies if all supported DevExpress controls display lightweight borders.
General-Purpose API Members
- BeginUpdate | EndUpdate
- Allow you to avoid excessive redraw operations during batch visual refinement changes.
- Reset
Resets all global visual refinement settings.
Tip
You can call the Reset procedure to disable all Light Style effects.
Code Example: Padding Size Adjustments
You can adjust the default padding dimensions for all container controls in the initialization section of the main application unit.
The following code example adds 5
pixels to left and right paddings, and 2
pixels to top and bottom paddings in container controls and standalone editors:
uses
Forms,
cxLookAndFeels, // Adds the cxLookAndFeels unit to use the TdxVisualRefinements class
// ...
begin
TdxVisualRefinements.BeginUpdate; // Initiates the following batch change
try
TdxVisualRefinements.Padding := Rect(5, 2, 5, 2);
TdxVisualRefinements.UsePaddingForStandaloneEditors := True;
finally
TdxVisualRefinements.EndUpdate; // Calls EndUpdate regardless of the batch operation's success
end;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TMyForm, MyForm);
Application.Run;
end.
Supported Controls and Limitations
Only VCL Data Grid supports all components of Light Style including lightweight borders.
Cell and Header Padding Adjustments
Cell and header padding adjustments affect the following controls:
- TcxGrid
- A Data Grid control.
- TcxVerticalGrid
- The vertical grid control that implements single record and banded layouts.
- TcxRTTIInspector
- A runtime Object Inspector control.
- TcxTreeList
- A control that displays data in a tree-like manner.
- TcxDBTreeList
- A data-aware version of the TreeList control.
- TcxVirtualTreeList
- A TreeList control used in provider mode.
- TcxPivotGrid
- Implements the pivot grid that was designed for use in unbound and OLAP modes.
- TcxDBPivotGrid
- A data-aware pivot grid control.
Note
Padding adjustments also affect standalone editors if the UsePaddingForStandaloneEditors property is set to True
.