Adds the possibility to disable accessibility for TCustomTreeView

git-svn-id: trunk@35508 -
This commit is contained in:
sekelsenmat 2012-02-20 13:40:24 +00:00
parent 9a2c21130a
commit ec0df9a7e4
3 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -118,7 +118,6 @@ begin
if (WidgetsetClass <> nil) and (FHandle <> 0) then
WidgetsetClass.DestroyHandle(Self);
FreeAndNil(FChildrenSortedForDataObject);
FreeAndNil(FChildrenSortedForDataObject);
inherited Destroy;
end;

View File

@ -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;