vcl-dxuiaclasses-75e15435.md
Stores a string property for a UI Automation tree node.
TdxStringAutomationProperty = class(
TdxAutomationProperty<string>
)
The TdxStringAutomationProperty class instantiates its ancestor (TdxAutomationProperty with the string type (UnicodeString in C++Builder).
The list below outlines key members of the TdxStringAutomationProperty class. These members allow you to manage an individual UIA node property.
CalculatedSpecifies if the UIA node property is calculated.ClearResets the UIA node property.IsNullIdentifies if the UIA node property is specified.ValueSpecifies the UIA node property value.
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;
#include "dxUIAClasses.hpp" // Declares all UI Automation classes
#include "cxEdit.hpp" // Declares base editor classes and auxiliary types
#include "cxTextEdit.hpp" // Declares the TcxTextEdit class
// Add the following linker directives to the corresponding CPP source file:
#pragma link "dxUIAClasses" // Required to use dxUIAClasses.hpp declarations
#pragma link "cxTextEdit" // Required to use cxTextEdit.hpp declarations
#pragma link "cxEdit" // Required to use cxEdit.hpp declarations
void __fastcall TMyForm::cxTextEdit1PropertiesAutomationCalculateProperty(
TObject *ASender, TdxAutomationProperty *AProperty,
TdxAutomationProperties *AProperties)
{
TcxTextEdit *AEdit = dynamic_cast<TcxTextEdit*>(ASender);
// Check if the UIA node description property is requested
if(AProperty == AProperties->FullDescription)
{
if(AEdit->Properties->ReadOnly)
AProperties->FullDescription->Value = "Read-Only Mode";
else
AProperties->FullDescription->Value = "Editable";
}
}
The following code example initializes Name and FullDescription UIA node names for an existing single-line text editor (TcxTextEdit):
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; AProperties: TdxAutomationProperties);
begin
AProperties.Name.Value := 'Task Description';
AProperties.FullDescription.Value := 'Non-Editable';
end;
#include "dxUIAClasses.hpp" // Declares all UI Automation classes
#include "cxEdit.hpp" // Declares base editor classes and auxiliary types
#include "cxTextEdit.hpp" // Declares the TcxTextEdit class
// Add the following linker directives to the corresponding CPP source file:
#pragma link "dxUIAClasses" // Required to use dxUIAClasses.hpp declarations
#pragma link "cxTextEdit" // Required to use cxTextEdit.hpp declarations
#pragma link "cxEdit" // Required to use cxEdit.hpp declarations
void __fastcall TMyForm::cxTextEdit1PropertiesAutomationCalculateProperty(
TObject *ASender, TdxAutomationProperties *AProperties)
{
AProperties->Name->Value = "Task Description";
AProperties->FullDescription->Value = "Non-Editable";
}
The following public API members reference a TdxStringAutomationProperty object:
TdxAutomationProperties.FullDescriptionStores a UIA tree node’s full description.TdxAutomationProperties.NameStores a UIA tree node name.
TObject TdxAutomationProperty TdxAutomationProperty<T> TdxStringAutomationProperty
See Also