[Nvda-dev] commit r1889 - trunk/source/NVDAObjects/IAccessible

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r1889 - trunk/source/NVDAObjects/IAccessible

NVDA Subversion
Author: mdcurran
Date: Sat Apr  5 01:27:46 2008
New Revision: 1889

Log:
Remove a few unneeded IAccessible class mappings for specific dialogs... just use the standard dialog class. Also place the content of IAccessible NVDAObject's children property in a try except block to catch a few exceptions related to getting children. Also  on foreground change to a dialog, don't set focus to any propertyPage in the dialog (in mozilla there are heepsof them). Just for any propertyPage that is not invisible, just speak that object.

Modified:
   trunk/source/NVDAObjects/IAccessible/__init__.py

Modified: trunk/source/NVDAObjects/IAccessible/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/IAccessible/__init__.py (original)
+++ trunk/source/NVDAObjects/IAccessible/__init__.py Sat Apr  5 01:27:46 2008
@@ -496,21 +496,24 @@
  return obj
 
  def _get_children(self):
- if self.IAccessibleChildID>0:
- return []
- childCount= self.IAccessibleObject.accChildCount
- if childCount==0:
+ try:
+ if self.IAccessibleChildID>0:
+ return []
+ childCount= self.IAccessibleObject.accChildCount
+ if childCount==0:
+ return []
+ children=[]
+ for child in IAccessibleHandler.accessibleChildren(self.IAccessibleObject,0,childCount):
+ if child[0]==self.IAccessibleObject:
+ children.append(IAccessible(windowHandle=self.windowHandle,IAccessibleObject=self.IAccessibleObject,IAccessibleChildID=child[1],event_windowHandle=self.event_windowHandle,event_objectID=self.event_objectID,event_childID=child[1]))
+ elif child[0].accRole(child[1])==IAccessibleHandler.ROLE_SYSTEM_WINDOW:
+ children.append(getNVDAObjectFromEvent(IAccessibleHandler.windowFromAccessibleObject(child[0]),IAccessibleHandler.OBJID_CLIENT,0))
+ else:
+ children.append(IAccessible(IAccessibleObject=child[0],IAccessibleChildID=child[1]))
+ children=[x for x in children if x and winUser.isDescendantWindow(self.windowHandle,x.windowHandle)]
+ return children
+ except:
  return []
- children=[]
- for child in IAccessibleHandler.accessibleChildren(self.IAccessibleObject,0,childCount):
- if child[0]==self.IAccessibleObject:
- children.append(IAccessible(windowHandle=self.windowHandle,IAccessibleObject=self.IAccessibleObject,IAccessibleChildID=child[1],event_windowHandle=self.event_windowHandle,event_objectID=self.event_objectID,event_childID=child[1]))
- elif child[0].accRole(child[1])==IAccessibleHandler.ROLE_SYSTEM_WINDOW:
- children.append(getNVDAObjectFromEvent(IAccessibleHandler.windowFromAccessibleObject(child[0]),IAccessibleHandler.OBJID_CLIENT,0))
- else:
- children.append(IAccessible(IAccessibleObject=child[0],IAccessibleChildID=child[1]))
- children=[x for x in children if x and winUser.isDescendantWindow(self.windowHandle,x.windowHandle)]
- return children
 
  def doDefaultAction(self):
  IAccessibleHandler.accDoDefaultAction(self.IAccessibleObject,self.IAccessibleChildID)
@@ -732,9 +735,6 @@
  def _get_role(self):
  return controlTypes.ROLE_DIALOG
 
- def _get_value(self):
- return None
-
  def _get_description(self):
  children=self.children
  if len(children)==1 and children[0].role==controlTypes.ROLE_PANE:
@@ -759,8 +759,8 @@
  super(Dialog,self).event_gainFocus()
  children=self.children
  for child in children:
- if child.role==controlTypes.ROLE_PROPERTYPAGE:
- IAccessibleHandler.focus_manageEvent(child,needsFocusState=False)
+ if child.role==controlTypes.ROLE_PROPERTYPAGE and controlTypes.STATE_INVISIBLE not in child.states:
+ speech.speakObject(child,reason=speech.REASON_FOCUS)
 
  def event_foreground(self):
  speech.speakObject(self,reason=speech.REASON_FOCUS)
@@ -937,6 +937,7 @@
  ("tooltips_class32",IAccessibleHandler.ROLE_SYSTEM_TOOLTIP):"Tooltip",
  ("tooltips_class32",IAccessibleHandler.ROLE_SYSTEM_HELPBALLOON):"Tooltip",
  (None,IAccessibleHandler.ROLE_SYSTEM_DIALOG):"Dialog",
+ (None,IAccessibleHandler.ROLE_SYSTEM_ALERT):"Dialog",
  (None,IAccessibleHandler.ROLE_SYSTEM_PROPERTYPAGE):"PropertyPage",
  (None,IAccessibleHandler.ROLE_SYSTEM_GROUPING):"Groupbox",
  (None,IAccessibleHandler.ROLE_SYSTEM_ALERT):"Dialog",
@@ -951,11 +952,6 @@
  ("MozillaWindowClass",IAccessibleHandler.ROLE_SYSTEM_APPLICATION):"MozillaUIWindowClass_application",
  ("MozillaUIWindowClass",IAccessibleHandler.ROLE_SYSTEM_APPLICATION):"MozillaUIWindowClass_application",
  ("MozillaDialogClass",IAccessibleHandler.ROLE_SYSTEM_ALERT):"Dialog",
- ("MozillaDialogClass",IAccessibleHandler.ROLE_SYSTEM_DIALOG):"Dialog",
- ("MozillaUIWindowClass",IAccessibleHandler.ROLE_SYSTEM_ALERT):"Dialog",
- ("MozillaUIWindowClass",IAccessibleHandler.ROLE_SYSTEM_DIALOG):"Dialog",
- ("MozillaWindowClass",IAccessibleHandler.ROLE_SYSTEM_ALERT):"Dialog",
- ("MozillaWindowClass",IAccessibleHandler.ROLE_SYSTEM_DIALOG):"Dialog",
  ("MozillaWindowClass",IAccessibleHandler.ROLE_SYSTEM_LISTITEM):"MozillaListItem",
  ("MozillaContentWindowClass",IAccessibleHandler.ROLE_SYSTEM_LISTITEM):"MozillaListItem",
  ("MozillaContentWindowClass",IAccessibleHandler.ROLE_SYSTEM_DOCUMENT):"MozillaDocument",