| Trees | Indices | Help |
|---|
|
|
1 #NVDAObjects/IAccessible/qt.py 2 #A part of NonVisual Desktop Access (NVDA) 3 #Copyright (C) 2006-2009 NVDA Contributors <http://www.nvda-project.org/> 4 #This file is covered by the GNU General Public License. 5 #See the file COPYING for more details. 6 7 from comtypes import COMError 8 import controlTypes 9 from NVDAObjects.IAccessible import IAccessible 10 import eventHandler 11 from scriptHandler import isScriptWaiting 12144816 widget = self.firstChild 17 if not widget: 18 return None 19 20 wnext = widget.next 21 if not wnext: 22 # There is only one child, so this is probably a widget container. 23 return widget 24 25 try: 26 if wnext.firstChild.role == controlTypes.ROLE_SCROLLBAR: 27 # There is only one child plus a scrollbar, so this is probably a widget container. 28 return widget 29 except AttributeError: 30 pass 31 32 # This is not a widget container. 33 return None3436 if eventHandler.isPendingEvents("gainFocus"): 37 return 38 39 widget = self._containedWidget 40 if widget: 41 # This is a widget container. 42 # Redirect the focus to the contained widget, since QT doesn't do it properly. 43 self.event_focusEntered() 44 eventHandler.executeEvent("gainFocus", widget) 45 return 46 47 return super(Client, self).event_gainFocus()5073 7452 # QT doesn't do accFocus properly, so find the active child ourselves. 53 child = self.firstChild 54 while child: 55 states = child.states 56 if controlTypes.STATE_FOCUSED in states or controlTypes.STATE_SELECTED in states: 57 return child 58 child = child.next 59 return None6062 if eventHandler.isPendingEvents("gainFocus"): 63 return 64 65 child = self.activeChild 66 if child: 67 # QT doesn't fire focus on the active child as it should, so redirect the focus. 68 self.event_focusEntered() 69 eventHandler.executeEvent("gainFocus", child) 70 return 71 72 return super(Container, self).event_gainFocus()76 77 value=None 78 description=None 7989 9081 # QT doesn't do accFocus properly, so find the active child ourselves. 82 child = self.firstChild 83 while child: 84 states = child.states 85 if controlTypes.STATE_FOCUSED in states: 86 return child 87 child = child.next 88 return None92 93 value=None 94115 116 12296 gesture.send() 97 if not isScriptWaiting(): 98 next=self.next 99 if next and controlTypes.STATE_FOCUSED in next.states: 100 eventHandler.executeEvent("gainFocus", next)101103 gesture.send() 104 if not isScriptWaiting(): 105 previous=self.previous 106 if previous and controlTypes.STATE_FOCUSED in previous.states: 107 eventHandler.executeEvent("gainFocus", previous)108 109 __gestures = { 110 "kb:tab": "nextColumn", 111 "kb:rightArrow": "nextColumn", 112 "kb:shift+tab": "previousColumn", 113 "kb:leftArrow": "previousColumn", 114 }124 # QT incorrectly fires a focus event on the parent menu immediately after (correctly) firing focus on the menu item. 125 # This is probably QT task 241161, which was apparently fixed in QT 4.5.1. 126 shouldAllowIAccessibleFocusEvent = False127129 # QT < 4.6 uses ROLE_SYSTEM_IPADDRESS for layered pane. 130 # See QT task 258413. 131 role = controlTypes.ROLE_LAYEREDPANE132134 # QT sets the path of the application in the description, which is irrelevant to the user. 135 description = None 136143138 states = super(Application, self)._get_states() 139 # The application should not have the focused state. 140 # Otherwise, checks for the focused state will always hit the application and assume the focus is valid. 141 states.discard(controlTypes.STATE_FOCUSED) 142 return states
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri Nov 18 17:46:06 2011 | http://epydoc.sourceforge.net |