vcl-cxlookandfeels-ac755cd9.md
Stores global DevExpress control appearance settings that complement skins and palettes.
TdxVisualRefinements = class(
TObject
)
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.
The list below outlines key members of the TdxVisualRefinements class that allow you to manage extra paddings and Light Style settings.
HeaderPadding | PaddingAllow 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.
UseDisabledSkinPaletteForSVG | UseEnabledSkinPaletteForSVGSpecify if the active vector skin palette defines SVG glyph colors in UI elements.
ApplyLightStyleApplies Light Style effects to all DevExpress controls that support them.LightBordersSpecifies if all supported DevExpress controls display lightweight borders.
BeginUpdate | EndUpdateAllow 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.
You can adjust the default padding dimensions for all container controls in the initialization section of the main application unit.
The code example in this section adds 5 pixels to left and right paddings, and 2 pixels to top and bottom paddings in container controls and standalone editors.
Open the Project Source to Edit the Main Function
To open the main application unit of your project, you can use one of the following options:
Select Project → View Source in the main menu of your RAD Studio IDE.
Select the target project in the Projects Window and press Ctrl + V (alternatively, you can display the context menu and select the View Source option).
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.
#include <vcl.h>
#include "cxLookAndFeels.hpp" // Adds the cxLookAndFeels unit to use the TdxVisualRefinements class
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
TdxPadding APadding;
APadding.Left = 5;
APadding.Top = 2;
APadding.Right = 5;
APadding.Bottom = 2;
try
{
TdxVisualRefinements::BeginUpdate(); // Initiates the following batch change
try
{
TdxVisualRefinements::Padding = APadding;
TdxVisualRefinements::UsePaddingForStandaloneEditors = true;
}
__finally
{
TdxVisualRefinements::EndUpdate(); // Calls EndUpdate regardless of the batch operation's success
}
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TMyForm), &MyForm);
Application->Run();
}
// ...
Only VCL Data Grid supports all components of Light Style including lightweight borders.
Note
All visual refinement settings have no effect if the WXI or WXI Compact skin is active.
Cell and header padding adjustments affect only the following controls:
TcxGridA Data Grid control.TcxVerticalGridThe vertical grid control that implements single record and banded layouts.TcxRTTIInspectorA runtime Object Inspector control.TcxTreeListA control that displays data in a tree-like manner.TcxDBTreeListA data-aware Tree List control.TcxVirtualTreeListA TreeList control used in provider mode.TcxPivotGridAn unbound Pivot Grid control.TcxDBPivotGridA data-aware Pivot Grid control.
Note
Padding adjustments also affect standalone editors if the UsePaddingForStandaloneEditors property is set to True.
TObject TdxVisualRefinements
See Also