Changeset 74
- Timestamp:
- 11/27/07 15:29:18
- Files:
-
- action_groups/trunk/ActionBrowser.py (modified) (1 diff)
- action_groups/trunk/action_tree.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
action_groups/trunk/ActionBrowser.py
r73 r74 270 270 acc.grabFocus() 271 271 272 # TODO: use template DP for toolkit and application 272 273 if acc.isActionable(): 273 274 if not (acc.getRole() == pyatspi.ROLE_MENU and self.row_expanded(path)): 274 try: 275 action_if = acc.queryAction() 276 action_if.doAction(0) 277 except: 278 pass 275 if acc.hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM) and acc.hasToolkitIn('Gecko'): 276 acc.generateClick() 277 else: 278 acc.doAction() 279 279 280 280 elif acc.isEditable(): action_groups/trunk/action_tree.py
r73 r74 83 83 return self._acc.getRole() in roles 84 84 85 def hasToolkitIn(self, *toolkits): 86 app = self._acc.getApplication() 87 try: 88 ai = app.queryApplication() 89 except NotImplementedError: 90 return False 91 return ai.toolkitName in toolkits 92 85 93 def isInteractive(self): 86 94 if self.hasRoleIn(pyatspi.ROLE_SEPARATOR) \ … … 139 147 return 140 148 return eti.getText(0,-1) 149 150 def generateClick(self): 151 try: 152 ci = self.queryComponent() 153 except NotImplementedError: 154 return 155 rect = ci.getExtents(0) 156 x = int(rect.x + rect.width / 2) 157 y = int(rect.y + rect.height / 2) 158 reg = pyatspi.Registry() 159 reg.generateMouseEvent(x, y, pyatspi.MOUSE_B1P) 160 reg.generateMouseEvent(x, y, pyatspi.MOUSE_B1R) 161 reg.generateMouseEvent(x, y, pyatspi.MOUSE_B1C) 162 163 def doAction(self): 164 try: 165 action_if = acc.queryAction() 166 action_if.doAction(0) 167 except: 168 pass 141 169 142 170 class ActionGroup(object):
