mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-27 14:01:31 +01:00
Upgrades the Accessibility structure to support roles, name, description and more easily extensible notifications
git-svn-id: trunk@34678 -
This commit is contained in:
parent
13f554a1f4
commit
5b98ba7981
@ -1700,6 +1700,9 @@ type
|
|||||||
|
|
||||||
TWinControl = class(TControl)
|
TWinControl = class(TControl)
|
||||||
private
|
private
|
||||||
|
FAccessibleDescription: TCaption;
|
||||||
|
FAccessibleName: TCaption;
|
||||||
|
FAccessibleRole: TLazAccessibilityRole;
|
||||||
FAlignOrder: TFPList; // list of TControl. Last moved (SetBounds) comes first. Used by AlignControls.
|
FAlignOrder: TFPList; // list of TControl. Last moved (SetBounds) comes first. Used by AlignControls.
|
||||||
FBorderWidth: TBorderWidth;
|
FBorderWidth: TBorderWidth;
|
||||||
FBoundsLockCount: integer;
|
FBoundsLockCount: integer;
|
||||||
@ -1749,6 +1752,9 @@ type
|
|||||||
function GetIsResizing: boolean;
|
function GetIsResizing: boolean;
|
||||||
function GetTabOrder: TTabOrder;
|
function GetTabOrder: TTabOrder;
|
||||||
function GetVisibleDockClientCount: Integer;
|
function GetVisibleDockClientCount: Integer;
|
||||||
|
procedure SetAccessibleDescription(AValue: TCaption);
|
||||||
|
procedure SetAccessibleName(AValue: TCaption);
|
||||||
|
procedure SetAccessibleRole(AValue: TLazAccessibilityRole);
|
||||||
procedure SetChildSizing(const AValue: TControlChildSizing);
|
procedure SetChildSizing(const AValue: TControlChildSizing);
|
||||||
procedure SetDockSite(const NewDockSite: Boolean);
|
procedure SetDockSite(const NewDockSite: Boolean);
|
||||||
procedure SetHandle(NewHandle: HWND);
|
procedure SetHandle(NewHandle: HWND);
|
||||||
@ -1932,6 +1938,9 @@ type
|
|||||||
property OnGetDockCaption: TGetDockCaptionEvent read FOnGetDockCaption write FOnGetDockCaption;
|
property OnGetDockCaption: TGetDockCaptionEvent read FOnGetDockCaption write FOnGetDockCaption;
|
||||||
public
|
public
|
||||||
// properties which are supported by all descendents
|
// properties which are supported by all descendents
|
||||||
|
property AccessibleDescription: TCaption read FAccessibleDescription write SetAccessibleDescription;
|
||||||
|
property AccessibleName: TCaption read FAccessibleName write SetAccessibleName;
|
||||||
|
property AccessibleRole: TLazAccessibilityRole read FAccessibleRole write SetAccessibleRole;
|
||||||
property BorderWidth: TBorderWidth read FBorderWidth write SetBorderWidth default 0;
|
property BorderWidth: TBorderWidth read FBorderWidth write SetBorderWidth default 0;
|
||||||
property BoundsLockCount: integer read FBoundsLockCount;
|
property BoundsLockCount: integer read FBoundsLockCount;
|
||||||
property Brush: TBrush read GetBrush;
|
property Brush: TBrush read GetBrush;
|
||||||
|
|||||||
@ -524,12 +524,12 @@ begin
|
|||||||
// But Forms is not in the uses clause
|
// But Forms is not in the uses clause
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWidgetSet.LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure TWidgetSet.LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWidgetSet.LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure TWidgetSet.LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -356,14 +356,14 @@ begin
|
|||||||
Result := WidgetSet.IsMobilePlatform();
|
Result := WidgetSet.IsMobilePlatform();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
WidgetSet.LazAccessibility_SendTextChangedNotification(ANewText);
|
WidgetSet.LazAccessibility_SendNotification(ANotification, ATextParam, AIntParam1, AIntParam2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
WidgetSet.LazAccessibility_SendSelectionChangedNotification(ASelStart, ASelEnd);
|
WidgetSet.LazAccessibility_SetFields(AHandle, ADescription, AName, ARole);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod);
|
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod);
|
||||||
|
|||||||
@ -94,8 +94,8 @@ function InvalidateFrame(aHandle : HWND; ARect : pRect; bErase : Boolean; Border
|
|||||||
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function IsMobilePlatform: Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function IsMobilePlatform: Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|
||||||
procedure LazAccessibility_SendTextChangedNotification(const ANewText: string); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
procedure LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
procedure LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
procedure LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
procedure LazDeviceAPIs_SendMessage(AMsg: TLazDeviceMessage); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
procedure LazDeviceAPIs_SendMessage(AMsg: TLazDeviceMessage); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
procedure LazDeviceAPIs_StartReadingAccelerometerData(); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
procedure LazDeviceAPIs_StartReadingAccelerometerData(); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|||||||
@ -7754,6 +7754,24 @@ begin
|
|||||||
if TControl(FDockClients[I]).Visible then inc(Result);
|
if TControl(FDockClients[I]).Visible then inc(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.SetAccessibleDescription(AValue: TCaption);
|
||||||
|
begin
|
||||||
|
if FAccessibleDescription=AValue then Exit;
|
||||||
|
FAccessibleDescription:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.SetAccessibleName(AValue: TCaption);
|
||||||
|
begin
|
||||||
|
if FAccessibleName=AValue then Exit;
|
||||||
|
FAccessibleName:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.SetAccessibleRole(AValue: TLazAccessibilityRole);
|
||||||
|
begin
|
||||||
|
if FAccessibleRole=AValue then Exit;
|
||||||
|
FAccessibleRole:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
procedure TWinControl.SetChildSizing(const AValue: TControlChildSizing);
|
procedure TWinControl.SetChildSizing(const AValue: TControlChildSizing);
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
|||||||
@ -168,12 +168,12 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure TCDWidgetSet.LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure TCDWidgetSet.LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -118,12 +118,12 @@ begin
|
|||||||
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure TCDWidgetSet.LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure TCDWidgetSet.LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -119,12 +119,12 @@ begin
|
|||||||
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure TCDWidgetSet.LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure TCDWidgetSet.LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -119,12 +119,12 @@ begin
|
|||||||
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
Result := Application.ApplicationType in [atPDA, atKeyPadDevice, atTV, atMobileEmulator];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendTextChangedNotification(const ANewText: string);
|
procedure TCDWidgetSet.LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetSet.LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer);
|
procedure TCDWidgetSet.LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -57,8 +57,8 @@ procedure HideVirtualKeyboard();
|
|||||||
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
||||||
function IsMobilePlatform: Boolean; override;
|
function IsMobilePlatform: Boolean; override;
|
||||||
|
|
||||||
procedure LazAccessibility_SendTextChangedNotification(const ANewText: string); override;
|
procedure LazAccessibility_SendNotification(ANotification: TLazAccessibilityNotification; const ATextParam: string; const AIntParam1, AIntParam2: Integer); override;
|
||||||
procedure LazAccessibility_SendSelectionChangedNotification(const ASelStart, ASelEnd: Integer); override;
|
procedure LazAccessibility_SetFields(AHandle: HWND; const ADescription, AName: string; ARole: TLazAccessibilityRole); override;
|
||||||
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod); override;
|
procedure LazDeviceAPIs_RequestPositionInfo(AMethod: TLazPositionMethod); override;
|
||||||
procedure LazDeviceAPIs_SendMessage(AMsg: TLazDeviceMessage); override;
|
procedure LazDeviceAPIs_SendMessage(AMsg: TLazDeviceMessage); override;
|
||||||
procedure LazDeviceAPIs_StartReadingAccelerometerData(); override;
|
procedure LazDeviceAPIs_StartReadingAccelerometerData(); override;
|
||||||
|
|||||||
@ -125,6 +125,37 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ LazAccessibility }
|
||||||
|
|
||||||
|
TLazAccessibilityNotification = (
|
||||||
|
lanTextChanged, // The text or current line of text of the object has changed
|
||||||
|
lanCursorOrSelectionChanged // The cursor or the text selection changed
|
||||||
|
);
|
||||||
|
|
||||||
|
TLazAccessibilityRole = (
|
||||||
|
larAlertMessage, // An object that is used to alert the user.
|
||||||
|
larAnimation, // An object that displays an animation.
|
||||||
|
larButton, // A button.
|
||||||
|
larButtonDropDown, // A button that drops down a list of items or drops down something else
|
||||||
|
larCell, // A cell in a table.
|
||||||
|
larChart, // An object that displays a graphical representation of data.
|
||||||
|
larCheckBox, // An object that can be checked or unchecked, or sometimes in an intermediary state
|
||||||
|
larClock, // A clock displaying time.
|
||||||
|
larComboBox, // A list of choices that the user can select from.
|
||||||
|
larEditableText, // Editable text
|
||||||
|
larIgnore, // Something to be ignored. For example a blank space between other objects.
|
||||||
|
larImage, // A graphic or picture or an icon.
|
||||||
|
larGrip, // A grip that the user can drag to change the size of widgets.
|
||||||
|
larHotkeyField, // A hotkey field that allows the user to enter a key sequence.
|
||||||
|
larHotLink, // A link to something else.
|
||||||
|
larLabel, // A text label as usually placed near other widgets.
|
||||||
|
larList, // A list of items, from which the user can select one or more items.
|
||||||
|
larListItem, // An item in a list of items.
|
||||||
|
larTree, // A list of items in a tree structure.
|
||||||
|
larTreeItem, // An item in a tree structure.
|
||||||
|
larWindow // A top level window.
|
||||||
|
);
|
||||||
|
|
||||||
{$ifndef WINDOWS}
|
{$ifndef WINDOWS}
|
||||||
THandle = type PtrUInt; // define our own, because the SysUtils.THandle = System.THandle is a longint
|
THandle = type PtrUInt; // define our own, because the SysUtils.THandle = System.THandle is a longint
|
||||||
HANDLE = THandle;
|
HANDLE = THandle;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user