Exemplo n.º 1
0
    def popup_view ( self ):
        """ Returns the popup View.
        """
        name = self.name
        if self.label != '':
            name = 'object.object.' + name

        factory = self.factory
        item    = Item(
            name,
            show_label = False,
            padding    = -4,
            style      = factory.style,
            height     = factory.height,
            width      = factory.width
        )

        editor = factory.editor
        if editor is not None:
            if not isinstance( editor, EditorFactory ):
                editor = editor()

            item.editor = editor

        return View(
            VGroup(
                item,
                group_theme = '@std:popup'
            ),
            kind = factory.kind
        )
Exemplo n.º 2
0
def Slider ( name, tooltip = '', low = -1.0, high = 1.0, width = 140,
                   label   = None ):
    """ Returns an Item for a value using a RangeSliderEditor.
    """
    result = Item( name,
        width   = -width,
        editor  = RangeSliderEditor( low = low, high = high,
                                     increment = 0.01, body_style = 25 ),
        tooltip = tooltip
    )
    if label is not None:
        result.label = label

    return result
Exemplo n.º 3
0
def Scrubber ( name, tooltip = '', increment = 1, low = 0.0, high = 0.0,
                     width   = 40, label     = None ):
    """ Returns an Item for a value using a ScrubberEditor.
    """
    result = Item( name,
        width      = -width,
        editor     = ScrubberEditor(
                         low       = low,
                         high      = high,
                         increment = increment
                     ),
        tooltip    = tooltip,
        item_theme = '#themes:ScrubberEditor'
    )
    if label is not None:
        result.label = label

    return result