def __init__(self, cmdline): ListBox.__init__(self) self.title = "clipboard" self.cmdline = cmdline self.textbox = TextBox() self.textbox.prompt = " Clipboard: " self.textbox.edithook = self.start
def __init__(self, name=None): Widget.__init__(self, name) self.message = "" self.options = [] self.cursor = 0 self.result = None self.listbox = ListBox() self.listbox.lb = -1
def __init__(self, cmdline): ListBox.__init__(self) self.title = "output" self.cmdline = cmdline
def __init__(self, cmdline): ListBox.__init__(self) self.title = "history" self.cmdline = cmdline self.source_string = self.cmdline.text self.lb = -1
def __init__(self): ListBox.__init__(self, "Help") self.indent = " " * 4
def __init__(self): ListBox.__init__(self, "ActionBox") self.selected = None
def __init__(self, cmdline): ListBox.__init__(self) self.cmdline = cmdline self.parser = None self.loadprograms() import_completion_functions()
def __init__(self, directory): ListBox.__init__(self) self.dir = directory
def __init__(self): ListBox.__init__(self) self.lb = -1
def __init__(self): ListBox.__init__(self, "Menu") self.title = "" self.current = None
class Dialog(Widget): keymap = None def __init__(self, name=None): Widget.__init__(self, name) self.message = "" self.options = [] self.cursor = 0 self.result = None self.listbox = ListBox() self.listbox.lb = -1 def refresh(self): pass def draw(self): pass def input(self, key): if key in self.keymap: self.keymap[key]() def show_listbox(self, entries): _entries = [] for entry in entries: if isinstance(entry, Entry): _entries.append(entry) else: _entries.append(Entry(entry)) self.listbox.show(_entries) def show(self, message, options, entries=None): if entries: self.show_listbox(entries) self.message = message self.options = options self.panel.show() def hide(self): self.listbox.hide() self.panel.hide() def get_result(self): self.result = self.cursor_entry() self.hide() def settop(self): self.cursor = 0 def setbottom(self): self.cursor = len(self.options) - 1 def mvcursor(self, amount): self.cursor += amount def setcursor(self, dist): self.cursor = dist def cursor_entry(self): return self.options[self.cursor] def fix_position(self): if self.cursor < 0: self.cursor = 0 elif self.cursor >= len(self.options): self.cursor = len(self.options) - 1