def _create_bindings(self, wnd): BaseFrame._create_bindings(self, wnd) wnd.Bind(wx.EVT_LISTBOX, self._on_folders_listbox, self._lb_folders) wnd.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_pages_list_activated, self._lb_pages) wnd.Bind(wx.EVT_LIST_COL_CLICK, self._on_pages_list_col_click) publisher.subscribe(self._on_notebook_update, ('notebook', 'update')) publisher.subscribe(self._on_notebook_update, ('notebook', 'delete'))
def _create_bindings(self, wnd): BaseFrame._create_bindings(self, wnd) self._task_list_ctrl.Bind(tlc.EVT_LIST_BTN_SNOOZE, self._on_task_btn_snooze) self._task_list_ctrl.Bind(tlc.EVT_LIST_BTN_DISMISS, self._on_task_btn_dismiss) self._task_list_ctrl.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_items_list_activated) wnd.Bind(wx.EVT_BUTTON, self._on_btn_close, id=wx.ID_CLOSE) publisher.subscribe(self._on_tasks_update, ('task', 'update')) publisher.subscribe(self._on_tasks_update, ('task', 'delete'))
def __init__(self, *args, **kwargs): self._model = FilterTreeModel() kwargs['style'] = wx.TR_HIDE_ROOT | \ wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT kwargs['agwStyle'] = CT.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT super(FilterTreeCtrl, self).__init__(*args, **kwargs) self.Bind(CT.EVT_TREE_ITEM_CHECKED, self._on_item_checked) self.Bind(wx.EVT_RIGHT_UP, self._on_right_up) self.Bind(wx.EVT_MENU, self._on_menu_show_only, id=self._menu_show_only_id) self.Bind(wx.EVT_MENU, self._on_menu_show_except, id=self._menu_show_except_id) publisher.subscribe(self._reload_items, ('dict', 'update')) publisher.subscribe(self._reload_items, ('dict', 'delete')) wx.CallAfter(self.refresh)
def _create_bindings(self, wnd): BaseFrame._create_bindings(self, wnd) self._create_menu_bind('menu_file_load', self._on_menu_file_load) self._create_menu_bind('menu_file_save', self._on_menu_file_save) self._create_menu_bind('menu_file_exit', self._on_menu_file_exit) self._create_menu_bind('menu_file_sync', self._on_menu_file_sync) self._create_menu_bind('menu_file_export_tasks', self._on_menu_file_export_tasks) self._create_menu_bind('menu_help_about', self._on_menu_help_about) self._create_menu_bind('menu_task_new', self._on_menu_task_new) self._create_menu_bind('menu_task_quick', self._on_menu_task_quick) self._create_menu_bind('menu_task_edit', self._on_menu_task_edit) self._create_menu_bind('menu_task_delete', self._on_menu_task_delete) self._create_menu_bind('menu_task_clone', self._on_menu_task_clone) self._create_menu_bind('menu_notebook_open', self._on_menu_notebook_open) self._create_menu_bind('menu_task_complete', self._on_menu_task_complete) self._create_menu_bind('menu_task_starred', self._on_menu_task_starred) self._create_menu_bind('menu_search_task', self._on_menu_search_task) self._create_menu_bind('menu_sett_tags', self._on_menu_sett_tags) self._create_menu_bind('menu_sett_goals', self._on_menu_sett_goals) self._create_menu_bind('menu_sett_folders', self._on_menu_sett_folders) self._create_menu_bind('menu_sett_contexts', self._on_menu_sett_contexts) self._create_menu_bind('menu_sett_preferences', self._on_menu_sett_preferences) wnd.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self._on_filter_tree_item_activated, self._filter_tree_ctrl) wnd.Bind(CT.EVT_TREE_ITEM_CHECKED, self._on_filter_tree_item_selected, self._filter_tree_ctrl) wnd.Bind(wx.EVT_RADIOBOX, self._on_rb_show_selection, self['rb_show_selection']) wnd.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_items_list_activated, self._items_list_ctrl) self._items_list_ctrl.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self._on_items_list_right_click) self._items_list_ctrl.Bind(wx.EVT_RIGHT_UP, self._on_items_list_right_click) self._items_list_ctrl.Bind(TLC.EVT_DRAG_TASK, self._on_item_drag) wnd.Bind(wx.EVT_BUTTON, self._on_btn_path_back, id=wx.ID_UP) wnd.Bind(wx.EVT_BUTTON, self._on_btn_edit_parent, self['btn_parent_edit']) wnd.Bind(wx.EVT_TIMER, self._on_timer) wnd.Bind(wx.EVT_ICONIZE, self._on_window_iconze) publisher.subscribe(self._on_tasks_update, ('task', 'update')) publisher.subscribe(self._on_tasks_update, ('task', 'delete')) publisher.subscribe(self._on_frame_messsage, ('gui', 'frame_main')) self._create_popup_menu_bindings(wnd)
def _setup(self): publisher.subscribe(self._on_update_message, ('sync', 'progress')) self[wx.ID_CLOSE].Enable(False)