Example #1
0
 def init(self, parent):
     """ Finishes initializing the editor by creating the underlying toolkit
         widget.
     """
     self._control = ThemedControl(theme=self.factory.theme)
     self.control = self._control.create_control(parent)
     self.set_tooltip()
    def _get_closed_page ( self ):
        """ Returns the 'closed' form of the notebook page.
        """
        result = ThemedControl( theme             = self.closed_theme,
                                text              = self.name,
                                controller        = self,
                                default_alignment = 'center',
                                state             = 'closed' )
        result.create_control( self.notebook.control )

        return result
Example #3
0
    def _get_closed_page(self):
        """ Returns the 'closed' form of the notebook page.
        """
        result = ThemedControl(theme=self.closed_theme,
                               text=self.name,
                               controller=self,
                               default_alignment='center',
                               state='closed')
        result.create_control(self.notebook.control)

        return result
 def init(self, parent):
     """ Finishes initializing the editor by creating the underlying toolkit
         widget.
     """
     self._control = ThemedControl(theme=self.factory.theme)
     self.control = self._control.create_control(parent)
     self.set_tooltip()
class _ReadonlyTextEditor(Editor):
    """ Traits UI simple, read-only single line text view with a themed (i.e.
        image background).
    """

    #-------------------------------------------------------------------------
    #  Finishes initializing the editor by creating the underlying toolkit
    #  widget:
    #-------------------------------------------------------------------------

    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        self._control = ThemedControl(theme=self.factory.theme)
        self.control = self._control.create_control(parent)
        self.set_tooltip()

    #-------------------------------------------------------------------------
    #  Updates the editor when the object trait changes external to the editor:
    #-------------------------------------------------------------------------

    def update_editor(self):
        """ Updates the editor when the object trait changes externally to the
            editor.
        """
        self._control.text = self.value

        # Make sure the control is sized correctly:
        self.control.SetMinSize(self._control.best_size)
Example #6
0
class _ReadonlyTextEditor(Editor):
    """ Traits UI simple, read-only single line text view with a themed (i.e.
        image background).
    """

    #-------------------------------------------------------------------------
    #  Finishes initializing the editor by creating the underlying toolkit
    #  widget:
    #-------------------------------------------------------------------------

    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        self._control = ThemedControl(theme=self.factory.theme)
        self.control = self._control.create_control(parent)
        self.set_tooltip()

    #-------------------------------------------------------------------------
    #  Updates the editor when the object trait changes external to the editor:
    #-------------------------------------------------------------------------

    def update_editor(self):
        """ Updates the editor when the object trait changes externally to the
            editor.
        """
        self._control.text = self.value

        # Make sure the control is sized correctly:
        self.control.SetMinSize(self._control.best_size)
    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        # Create the checkbox and its control:
        item = self.item
        factory = self.factory
        label = self.string_value(factory.label or item.label)
        min_size = (0, 0)
        if factory.theme is not None:
            min_size = (80, 0)

        self.checkbox = checkbox = ThemedControl(
            **factory.get('image', 'position', 'spacing', 'theme')).set(
                text=label, controller=self, min_size=min_size)
        self.control = checkbox.create_control(parent)

        # Set the tooltip:
        self.set_tooltip()
Example #8
0
    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        # Create the button and its control:
        factory = self.factory
        label = factory.label
        if (label == '') and (factory.image is None):
            label = self.item.get_label(self.ui)
        label = self.string_value(label)

        self.button = button = ThemedControl(
            **factory.get('theme', 'image', 'position', 'spacing')).set(
                text=label,
                controller=self,
                default_alignment='center',
                min_size=(80, 0))
        self.control = button.create_control(parent)

        # Set the tooltip:
        self.set_tooltip()