Changeset 85
- Timestamp:
- 12/12/07 17:55:19
- Files:
-
- action_groups/trunk/AccDecorator.py (modified) (1 diff)
- action_groups/trunk/ActionTree.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
action_groups/trunk/AccDecorator.py
r82 r85 111 111 pass 112 112 113 def clearSelection(self): 114 selection = self 115 try: 116 si = selection.querySelection() 117 except NotImplementedError: 118 return 119 si.clearSelection() 120 113 121 def toggleSectable(self): 114 122 selection = self._acc.parent action_groups/trunk/ActionTree.py
r82 r85 8 8 from AccDecorator import AccDecorator 9 9 from MessageTransport import Message 10 from KeyGenerator import sendKeyCombination 10 11 11 12 _ = lambda x: x … … 34 35 35 36 self.app = None 36 self. _menu = None37 self.h = False 37 38 #self.set_property('fixed-height-mode', True) # speed display 38 39 … … 108 109 if event.source.getApplication() <> self.app: 109 110 return 111 112 source_acc = AccDecorator(event.source) 110 113 111 114 class PrintMessage(Message): … … 122 125 123 126 if event.type == 'focus:' and \ 124 not ( event.source.getRole() == pyatspi.ROLE_MENU):127 not (source_acc.hasRoleIn(pyatspi.ROLE_MENU)): 125 128 PrintMessage(s).send() 126 129 HideMenuMessage(True).send() … … 136 139 model = self.get_model() 137 140 top = parent_acc_with_role(event.source, pyatspi.ROLE_DIALOG, pyatspi.ROLE_FRAME) 138 print '%s %s' % (model.getRootAcc(), top)141 #print '%s %s' % (model.getRootAcc(), top) 139 142 try: 140 143 root = model.getRootAcc() … … 180 183 def _onHideMenu(self, all=False): 181 184 print 'HideMenu' 185 if self.h: 186 self.h = False 187 return 182 188 model, iter, acc = self._getSelection() 183 189 if None in (acc, iter): … … 200 206 if menu_iter is not None: 201 207 self.get_selection().select_iter(menu_iter) 208 #self.h = True 209 #acc2=self.get_acc_from_path(model.get_path(menu_iter)) 210 #print 'zzz '+str(acc2) 211 #acc2.toggleSectable() 212 202 213 203 214 def do_action(self): … … 213 224 raise 214 225 226 elif acc.isSelectable(): 227 if acc.hasRoleIn(pyatspi.ROLE_MENU_ITEM): 228 if not self.row_expanded(path): 229 if acc.hasToolkitIn('Gecko'): 230 #sendKeyCombination('space', '') 231 acc.generateClick() 232 else: 233 acc.doAction() 234 elif self.row_expanded(path): 235 print '!!!Esc' 236 sendKeyCombination('Escape', '') 237 else: 238 if not acc.hasRoleIn(pyatspi.ROLE_MENU): 239 acc.toggleSectable() # causes too many problems 240 if acc.hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_CHECK_MENU_ITEM): 241 acc.doAction() 242 215 243 # TODO: use template DP for toolkit and application 216 244 elif acc.isActionable(): 217 if not (acc.getRole() == pyatspi.ROLE_MENU and self.row_expanded(path)): 218 if acc.getRole() == pyatspi.ROLE_MENU: 219 self._menu = acc 220 if acc.hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM) and acc.hasToolkitIn('Gecko'): 221 # if acc.hasRoleIn(pyatspi.ROLE_MENU_ITEM): 222 # sendKeyCombination('Space', '') 223 acc.generateClick() 224 else: 225 #acc.generateClick() 226 acc.doAction() 245 print 'act' 246 acc.doAction() 227 247 228 248 if acc.isHyperlink(): … … 238 258 return 239 259 240 elif acc.isSelectable(): 241 print 'selectable' 242 acc.toggleSectable() 243 244 # if getattr(acc, 'is_group', False) and acc.is_group: 245 if acc.is_group: 260 elif acc.is_group: 246 261 if self.row_expanded(path): 247 if acc.getRole() == pyatspi.ROLE_MENU: 248 from KeyGenerator import sendKeyCombination 249 print 'Esc' 250 sendKeyCombination('Escape', '') 251 else: 252 self.collapse_row(path) 262 self.collapse_row(path) 253 263 elif model.iter_has_child(iter): 254 264 self.expand_row(path, False)
