TdxAutomationProperty.Calculated Property
Specifies if the UIA node property value is calculated.
Declaration
property Calculated: Boolean read; write;
Property Value
Type | Description |
---|---|
Boolean |
Remarks
All UIA node properties are calculated automatically if the dxUIACalculateAllProperties global variable is set to True
(default). If automatic UIA property calculation is disabled, you can set the Calculated
property to True
within an OnInitializeProperties event handler to mark individual UIA properties as calculated.
Code Example: Calculate Only UIA Node Names for Editors
The code example in this section demonstrates an OnInitializeProperties event handler that disables automatic calculation for UIA node properties and enables calculation only for the Name UIA property. The form’s OnCreate event handler assigns the same OnInitializeProperties event handler to TcxTextEdit, TcxButtonEdit, and TcxCheckBox editors.
uses
dxUIAClasses, // Declares all UI Automation classes
cxEdit, // Declares base editor classes and auxiliary types
cxTextEdit, // Declares the TcxTextEdit class
cxCheckBox, // Declares the TcxCheckBox class
cxButtonEdit; // Declares the TcxButtonEdit class
// ...
procedure TMyForm.InitializeAutomationProperties(
ASender: TObject; AProperties: TdxAutomationProperties);
begin
if dxUIACalculateAllProperties then
dxUIACalculateAllProperties := False; // Disables automatic UIA node property calculation
AProperties.Name.Calculated := True; // Enables calculation for the initialized Name UIA property
end;
procedure TMyForm.FormCreate(Sender: TObject);
begin
cxTextEdit1.Properties.Automation.OnInitializeProperties := InitializeAutomationProperties;
cxCheckBox1.Properties.Automation.OnInitializeProperties := InitializeAutomationProperties;
cxButtonEdit1.Properties.Automation.OnInitializeProperties := InitializeAutomationProperties;
end;
See Also