From f1f99b4a6e53a2b6b78a13d4fc3c29a1b97c634c Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 16 Feb 2012 09:17:30 +0000 Subject: [PATCH] LCL: added TLazAccessibleObject enumerator git-svn-id: trunk@35394 - --- components/lazutils/avglvltree.pas | 2 +- docs/xml/lcl/controls.xml | 2 ++ lcl/controls.pp | 12 ++++++++++++ lcl/include/control.inc | 12 ++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/components/lazutils/avglvltree.pas b/components/lazutils/avglvltree.pas index a05805f864..d501e75f87 100644 --- a/components/lazutils/avglvltree.pas +++ b/components/lazutils/avglvltree.pas @@ -54,7 +54,7 @@ type { TAvgLvlTreeNodeEnumerator - left to right, low to high } TAvgLvlTreeNodeEnumerator = class - private + protected FTree: TAvgLvlTree; FCurrent: TAvgLvlTreeNode; public diff --git a/docs/xml/lcl/controls.xml b/docs/xml/lcl/controls.xml index 5c7d771d55..745464915f 100644 --- a/docs/xml/lcl/controls.xml +++ b/docs/xml/lcl/controls.xml @@ -14213,6 +14213,8 @@ End; Returns true if AutoSize should be skipped / delayed because of its handle. + Default enumerator for the children + diff --git a/lcl/controls.pp b/lcl/controls.pp index c892af1beb..42b49202d2 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -925,6 +925,17 @@ type // The Child Accessible Objects are designed for non-TControl children // of a TCustomControl descendent, for example the items of a TTreeView + TLazAccessibleObject = class; + + { TLazAccessibleObjectEnumerator } + + TLazAccessibleObjectEnumerator = class(TAvgLvlTreeNodeEnumerator) + private + function GetCurrent: TLazAccessibleObject; + public + property Current: TLazAccessibleObject read GetCurrent; + end; + { TLazAccessibleObject } TLazAccessibleObject = class @@ -972,6 +983,7 @@ type property Position: TPoint read GetPosition write SetPosition; property Size: TSize read GetSize write SetSize; property Handle: PtrInt read GetHandle write SetHandle; + function GetEnumerator: TLazAccessibleObjectEnumerator; end; {* Note on TControl.Caption diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 7ea0d6e70a..a744bd2c70 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -26,6 +26,13 @@ { $DEFINE CHECK_POSITION} +{ TLazAccessibleObjectEnumerator } + +function TLazAccessibleObjectEnumerator.GetCurrent: TLazAccessibleObject; +begin + Result:=TLazAccessibleObject(FCurrent.Data); +end; + { TLazAccessibleObject } function TLazAccessibleObject.GetHandle: PtrInt; @@ -253,6 +260,11 @@ begin Result := OwnerControl.GetChildAccessibleObjectAtPos(APos); end; +function TLazAccessibleObject.GetEnumerator: TLazAccessibleObjectEnumerator; +begin + Result:=TLazAccessibleObjectEnumerator.Create(FChildrenSortedForDataObject); +end; + {------------------------------------------------------------------------------ TControl.AdjustSize