| Trees | Indices | Help |
|---|
|
|
1 #NVDAObjects/IAccessible/msOffice.py 2 #A part of NonVisual Desktop Access (NVDA) 3 #This file is covered by the GNU General Public License. 4 #See the file COPYING for more details. 5 #Copyright (C) 2006-2010 Michael Curran <mick@kulgan.net>, James Teh <jamie@jantrid.net> 6 7 import oleacc 8 import IAccessibleHandler 9 import controlTypes 10 import winUser 11 import api 12 from . import IAccessible, getNVDAObjectFromEvent 13 14 """Miscellaneous support for Microsoft Office applications. 15 """1847 5220 name=super(SDM,self).name 21 if not name and self.role==controlTypes.ROLE_LISTITEM: 22 name=self.displayText 23 return name24 2931 if self.IAccessibleChildID == 0 and self.role not in (controlTypes.ROLE_DIALOG, controlTypes.ROLE_PROPERTYPAGE, controlTypes.ROLE_WINDOW): 32 # SDM child IAccessible objects have a broken accParent. 33 # The parent should be the dialog. 34 return getNVDAObjectFromEvent(self.windowHandle, winUser.OBJID_CLIENT, 0) 35 return super(SDM, self).parent3638 if controlTypes.STATE_FOCUSED in self.states: 39 hwndFocus=winUser.getGUIThreadInfo(0).hwndFocus 40 if hwndFocus and hwndFocus!=self.windowHandle and not winUser.getClassName(hwndFocus).startswith('bosa_sdm'): 41 obj=getNVDAObjectFromEvent(hwndFocus,winUser.OBJID_CLIENT,0) 42 if not obj: return None 43 if getattr(obj,'parentSDMCanOverrideName',True): 44 obj.name=self.name 45 return obj 46 return None54 """Work around broken IAccessible implementation for Microsoft Office XP-2003 toolbars. 55 For these IAccessibles, accNavigate is rather broken 56 and retrieving only the first child with AccessibleChildren causes a crash. 57 """ 58 59 @classmethod8161 return obj.childCount > 0 and not IAccessibleHandler.accNavigate(obj.IAccessibleObject, obj.IAccessibleChildID, oleacc.NAVDIR_FIRSTCHILD)6264 # accNavigate incorrectly returns nothing for NAVDIR_FIRSTCHILD and requesting one child with AccessibleChildren causes a crash. 65 # Therefore, we must use accChild(1). 66 child = IAccessibleHandler.accChild(self.IAccessibleObject, 1) 67 if not child: 68 return None 69 return IAccessible(IAccessibleObject=child[0], IAccessibleChildID=child[1])70 71 # accNavigate incorrectly returns the first child for NAVDIR_NEXT. 72 next = None 73 # description is redundant. 74 description = None 7577 name = super(BrokenMsoCommandBar, self).name 78 if name == "MSO Generic Control Container": 79 return None 80 return name
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri Nov 18 17:46:08 2011 | http://epydoc.sourceforge.net |