[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TLazAccessibleObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Represents an accessibility object for user or accessibility tool interactions.

## Declaration

Source position: controls.pp line 1110

`type TLazAccessibleObject = class`
`protected`
`FHandle: PtrInt;` |  | Member with the Handle for the accessibility object.
`FChildrenSortedForDataObject: TAvlTree;` |  | Member with the AVL tree for the sorted child objects.
`FAccessibleName: TCaption;` |  | Member with the value for AccessibleName.
`FAccessibleDescription: TCaption;` |  | Member with the value for AccessibleDescription.
`FAccessibleValue: TCaption;` |  | Member with the value for AccessibleValue.
`FAccessibleRole: TLazAccessibilityRole;` |  | Member with the value for AccessibleRole.
`class procedure WSRegisterClass; virtual;` |  | Registers this component class with the current WidgetSet.
`function GetAccessibleValue; virtual;` |  | Gets the value for the AccessibleValue property.
`function GetHandle; virtual;` |  | Gets the value for the Handle property.
`public`
`OwnerControl: TControl;` |  | The control that this accessible object is attached to. It might be the main accessible object of this control or it might represent a sub-part of a control.
`Parent: TLazAccessibleObject;` |  | The parent TLazAccessibleObject of this accessible object.
`DataObject: TObject;` |  | Available to be used to connect to an object.
`SecondaryHandle: PtrInt;` |  | Available for Widgetsets to use.
`constructor Create(); virtual;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function HandleAllocated;` |  | Returns if the handle of this object was already allocated or not.
`procedure InitializeHandle; virtual;` |  | Utilized to set all properties of this property via widgetset routines when creating the handle.
`procedure SetAccessibleName();` |  | Sets the value for AccessibleName.
`procedure SetAccessibleDescription();` |  | Setter for the property AccessibleDescription.
`procedure SetAccessibleValue();` |  | Setter for the property AccessibleValue.
`procedure SetAccessibleRole();` |  | Setter for the property AccessibleRole.
`function FindOwnerWinControl;` |  | Inspect the tree of accessible objects upwards until it finds a parent which is attached directly to a windowed control, a TWinControl.
`function AddChildAccessibleObject();` |  | Creates and returns a new child accessibility object.
`procedure InsertChildAccessibleObject();` |  | Inserts an already created child accessible object as a child of this one.
`procedure ClearChildAccessibleObjects;` |  | Removes all children of this control; freed if they are not attached to a TControl instance.
`procedure RemoveChildAccessibleObject();` |  | Removes a child accessible object.
`function GetChildAccessibleObjectWithDataObject();` |  | Obtains a child accessible object by its DataObject property.
`function GetChildAccessibleObjectsCount;` |  | Returns the number of direct children that this accessible object has.
`function GetChildAccessibleObject();` |  | Obtains a child accessible object by its index.
`function GetFirstChildAccessibleObject;` |  | Searches in sub-controls for the first child accessibility object.
`function GetNextChildAccessibleObject;` |  | Searches in sub-controls for the next child accessibility object.
`function GetSelectedChildAccessibleObject; virtual;` |  | Returns the currently selected child accessible object or Nil if none are selected; Override this method in your sub class.
`function GetChildAccessibleObjectAtPos(); virtual;` |  | Returns the child of this control located at a particular position given as a client position for the control.
`property AccessibleName: TCaption; [rw]` |  | The name for this accessible object.
`property AccessibleDescription: TCaption; [rw]` |  | The description of this accessible object.
`property AccessibleValue: TCaption; [rw]` |  | The value of this accessible object.
`property AccessibleRole: TLazAccessibilityRole; [rw]` |  | The role of this accessible object.
`property Position: TPoint; [rw]` |  | The position of this accessible object.
`property Size: TSize; [rw]` |  | The size of this accessible object.
`property Handle: PtrInt; [rw]` |  | The widgetset handle of this accessible object.
`function GetEnumerator;` |  | Default enumerator for the children.
`end;`

## Inheritance

`TLazAccessibleObject` |  | Represents an accessibility object for user or accessibility tool interactions.
`TObject`

## Description

Every TControl has a TLazAccessibleObject instance associated with it, which means that every TControl is potentially accessible. But to actually be usable, the accessible object needs to have its properties set, the most important of which are the role, description and value. Native windowed classes should already receive accessibility properties from the underlying widgetset, while TCustomControl descendants will use the accessibility properties provided by LCL itself.

User applications should add accessibility for their own TCustomControl descendant classes, and possibly customize the descriptions of some elements. It is also possible to make an accessible object invisible to the user, which is done by setting its AccessibleRole property to larIgnored.

Accessibility support in Lazarus is also documented on the Wiki at: https://wiki.lazarus.freepascal.org/LCL_Accessibility.

## See also

TControl |  | The base class for visible controls.
TControl.AccessibleRole |  | The accessibility role for the control which classifies what kind of object in the class instance.
TControl.AccessibleDescription |  | Provides the accessibility description for the control, like "a text caption", etc.
TControl.AccessibleValue |  | The accessibility value for the control.
TLazAccessibilityRole |  | Indicates the role which a accessible object takes in the user interface.