Esempio n. 1
0
 def __init__(self):
     entry = ProxyEntry()
     ComboEntry.__init__(self, entry=entry)
     ValidatableProxyWidgetMixin.__init__(self)
     entry.connect('content-changed', self._on_entry__content_changed)
     entry.connect('validation-changed',
                   self._on_entry__validation_changed)
Esempio n. 2
0
 def __init__(self, data_type=int):
     # since the default data_type is str we need to set it to int
     # or float for spinbuttons
     gtk.SpinButton.__init__(self)
     ValidatableProxyWidgetMixin.__init__(self)
     self.props.data_type = data_type
     self.set_property('xalign', 1.0)
Esempio n. 3
0
 def __init__(self, data_type=int):
     # since the default data_type is str we need to set it to int
     # or float for spinbuttons
     gtk.SpinButton.__init__(self)
     ValidatableProxyWidgetMixin.__init__(self)
     self.props.data_type = data_type
     self.set_property("xalign", 1.0)
Esempio n. 4
0
    def __init__(self, **kwargs):
        deprecationwarn(
            'ProxyComboBoxEntry is deprecated, use ProxyComboEntry instead',
            stacklevel=3)

        BaseComboBoxEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self, widget=self.entry)

        # We need to create the helper before PropertyObject, since we
        # need to access the helper in prop_set_list_editable, which
        # PropertyObject might call
        self._helper = _EasyComboBoxHelper(self)
        PropertyObject.__init__(self, **kwargs)

        self.set_text_column(ComboColumn.LABEL)

        # here we connect the expose-event signal directly to the entry
        self.child.connect('changed', self._on_child_entry__changed)

        # HACK! we force a queue_draw because when the window is first
        # displayed the icon is not drawn.
        gobject.idle_add(self.queue_draw)

        self.set_events(gtk.gdk.KEY_RELEASE_MASK)
        self.connect("key-release-event", self._on__key_release_event)
Esempio n. 5
0
    def __init__(self):
        Gtk.TextView.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)

        self.data_type = str
        self._textbuffer = Gtk.TextBuffer()
        self._textbuffer.connect('changed', self._on_textbuffer__changed)
        self.set_buffer(self._textbuffer)
Esempio n. 6
0
 def __init__(self, data_type=int):
     # since the default data_type is str we need to set it to int
     # or float for spinbuttons
     gtk.SpinButton.__init__(self)
     PropertyObject.__init__(self, data_type=data_type)
     ValidatableProxyWidgetMixin.__init__(self)
     self._icon = IconEntry(self)
     self.set_property('xalign', 1.0)
Esempio n. 7
0
File: entry.py Progetto: Schevo/kiwi
    def __init__(self, data_type=None):
        self._block_changed = False
        self._has_been_updated = False
        KiwiEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self._data_type = data_type

        # Hide currency symbol from the entry.
        self.set_options_for_datatype(currency, symbol=False)
Esempio n. 8
0
    def __init__(self):
        gtk.TextView.__init__(self)
        self.props.data_type = str
        ValidatableProxyWidgetMixin.__init__(self)

        self._textbuffer = gtk.TextBuffer()
        self._textbuffer.connect('changed',
                                 self._on_textbuffer__changed)
        self.set_buffer(self._textbuffer)
Esempio n. 9
0
    def __init__(self):
        self._is_unset = True
        gtk.TextView.__init__(self)
        self.props.data_type = str
        ValidatableProxyWidgetMixin.__init__(self)

        self._textbuffer = gtk.TextBuffer()
        self._textbuffer.connect('changed', self._on_textbuffer__changed)
        self.set_buffer(self._textbuffer)
Esempio n. 10
0
    def __init__(self):
        self._is_unset = True
        gtk.TextView.__init__(self)
        PropertyObject.__init__(self, data_type=str)
        ValidatableProxyWidgetMixin.__init__(self)

        self._textbuffer = gtk.TextBuffer()
        self._textbuffer.connect('changed',
                                 self._on_textbuffer__changed)
        self.set_buffer(self._textbuffer)
