當前位置: 首頁>>代碼示例>>Python>>正文


Python proxywidget.ValidatableProxyWidgetMixin類代碼示例

本文整理匯總了Python中kiwi.ui.proxywidget.ValidatableProxyWidgetMixin的典型用法代碼示例。如果您正苦於以下問題:Python ValidatableProxyWidgetMixin類的具體用法?Python ValidatableProxyWidgetMixin怎麽用?Python ValidatableProxyWidgetMixin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ValidatableProxyWidgetMixin類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    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)
開發者ID:dsaran,項目名稱:packagehelper,代碼行數:25,代碼來源:combo.py

示例2: __init__

 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)
開發者ID:hackedbellini,項目名稱:kiwi,代碼行數:7,代碼來源:combo.py

示例3: __init__

 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)
開發者ID:gxela,項目名稱:kiwi-gtk,代碼行數:7,代碼來源:spinbutton.py

示例4: __init__

 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)
開發者ID:Schevo,項目名稱:kiwi,代碼行數:8,代碼來源:spinbutton.py

示例5: __init__

    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)
開發者ID:Schevo,項目名稱:kiwi,代碼行數:9,代碼來源:entry.py

示例6: __init__

    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)
開發者ID:fuinha,項目名稱:kiwi,代碼行數:9,代碼來源:textview.py

示例7: __init__

    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)
開發者ID:Schevo,項目名稱:kiwi,代碼行數:10,代碼來源:textview.py

示例8: __init__

    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)
開發者ID:relsi,項目名稱:kiwi,代碼行數:11,代碼來源:spinbutton.py

示例9: __init__

 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)
開發者ID:fuinha,項目名稱:kiwi,代碼行數:13,代碼來源:entry.py

示例10: __init__

    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)
開發者ID:hackedbellini,項目名稱:kiwi,代碼行數:15,代碼來源:entry.py

示例11: __init__

    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))
開發者ID:hsavolai,項目名稱:vmlab,代碼行數:19,代碼來源:entry.py

示例12: __init__

    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)
開發者ID:hackedbellini,項目名稱:kiwi,代碼行數:19,代碼來源:spinbutton.py

示例13: __init__

    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)
開發者ID:RENATOZANETTI9,項目名稱:kiwi,代碼行數:23,代碼來源:combo.py

示例14: set_blank

 def set_blank(self):
     ValidatableProxyWidgetMixin.set_blank(self)
     self.entry.set_blank()
開發者ID:fuinha,項目名稱:kiwi,代碼行數:3,代碼來源:entry.py

示例15: set_invalid

 def set_invalid(self, text=None, fade=True):
     ValidatableProxyWidgetMixin.set_invalid(self, text, fade)
     self.entry.set_invalid(text, fade)
開發者ID:fuinha,項目名稱:kiwi,代碼行數:3,代碼來源:entry.py


注:本文中的kiwi.ui.proxywidget.ValidatableProxyWidgetMixin類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。