本文整理汇总了Python中hscommon.gui.selectable_list.GUISelectableList类的典型用法代码示例。如果您正苦于以下问题:Python GUISelectableList类的具体用法?Python GUISelectableList怎么用?Python GUISelectableList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GUISelectableList类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AccountReassignPanel
class AccountReassignPanel(MainWindowPanel):
def __init__(self, mainwindow):
MainWindowPanel.__init__(self, mainwindow)
self.account_list = GUISelectableList()
def _load(self, accounts):
self.deleted_accounts = set(accounts)
all_accounts = self.document.accounts[:]
target_accounts = [a for a in all_accounts if a not in self.deleted_accounts]
sort_accounts(target_accounts)
target_account_names = [a.name for a in target_accounts]
target_account_names.insert(0, tr('No Account'))
self._target_accounts = target_accounts
self._target_accounts.insert(0, None)
self.account_list[:] = target_account_names
self.account_list.select(0)
def _save(self):
reassign_to = self._target_accounts[self.account_list.selected_index]
self.document.delete_accounts(self.deleted_accounts, reassign_to=reassign_to)
示例2: _update_selection
def _update_selection(self):
GUISelectableList._update_selection(self)
selected_type = AccountType.InOrder[self.selected_index]
self.panel.type = selected_type
示例3: __init__
def __init__(self, panel):
self.panel = panel
account_types_desc = [ACCOUNT_TYPE_DESC[at] for at in AccountType.InOrder]
GUISelectableList.__init__(self, account_types_desc)
示例4: _update_selection
def _update_selection(self):
GUISelectableList._update_selection(self)
repeat_type = REPEAT_OPTIONS_ORDER[self.selected_index]
self.panel.repeat_type = repeat_type
示例5: __init__
def __init__(self, panel):
self.panel = panel
GUISelectableList.__init__(self)
示例6: _update_selection
def _update_selection(self):
GUISelectableList._update_selection(self)
if self.setfunc is not None:
self.setfunc(self.selected_index)
示例7: __init__
def __init__(self, items=None, setfunc=None):
# setfunc(newindex)
GUISelectableList.__init__(self, items=items)
self.setfunc = setfunc
示例8: _update_selection
def _update_selection(self):
GUISelectableList._update_selection(self)
target = self.panel._targets[self.selected_index]
self.panel.budget.target = target
示例9: __init__
def __init__(self, dialog):
self.dialog = dialog
GUISelectableList.__init__(self)
示例10: _update_selection
def _update_selection(self):
self.dialog.select_category(self.dialog.categories[self.selected_index])
GUISelectableList._update_selection(self)
示例11: __init__
def __init__(self, mainwindow):
MainWindowPanel.__init__(self, mainwindow)
self.account_list = GUISelectableList()