class AButton(AWidget): def __init__(self, item=None): self._text = '' self._icon = None self.pressed = Signal() self.activated = Signal() #alias of pressed AWidget.__init__(self, item) def emit_pressed(self, *args): self.pressed.emit() self.activated.emit() @property def text(self): return self._text @text.setter def text(self, value): self._text = value @property def icon(self): return self._icon @icon.setter def icon(self, value): self._icon = value
def __init__(self, item = None): self._has_clear = False self._has_error = False self._text = '' self.changed = Signal() AWidget.__init__(self, item)
def __init__(self, item=None): self._text = '' self._icon = None self.pressed = Signal() self.activated = Signal() #alias of pressed AWidget.__init__(self, item)
class AAction(AWidget): def __init__(self, item = None): self._text = '' self._icon = '' self.activated = Signal() AWidget.__init__(self, item) def emit_activated(self, *args): self.activated.emit() @property def text(self): return self._text @text.setter def text(self, value): self._text = value @property def icon(self): return self._icon @icon.setter def icon(self, value): self._icon = value
class AComboBox(AWidget): def __init__(self, item=None): self._list = [] self._selected = 0 self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.selected) def clear(self): self._list = [] def append(self, text): self._list.append(text) def prepend(self, text): self._list.insert(0, text) def remove(self, index): self._list.remove(index) def insert(self, index, text): self._list.insert(index, text) @property def items(self): return self._list @items.setter def items(self, items): self.clear() for item in items: self.append(item) @property def selected(self): return self._selected @selected.setter def selected(self, value): self._selected = value @property def selected_text(self): return self._list[self.selected] @selected_text.setter def selected_text(self, value): index = 0 for item in self._list: if text == item: self.selected = index break index += 1
class AIndicator(AWidget): def __init__(self, window, name, menu, attention_icon, passive_icon): self._window = window self._name = name self._menu = menu self._attention = False self._hidden = False self._attention_icon = attention_icon self._passive_icon = passive_icon self.triggered = Signal() AWidget.__init__(self, self._create_item()) def _create_item(self): raise NotImplementedError() def emit_triggered(self, *arg): self.triggered.emit() @property def attention(self): return self._attention @attention.setter def attention(self, value): self._attention = value @property def hidden(self): return self._hidden @hidden.setter def hidden(self, value): self._hidden = value def hide(self): self.hidden = True def show(self): self.hidden = False @property def attention_icon(self): return self._attention_icon @attention_icon.setter def attention_icon(self, value): self._attention_icon = value @property def passive_icon(self): return self._passive_icon @passive_icon.setter def passive_icon(self, value): self._passive_icon = value
def __init__(self, window, name, menu, attention_icon, passive_icon): self._window = window self._name = name self._menu = menu self._attention = False self._hidden = False self._attention_icon = attention_icon self._passive_icon = passive_icon self.triggered = Signal() AWidget.__init__(self, self._create_item())
class ALineEdit(AWidget): def __init__(self, item = None): self._has_clear = False self._has_error = False self._text = '' self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.text) @property def text(self): return self._text @text.setter def text(self, value): self._text = value def clear(self): self.text = '' @property def has_clear(self): return self._has_clear @has_clear.setter def has_clear(self, value): self._has_clear = value @property def has_error(self): return self._has_error @has_error.setter def has_error(self, value): self._has_error = value def focus(self): raise NotImplementedError() def hide_error(self): raise NotImplementedError() def show_error(self, name = None): raise NotImplementedError() def insert_at_cursor(self, text): raise NotImplementedError()
def __init__(self, item=None): self._hidden = False self._enabled = True self._context_menu = None Object.__init__(self) if item is None: item = self._create_item() self.item = item self.check_type() self.button_press = Signal() self.double_button_press = Signal() self.button_release = Signal()
class ACheckBox(AWidget): def __init__(self, item=None): self._checked = False self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.checked) @property def checked(self): return self._checked @checked.setter def checked(self, value): self._checked = value
class ATimePicker(AWidget): def __init__(self, item = None): self._time = False self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.time) @property def time(self): return self._time @time.setter def time(self, value): self._time = value
class ADatePicker(AWidget): def __init__(self, item=None): self._date = False self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.date) @property def date(self): return self._date @date.setter def date(self, value): self._date = value
class ASpinBox(AWidget): def __init__(self, item=None): self._value = 0 self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.value) @property def value(self): return self._value @value.setter def value(self, value): self._value = value
class AMenu(AWidget): def __init__(self, item = None): self.triggered = Signal() AWidget.__init__(self, item) def emit_triggered(self, *args): self.triggered.emit(self.get_text(*args)) def append(self, text, icon = None): raise NotImplementedError() def get_text(self, widget): raise NotImplementedError() def popup(self, *args): raise NotImplementedError()
class ATextArea(AWidget): def __init__(self, item=None): self._text = '' self.changed = Signal() AWidget.__init__(self, item) def emit_changed(self, *args): self.changed.emit(self.text) @property def text(self): return self._text @text.setter def text(self, value): self._text = value def insert(self, text): raise NotImplementedError() def clear(self): self.text = ''
def __init__(self, name, file, parent=None): #TODO pass signal handlers Object.__init__(self) self.file = file self.name = name self.parent = parent self._builder = None self._hidden = False self._title = '' self.item = None self.widgets = AttrDict() self.other_widgets = AttrDict() self.classes = find_classes(agui.widgets) self.closed = Signal()
def __init__(self, item=None): self._value = 0 self.changed = Signal() AWidget.__init__(self, item)
def __init__(self, item = None): self.triggered = Signal() AWidget.__init__(self, item)
def __init__(self, item=None): self._date = False self.changed = Signal() AWidget.__init__(self, item)
def __init__(self, item = None): self._text = '' self._icon = '' self.activated = Signal() AWidget.__init__(self, item)
def __init__(self, item=None): self._text = '' self.changed = Signal() AWidget.__init__(self, item)
def __init__(self, item=None): self._list = [] self._selected = 0 self.changed = Signal() AWidget.__init__(self, item)