mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 23:20:18 +02:00
Adds the possibility to disable accessibility for TCustomTreeView
git-svn-id: trunk@35508 -
This commit is contained in:
parent
9a2c21130a
commit
ec0df9a7e4
@ -2719,6 +2719,7 @@ type
|
||||
|
||||
TCustomTreeView = class(TCustomControl)
|
||||
private
|
||||
FAccessibilityOn: Boolean;
|
||||
FBackgroundColor: TColor;
|
||||
FBottomItem: TTreeNode;
|
||||
FEditingItem: TTreeNode;
|
||||
@ -2918,6 +2919,10 @@ type
|
||||
// Accessibility
|
||||
function GetSelectedChildAccessibleObject: TLazAccessibleObject; override;
|
||||
function GetChildAccessibleObjectAtPos(APos: TPoint): TLazAccessibleObject; override;
|
||||
// This property is provided when a tree view contains a huge amount of items,
|
||||
// lets say 10.000+. In this case accessibility might slow the tree down, so turning
|
||||
// it off might make things faster
|
||||
property AccessibilityOn: Boolean read FAccessibilityOn write FAccessibilityOn default True;
|
||||
protected
|
||||
property AutoExpand: Boolean read GetAutoExpand write SetAutoExpand default False;
|
||||
property BorderStyle default bsSingle;
|
||||
|
@ -118,7 +118,6 @@ begin
|
||||
if (WidgetsetClass <> nil) and (FHandle <> 0) then
|
||||
WidgetsetClass.DestroyHandle(Self);
|
||||
FreeAndNil(FChildrenSortedForDataObject);
|
||||
FreeAndNil(FChildrenSortedForDataObject);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
@ -2257,7 +2257,7 @@ begin
|
||||
if (FUpdateCount=0) and (Owner<>nil) then
|
||||
Owner.Invalidate;
|
||||
ok:=true;
|
||||
if ok and (Owner<>nil) then
|
||||
if ok and (Owner<>nil) and (Owner.AccessibilityOn) then
|
||||
begin
|
||||
lAccessibleObject := FOwner.GetAccessibleObject().AddChildAccessibleObject();
|
||||
lAccessibleObject.AccessibleDescription := 'Item';
|
||||
@ -3068,6 +3068,7 @@ begin
|
||||
// Accessibility
|
||||
AccessibleDescription := rsTTreeViewAccessibilityDescription;
|
||||
AccessibleRole := larTreeView;
|
||||
FAccessibilityOn := True;
|
||||
end;
|
||||
|
||||
destructor TCustomTreeView.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user