コード例 #1
0
ファイル: combo.py プロジェクト: hackedbellini/kiwi
 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)
コード例 #2
0
ファイル: spinbutton.py プロジェクト: hsavolai/vmlab
 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)
コード例 #3
0
ファイル: spinbutton.py プロジェクト: gxela/kiwi-gtk
 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)
コード例 #4
0
ファイル: combo.py プロジェクト: dsaran/packagehelper
    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)
コード例 #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)
コード例 #6
0
ファイル: spinbutton.py プロジェクト: Schevo/kiwi
 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)
コード例 #7
0
ファイル: entry.py プロジェクト: 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)
コード例 #8
0
ファイル: textview.py プロジェクト: fuinha/kiwi
    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)
コード例 #9
0
ファイル: textview.py プロジェクト: hsavolai/vmlab
    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)
コード例 #10
0
ファイル: textview.py プロジェクト: Schevo/kiwi
    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)
コード例 #11
0
ファイル: spinbutton.py プロジェクト: relsi/kiwi
    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)
コード例 #12
0
ファイル: spinbutton.py プロジェクト: rcaferraz/kiwi
    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)
コード例 #13
0
ファイル: entry.py プロジェクト: hsavolai/vmlab
 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)
コード例 #14
0
ファイル: entry.py プロジェクト: 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)
コード例 #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)
コード例 #16
0
ファイル: entry.py プロジェクト: hackedbellini/kiwi
    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)
コード例 #17
0
ファイル: entry.py プロジェクト: hsavolai/vmlab
    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))
コード例 #18
0
ファイル: spinbutton.py プロジェクト: hackedbellini/kiwi
    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)
コード例 #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)
コード例 #20
0
ファイル: entry.py プロジェクト: hsavolai/vmlab
    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))
コード例 #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)
コード例 #22
0
ファイル: combo.py プロジェクト: RENATOZANETTI9/kiwi
    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)
コード例 #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)