Esempio n. 11
0
    def __init__(self, data_type=int):
        # since the default data_type is str we need to set it to int
        # or float for spinbuttons
        gtk.SpinButton.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self.props.data_type = data_type
        self.set_property('xalign', 1.0)

        # We need to do this because spinbuttons are supposed to accept only
        # numbers.
        self.set_numeric(True)
Esempio n. 12
0
    def __init__(self, data_type=int):
        # since the default data_type is str we need to set it to int
        # or float for spinbuttons
        gtk.SpinButton.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self.props.data_type = data_type
        self.set_property('xalign', 1.0)
        self.set_property("truncate-multiline", True)

        # We need to do this because spinbuttons are supposed to accept only
        # numbers.
        self.set_numeric(True)
Esempio n. 13
0
 def __init__(self, data_type=None):
     self._block_changed = False
     self._has_been_updated = False
     KiwiEntry.__init__(self)
     ValidatableProxyWidgetMixin.__init__(self)
     self._entry_data_type = data_type
     # XXX: Sales -> New Loan Item requires this, figure out why
     try:
         self.props.data_type = data_type
     except (AttributeError, TypeError):
         pass
     # Hide currency symbol from the entry.
     self.set_options_for_datatype(currency, symbol=False)
Esempio n. 14
0
File: entry.py Progetto: fuinha/kiwi
 def __init__(self, data_type=None):
     self._block_changed = False
     self._has_been_updated = False
     KiwiEntry.__init__(self)
     ValidatableProxyWidgetMixin.__init__(self)
     self._entry_data_type = data_type
     # XXX: Sales -> New Loan Item requires this, figure out why
     try:
         self.props.data_type = data_type
     except (AttributeError, TypeError):
         pass
     # Hide currency symbol from the entry.
     self.set_options_for_datatype(currency, symbol=False)
Esempio n. 15
0
    def __init__(self, data_type=None):
        self._block_changed = False
        self._has_been_updated = False
        KiwiEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self._set_data_type(data_type)
        # Hide currency symbol from the entry.
        self.set_options_for_datatype(currency, symbol=False)

        # This used to be an override, but after the gtk3 migration if we
        # use the override or create a do_changed method GObject will break
        # the object in a way that it will be considered a Gtk.SpinButton
        # directly instead of a ProxySpinButton. The side effect of that
        # would be that out custom events (e.g. validate) would not exist.
        self.connect('changed', self._on_changed)
Esempio n. 16
0
    def __init__(self, data_type=None):
        self._block_changed = False
        self._has_been_updated = False
        KiwiEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self._set_data_type(data_type)
        # Hide currency symbol from the entry.
        self.set_options_for_datatype(currency, symbol=False)

        # This used to be an override, but after the gtk3 migration if we
        # use the override or create a do_changed method GObject will break
        # the object in a way that it will be considered a Gtk.SpinButton
        # directly instead of a ProxySpinButton. The side effect of that
        # would be that out custom events (e.g. validate) would not exist.
        self.connect('changed', self._on_changed)
Esempio n. 17
0
    def __init__(self):
        DateEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)

        # Add some space to the entry, so it has rom for the icon, in case
        # of a validation error.
        #
        # Since we set the widget's width based on the number of characters,
        # get the width of a single char, so we can calculate how many
        # 'chars' the icon takes.
        layout = self.entry.get_layout()
        context = layout.get_context()
        metrics = context.get_metrics(context.get_font_description())
        char_width = metrics.get_approximate_char_width() / pango.SCALE
        current_width = self.entry.get_width_chars()

        # We add 4 pixels to the width, because of the icon borders
        icon_width = VALIDATION_ICON_WIDTH + 4
        self.entry.set_width_chars(current_width + int(icon_width / char_width))
