TdxCalculateAutomationPropertyEvent Type
The procedural type for UIA node property calculation events.
Declaration
TdxCalculateAutomationPropertyEvent = procedure(ASender: TObject; AProperty: TdxAutomationProperty; AProperties: TdxAutomationProperties) of object;
Parameters
Name | Type | Description |
---|---|---|
ASender | TObject | Provides access to the control/UI element that raised the UIA node property calculation event. Cast this parameter value to the corresponding terminal control or UI element class to access all public API members. Tip You can call the |
AProperty | TdxAutomationProperty | Provides access to the currently calculated UIA node property. Cast this parameter value to the corresponding terminal UIA node property class (TdxStringAutomationProperty, for example) to access all public API members. Tip You can call the |
AProperties | TdxAutomationProperties | Provides access to the full list of initialized UIA node properties for the |
Remarks
UIA node property calculation events occur every time a UIA client requests individual node properties (multiple times – once per node property).
Code Example: Indicate Read-Only and Editable States
The code example in this section changes the description of an unbound single-line text editor (TcxTextEdit) in the UI Automation tree when the editor switches between read-only and editable states.
uses
dxUIAClasses, // Declares all UI Automation classes
cxEdit, // Declares base editor classes and auxiliary types
cxTextEdit; // Declares the TcxTextEdit class
// ...
procedure TMyForm.cxTextEdit1PropertiesAutomationCalculateProperty(
ASender: TObject; AProperty: TdxAutomationProperty;
AProperties: TdxAutomationProperties);
var
AEdit: TcxTextEdit;
begin
AEdit := ASender as TcxTextEdit;
// Check if the UIA node description property is requested
if AProperty = AProperties.FullDescription then
begin
if AEdit.Properties.ReadOnly then
AProperties.FullDescription.Value := 'Read-Only Mode'
else
AProperties.FullDescription.Value := 'Editable';
end;
end;
Direct TdxCalculateAutomationPropertyEvent Type Reference
The TdxAutomationElementSettings.OnCalculateProperty event references the TdxCalculateAutomationPropertyEvent
procedural type.