From 87ea3201ffb30490543433da9acf4cd060be117e Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 5 Sep 2012 17:40:26 +1000 Subject: [PATCH] IAccessible: Implement getChild. --- source/NVDAObjects/IAccessible/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py index b28651d4d..53c0347a8 100644 --- a/source/NVDAObjects/IAccessible/__init__.py +++ b/source/NVDAObjects/IAccessible/__init__.py @@ -985,6 +985,19 @@ the NVDAObject for IAccessible children=[x for x in children if x and winUser.isDescendantWindow(self.windowHandle,x.windowHandle)] return children + def getChild(self, index): + if self.IAccessibleChildID != 0: + return None + child = IAccessibleHandler.accChild(self.IAccessibleObject, index + 1) + if not child: + if index < self.childCount: + return super(IAccessible, self).getChild(index) + return None + if child[0] == self.IAccessibleObject: + return IAccessible(windowHandle=self.windowHandle, IAccessibleObject=self.IAccessibleObject, IAccessibleChildID=child[1], + event_windowHandle=self.event_windowHandle, event_objectID=self.event_objectID, event_childID=child[1]) + return self.correctAPIForRelation(IAccessible(IAccessibleObject=child[0], IAccessibleChildID=child[1])) + def _get_IA2Attributes(self): try: attribs = self.IAccessibleObject.attributes -- 2.11.0