Esempio n. 18
0
    def __init__(self, data_type=int):
        # since the default data_type is str we need to set it to int
        # or float for spinbuttons
        Gtk.SpinButton.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self.props.data_type = data_type
        self.set_property('xalign', 1.0)
        self.set_property("truncate-multiline", True)

        # We need to do this because spinbuttons are supposed to accept only
        # numbers.
        self.set_numeric(True)

        # This used to be an override, but after the gtk3 migration if we
        # use the override or create a do_changed method GObject will break
        # the object in a way that it will be considered a Gtk.SpinButton
        # directly instead of a ProxySpinButton. The side effect of that
        # would be that out custom events (e.g. validate) would not exist.
        self.connect('changed', self._on_changed)
Esempio n. 19
0
    def __init__(self, data_type=int):
        # since the default data_type is str we need to set it to int
        # or float for spinbuttons
        Gtk.SpinButton.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)
        self.props.data_type = data_type
        self.set_property('xalign', 1.0)
        self.set_property("truncate-multiline", True)

        # We need to do this because spinbuttons are supposed to accept only
        # numbers.
        self.set_numeric(True)

        # This used to be an override, but after the gtk3 migration if we
        # use the override or create a do_changed method GObject will break
        # the object in a way that it will be considered a Gtk.SpinButton
        # directly instead of a ProxySpinButton. The side effect of that
        # would be that out custom events (e.g. validate) would not exist.
        self.connect('changed', self._on_changed)
Esempio n. 20
0
    def __init__(self):
        DateEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self)

        # Add some space to the entry, so it has rom for the icon, in case
        # of a validation error.
        #
        # Since we set the widget's width based on the number of characters,
        # get the width of a single char, so we can calculate how many
        # 'chars' the icon takes.
        layout = self.entry.get_layout()
        context = layout.get_context()
        metrics = context.get_metrics(context.get_font_description())
        char_width = metrics.get_approximate_char_width() / pango.SCALE
        current_width = self.entry.get_width_chars()

        # We add 4 pixels to the width, because of the icon borders
        icon_width = VALIDATION_ICON_WIDTH + 4
        self.entry.set_width_chars(current_width +
                                   int(icon_width / char_width))
Esempio n. 21
0
    def __init__(self, **kwargs):
        deprecationwarn(
            'ProxyComboBoxEntry is deprecated, use ProxyComboEntry instead',
            stacklevel=3)

        BaseComboBoxEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self, widget=self.entry)

        self._helper = _EasyComboBoxHelper(self)
        for key, value in kwargs.items():
            setattr(self.props, key, value)

        self.set_text_column(ComboColumn.LABEL)

        # here we connect the expose-event signal directly to the entry
        self.child.connect('changed', self._on_child_entry__changed)

        # HACK! we force a queue_draw because when the window is first
        # displayed the icon is not drawn.
        gobject.idle_add(self.queue_draw)

        self.set_events(gtk.gdk.KEY_RELEASE_MASK)
        self.connect("key-release-event", self._on__key_release_event)
Esempio n. 22
0
    def __init__(self, **kwargs):
        deprecationwarn(
            'ProxyComboBoxEntry is deprecated, use ProxyComboEntry instead',
            stacklevel=3)

        BaseComboBoxEntry.__init__(self)
        ValidatableProxyWidgetMixin.__init__(self, widget=self.entry)

        self._helper = _EasyComboBoxHelper(self)
        for key, value in kwargs.items():
            setattr(self.props, key, value)

        self.set_text_column(ComboColumn.LABEL)

        # here we connect the expose-event signal directly to the entry
        self.child.connect('changed', self._on_child_entry__changed)

        # HACK! we force a queue_draw because when the window is first
        # displayed the icon is not drawn.
        gobject.idle_add(self.queue_draw)

        self.set_events(gtk.gdk.KEY_RELEASE_MASK)
        self.connect("key-release-event", self._on__key_release_event)
Esempio n. 23
0
 def __init__(self):
     entry = ProxyEntry()
     ComboEntry.__init__(self, entry=entry)
     ValidatableProxyWidgetMixin.__init__(self)
     entry.connect('content-changed', self._on_entry__content_changed)
     entry.connect('validation-changed', self._on_entry__validation_changed)