Esempio n. 1
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
Esempio n. 2
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
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)
Esempio n. 4
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)