def register_tree_actions(self): actions = ActionInfoCollection(tree_actions, self, self._tree) self._action_registerer.register_actions(actions) self._action_registerer.register_action( ActionInfo(menu_name='Edit', name='Add Tag to selected', action=self.OnAddTagToSelected)) self._action_registerer.register_action( ActionInfo(menu_name='Edit', name='Clear Selected', action=self.OnClearSelected))
def register_shortcut(self, shortcut, callback): action_info = ActionInfo(None, None, action=callback, shortcut=shortcut) action = self.__frame.actions.register_shortcut(action_info) self.__actions.append(action) return action
def enable(self): self.register_action(ActionInfo('View','View Test Suites Explorer', self.OnShowTree, shortcut='F12', doc='Show Test Suites tree panel', position=1)) self.subscribe(self.OnTreeSelection, RideTreeSelection) # self.save_setting('opened', True) if self.opened: self.OnShowTree(None)
def __init__(self, tree, action_registerer): self._tree = tree tree.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit) tree.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnLabelEdited) tree.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) if IS_WINDOWS: #Delete key does not work in windows without registration action_registerer.register_shortcut(ActionInfo(None, None, action=self.OnDelete, shortcut='Del')) self._editing_label = False self._on_label_edit_called = False