LCL accessibility inconsistencies
Original Reporter info from Mantis: Xatar
-
Reporter name:
Original Reporter info from Mantis: Xatar
- Reporter name:
Description:
I think I detected an error in the LCL accessibility implementation - at least the TControl.AccessibleRole has inconsistencies so a screenreader software doesn't work correctly.
Here's the code I'm using to list the values:
[code]unit Unit1;
{mode objfpc}{
H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, TypInfo;
type
{ TForm1 }
TForm1 = class(TForm)
CheckBox1: TCheckBox;
ComboBox1: TComboBox;
ListBox1: TListBox;
ListView1: TListView;
Memo1: TMemo;
RadioButton1: TRadioButton;
ScrollBar1: TScrollBar;
TrackBar1: TTrackBar;
TreeView1: TTreeView;
procedure FormShow(Sender: TObject);
private
{ private declarations }
procedure ListComponents;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.ListComponents;
var
C: TControl;
I: Integer;
O: TLazAccessibleObject;
S: String;
SL: TStringList;
begin
SL := TStringList.Create;
for I := 0 to ComponentCount - 1 do
begin
if Components[I] is TControl then
begin
C := TControl(Components[I]);
S := C.ClassName + ' -> '
+ GetEnumName(TypeInfo(TLazAccessibilityRole),
Integer(C.AccessibleRole));
if C is TListView then
begin
O := TLazAccessibleObject(TListView(C).Items[0]);
S := S + ' (' + O.ClassName + ' -> '
+ GetEnumName(TypeInfo(TLazAccessibilityRole),
Integer(O.AccessibleRole)) + ')';
end;
if C is TTreeView then
begin
O := TLazAccessibleObject(TTreeView(C).Items[0]);
S := S + ' (' + O.ClassName + ' -> '
+ GetEnumName(TypeInfo(TLazAccessibilityRole),
Integer(O.AccessibleRole)) + ')';
end;
end;
SL.Add(S);
end;
SL.SaveToFile('List.txt');
SL.Free;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
ListComponents;
end;
end.[/code]
And here's the output:
[code]TCheckBox -> larButton
TComboBox -> larAnimation
TListBox -> larAnimation
TListView -> larAnimation (TListItem -> larAnimation)
TMemo -> larTextEditorSingleline
TRadioButton -> larButton
TScrollBar -> larAnimation
TTrackBar -> larAnimation
TTreeView -> larTreeView (TTreeNode -> larAnimation)[/code]
I tested it only for a set of standard components, so maybe there will be some more problems!
Mantis conversion info:
- Mantis ID: 26910
- OS Build: Windows 7
- Version: 1.2.2