mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 14:59:30 +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);
|
||||
function FindOwnerWinControl: TWinControl;
|
||||
function AddChildAccessibleObject: TLazAccessibleObject; virtual;
|
||||
procedure InsertChildAccessibleObject(AObject: TLazAccessibleObject);
|
||||
procedure ClearChildAccessibleObjects;
|
||||
procedure RemoveChildAccessibleObject(AObject: TLazAccessibleObject);
|
||||
procedure RemoveChildAccessibleObject(AObject: TLazAccessibleObject; AFreeObject: Boolean = True);
|
||||
function GetChildAccessibleObject(AIndex: Integer): TLazAccessibleObject;
|
||||
function GetChildAccessibleObjectWithDataObject(ADataObject: TObject): TLazAccessibleObject;
|
||||
function GetChildAccessibleObjectsCount: Integer;
|
||||
|
@ -177,19 +177,32 @@ begin
|
||||
//DebugLn('[TControl.AddChildAccessibleObject] Name=%s', [Name]);
|
||||
end;
|
||||
|
||||
procedure TLazAccessibleObject.InsertChildAccessibleObject(
|
||||
AObject: TLazAccessibleObject);
|
||||
begin
|
||||
if FChildren = nil then Exit;
|
||||
FChildren.Add(AObject);
|
||||
end;
|
||||
|
||||
procedure TLazAccessibleObject.ClearChildAccessibleObjects;
|
||||
var
|
||||
i: Integer;
|
||||
lXObject: TLazAccessibleObject;
|
||||
begin
|
||||
if FChildren = nil then Exit;
|
||||
//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
|
||||
TLazAccessibleObject(FChildren.Items[i]).Free;
|
||||
begin
|
||||
lXObject := TLazAccessibleObject(FChildren.Items[i]);
|
||||
if lXObject.OwnerControl = OwnerControl then
|
||||
lXObject.Free;
|
||||
end;
|
||||
FChildren.Clear;
|
||||
end;
|
||||
|
||||
procedure TLazAccessibleObject.RemoveChildAccessibleObject(
|
||||
AObject: TLazAccessibleObject);
|
||||
AObject: TLazAccessibleObject; AFreeObject: Boolean = True);
|
||||
var
|
||||
lIndex: Integer;
|
||||
begin
|
||||
@ -197,7 +210,7 @@ begin
|
||||
lIndex := FChildren.IndexOf(AObject);
|
||||
if lIndex >= 0 then
|
||||
begin
|
||||
TLazAccessibleObject(FChildren.Items[lIndex]).Free;
|
||||
if AFreeObject then TLazAccessibleObject(FChildren.Items[lIndex]).Free;
|
||||
FChildren.Delete(lIndex);
|
||||
end;
|
||||
end;
|
||||
|
@ -329,7 +329,7 @@ function GetCarbonWindow(AWidget: WindowRef): TCarbonWindow;
|
||||
function GetCarbonControl(AWidget: ControlRef): TCarbonControl;
|
||||
|
||||
const
|
||||
larAXStaticTextRoles = [larClock, larLabel, larListItem, larTreeItem];
|
||||
larAXStaticTextRoles = [larClock, larLabel, larListItem, larTreeItem, larResizeGrip];
|
||||
larAXListRoles = [larListBox, larTreeView];
|
||||
|
||||
implementation
|
||||
|
@ -342,6 +342,8 @@ begin
|
||||
// AXStaticText
|
||||
if lLazAXRole in larAXStaticTextRoles then
|
||||
begin
|
||||
lOutputStr := CFSTR('AXValue');
|
||||
CFArrayAppendValue(lInputMutableArray, lOutputStr);
|
||||
lOutputStr := CFSTR('AXStringForRange');
|
||||
CFArrayAppendValue(lInputMutableArray, lOutputStr);
|
||||
lOutputStr := CFSTR('AXAttributedStringForRange');
|
||||
@ -434,7 +436,7 @@ begin
|
||||
larMenuBar: lAXRole := CFSTR('AXMenuBar');
|
||||
larMenuItem: lAXRole := CFSTR('AXMenuItem');
|
||||
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');
|
||||
larSpinner: lAXRole := CFSTR('AXIncrementor');
|
||||
larTabControl: lAXRole := CFSTR('AXTabGroup');
|
||||
|
Loading…
Reference in New Issue
Block a user