Exemplo n.º 1
0
 def init(self, parent):
     """ Finishes initializing the editor by creating the underlying toolkit
         widget.
     """
     self.control = LEDNumberCtrl(parent, -1)
     self.control.SetAlignment(LEDStyles[self.factory.alignment])
     self.set_tooltip()
Exemplo n.º 2
0
class _LEDEditor(Editor):
    """ Traits UI 'display only' LED numeric editor.
    """

    #-------------------------------------------------------------------------
    #  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 = LEDNumberCtrl(parent, -1)
        self.control.SetAlignment(LEDStyles[self.factory.alignment])
        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.SetValue(self.str_value)