mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 19:20:40 +02:00
Adds more method for TLazAccessibleObject to manipulate the list of children
git-svn-id: trunk@35239 -
This commit is contained in:
parent
b3a2ce9517
commit
015279a045
@ -958,8 +958,9 @@ type
|
|||||||
procedure SetAccessibleRole(const ARole: TLazAccessibilityRole);
|
procedure SetAccessibleRole(const ARole: TLazAccessibilityRole);
|
||||||
function FindOwnerWinControl: TWinControl;
|
function FindOwnerWinControl: TWinControl;
|
||||||
function AddChildAccessibleObject: TLazAccessibleObject; virtual;
|
function AddChildAccessibleObject: TLazAccessibleObject; virtual;
|
||||||
|
procedure InsertChildAccessibleObject(AObject: TLazAccessibleObject);
|
||||||
procedure ClearChildAccessibleObjects;
|
procedure ClearChildAccessibleObjects;
|
||||||
procedure RemoveChildAccessibleObject(AObject: TLazAccessibleObject);
|
procedure RemoveChildAccessibleObject(AObject: TLazAccessibleObject; AFreeObject: Boolean = True);
|
||||||
function GetChildAccessibleObject(AIndex: Integer): TLazAccessibleObject;
|
function GetChildAccessibleObject(AIndex: Integer): TLazAccessibleObject;
|
||||||
function GetChildAccessibleObjectWithDataObject(ADataObject: TObject): TLazAccessibleObject;
|
function GetChildAccessibleObjectWithDataObject(ADataObject: TObject): TLazAccessibleObject;
|
||||||
function GetChildAccessibleObjectsCount: Integer;
|
function GetChildAccessibleObjectsCount: Integer;
|
||||||
|
@ -177,19 +177,32 @@ begin
|
|||||||
//DebugLn('[TControl.AddChildAccessibleObject] Name=%s', [Name]);
|
//DebugLn('[TControl.AddChildAccessibleObject] Name=%s', [Name]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLazAccessibleObject.InsertChildAccessibleObject(
|
||||||
|
AObject: TLazAccessibleObject);
|
||||||
|
begin
|
||||||
|
if FChildren = nil then Exit;
|
||||||
|
FChildren.Add(AObject);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLazAccessibleObject.ClearChildAccessibleObjects;
|
procedure TLazAccessibleObject.ClearChildAccessibleObjects;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
lXObject: TLazAccessibleObject;
|
||||||
begin
|
begin
|
||||||
if FChildren = nil then Exit;
|
if FChildren = nil then Exit;
|
||||||
//DebugLn(Format('[TControl.ClearChildAccessibleObjects] Name=%s Count=%d', [Name, FAccessibleChildren.Count]));
|
//DebugLn(Format('[TControl.ClearChildAccessibleObjects] Name=%s Count=%d', [Name, FAccessibleChildren.Count]));
|
||||||
|
// Free only the non-control children
|
||||||
for i := 0 to FChildren.Count - 1 do
|
for i := 0 to FChildren.Count - 1 do
|
||||||
TLazAccessibleObject(FChildren.Items[i]).Free;
|
begin
|
||||||
|
lXObject := TLazAccessibleObject(FChildren.Items[i]);
|
||||||
|
if lXObject.OwnerControl = OwnerControl then
|
||||||
|
lXObject.Free;
|
||||||
|
end;
|
||||||
FChildren.Clear;
|
FChildren.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLazAccessibleObject.RemoveChildAccessibleObject(
|
procedure TLazAccessibleObject.RemoveChildAccessibleObject(
|
||||||
AObject: TLazAccessibleObject);
|
AObject: TLazAccessibleObject; AFreeObject: Boolean = True);
|
||||||
var
|
var
|
||||||
lIndex: Integer;
|
lIndex: Integer;
|
||||||
begin
|
begin
|
||||||
@ -197,7 +210,7 @@ begin
|
|||||||
lIndex := FChildren.IndexOf(AObject);
|
lIndex := FChildren.IndexOf(AObject);
|
||||||
if lIndex >= 0 then
|
if lIndex >= 0 then
|
||||||
begin
|
begin
|
||||||
TLazAccessibleObject(FChildren.Items[lIndex]).Free;
|
if AFreeObject then TLazAccessibleObject(FChildren.Items[lIndex]).Free;
|
||||||
FChildren.Delete(lIndex);
|
FChildren.Delete(lIndex);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -329,7 +329,7 @@ function GetCarbonWindow(AWidget: WindowRef): TCarbonWindow;
|
|||||||
function GetCarbonControl(AWidget: ControlRef): TCarbonControl;
|
function GetCarbonControl(AWidget: ControlRef): TCarbonControl;
|
||||||
|
|
||||||
const
|
const
|
||||||
larAXStaticTextRoles = [larClock, larLabel, larListItem, larTreeItem];
|
larAXStaticTextRoles = [larClock, larLabel, larListItem, larTreeItem, larResizeGrip];
|
||||||
larAXListRoles = [larListBox, larTreeView];
|
larAXListRoles = [larListBox, larTreeView];
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
@ -342,6 +342,8 @@ begin
|
|||||||
// AXStaticText
|
// AXStaticText
|
||||||
if lLazAXRole in larAXStaticTextRoles then
|
if lLazAXRole in larAXStaticTextRoles then
|
||||||
begin
|
begin
|
||||||
|
lOutputStr := CFSTR('AXValue');
|
||||||
|
CFArrayAppendValue(lInputMutableArray, lOutputStr);
|
||||||
lOutputStr := CFSTR('AXStringForRange');
|
lOutputStr := CFSTR('AXStringForRange');
|
||||||
CFArrayAppendValue(lInputMutableArray, lOutputStr);
|
CFArrayAppendValue(lInputMutableArray, lOutputStr);
|
||||||
lOutputStr := CFSTR('AXAttributedStringForRange');
|
lOutputStr := CFSTR('AXAttributedStringForRange');
|
||||||
@ -434,7 +436,7 @@ begin
|
|||||||
larMenuBar: lAXRole := CFSTR('AXMenuBar');
|
larMenuBar: lAXRole := CFSTR('AXMenuBar');
|
||||||
larMenuItem: lAXRole := CFSTR('AXMenuItem');
|
larMenuItem: lAXRole := CFSTR('AXMenuItem');
|
||||||
larProgressIndicator: lAXRole := CFSTR('AXProgressIndicator');
|
larProgressIndicator: lAXRole := CFSTR('AXProgressIndicator');
|
||||||
larResizeGrip: lAXRole := CFSTR('AXHandle');
|
larResizeGrip: lAXRole := CFSTR('AXStaticText'); // VoiceOver cannot handle AXHandle in Mac 10.6, so we fallback to AXStaticText
|
||||||
larScrollBar: lAXRole := CFSTR('AXScrollBar');
|
larScrollBar: lAXRole := CFSTR('AXScrollBar');
|
||||||
larSpinner: lAXRole := CFSTR('AXIncrementor');
|
larSpinner: lAXRole := CFSTR('AXIncrementor');
|
||||||
larTabControl: lAXRole := CFSTR('AXTabGroup');
|
larTabControl: lAXRole := CFSTR('AXTabGroup');
|
||||||
|
Loading…
Reference in New Issue
Block a user