Exemple #1
0
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
Exemple #2
0
    def __init__(self, item = None):
        self._has_clear = False
        self._has_error = False
        self._text = ''
        self.changed = Signal()

        AWidget.__init__(self, item)
Exemple #3
0
    def __init__(self, item=None):
        self._text = ''
        self._icon = None
        self.pressed = Signal()
        self.activated = Signal()  #alias of pressed

        AWidget.__init__(self, item)
Exemple #4
0
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
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
    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())
Exemple #8
0
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()
Exemple #9
0
    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()
Exemple #10
0
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
Exemple #11
0
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
Exemple #12
0
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
Exemple #13
0
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
Exemple #14
0
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()
Exemple #15
0
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 = ''
Exemple #16
0
    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()
Exemple #17
0
    def __init__(self, item=None):
        self._value = 0
        self.changed = Signal()

        AWidget.__init__(self, item)
Exemple #18
0
    def __init__(self, item = None):
        self.triggered = Signal()

        AWidget.__init__(self, item)
Exemple #19
0
    def __init__(self, item=None):
        self._date = False
        self.changed = Signal()

        AWidget.__init__(self, item)
Exemple #20
0
    def __init__(self, item = None):
        self._text = ''
        self._icon = ''
        self.activated = Signal()

        AWidget.__init__(self, item)
Exemple #21
0
    def __init__(self, item=None):
        self._text = ''
        self.changed = Signal()

        AWidget.__init__(self, item)
Exemple #22
0
    def __init__(self, item=None):
        self._list = []
        self._selected = 0
        self.changed = Signal()

        AWidget.__init__(self, item)