How to use the pyface.tasks.traits_dock_pane.TraitsDockPane function in pyface

To help you get started, we’ve selected a few pyface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NMGRL / pychron / pychron / workspace / tasks / panes.py View on Github external
show_border=True, label='File Log'))

        bot = VGroup(UItem('commits',
                           editor=TabularEditor(editable=False,
                                                adapter=CommitAdapter())),
                     show_border=True,
                     label='Branch Log')
        left = VGroup(dir_grp, bot)

        return View(VGroup(info_grp,
                           HSplit(left,
                                  right)),
                    handler = CentralPaneHandler())


class WorkspaceControlPane(TraitsDockPane):
    name = 'Controls'

    def traits_view(self):
        return View()
github NMGRL / pychron / pychron / processing / tasks / analysis_edit / panes.py View on Github external
icon_button_editor('configure_button', 'cog',
                                      tooltip=self.configure_history_tooltip)),
            HGroup(spring, CustomLabel('cs_label'), spring, Item('auto_sort')),
            UItem('items', editor=myTabularEditor(adapter=self.adapter,
                                                  operations=['move', 'delete'],
                                                  editable=True,
                                                  drag_external=True,
                                                  selected='selected',
                                                  dclicked='dclicked',
                                                  refresh='refresh_needed',
                                                  multi_select=True,
                                                  column_clicked='column_clicked'))))
        return v


class ControlsPane(TraitsDockPane):
    #dry_run = Bool(True)
    #save_button = Button('Save')
    tool = Instance(IAnalysisEditTool)
    id = 'pychron.processing.controls'
    name = 'Controls'

    def traits_view(self):
        v = View(
            VGroup(
                UItem('tool', style='custom'),
                #HGroup(spring, UItem('save_button'), Item('dry_run'))
            )
        )
        return v
github NMGRL / pychron / pychron / pyscripts / tasks / pyscript_panes.py View on Github external
id = 'pychron.pyscript.control'

    def traits_view(self):
        v = View(
            VGroup(
                UItem('execute',
                      editor=ButtonEditor(label_value='execute_label')),
                VGroup(
                    UItem('use_trace'),
                    UItem('trace_delay', label='Delay (ms)'),
                    show_border=True,
                    label='Trace')))
        return v


class DescriptionPane(TraitsDockPane):
    name = 'Description'
    id = 'pychron.pyscript.description'

    def traits_view(self):
        v = View(
            UItem('description',
                  style='readonly')

            # 'object.selected_command_object',
            #                 show_label=False,
            #                 style='custom',
            #                 height=0.25,
            #                 editor=InstanceEditor(view='help_view')
        )
        return v
github NMGRL / pychron / pychron / loading / tasks / panes.py View on Github external
item = getattr(obj, trait)[row]
        c = item.color
        if hasattr(c, '__iter__'):
            c = [x * 255 for x in c]
        return c

    def get_text_color(self, obj, trait, row, column=0):
        item = getattr(obj, trait)[row]
        color = 'black'
        if hasattr(item.color, '__iter__'):
            if sum(item.color[:3]) < 1.5:
                color = 'white'
        return color


class BaseLoadPane(TraitsDockPane):
    display_load_name = Property(depends_on='model.load_name')

    # display_tray_name = Property(depends_on='model.tray')

    def _get_display_load_name(self):
        if self.model.load_instance:
            ret = '<font color="blue" size="12"><b>{} ({}) {}</b></font>'.format(self.model.load_instance.name,
                                                                               self.model.tray,
                                                                               self.model.load_instance.create_date)
        else:
            ret = ''
        return ret


class PositionTableConfigurer(TableConfigurer):
    id = 'position_table'
github NMGRL / pychron / pychron / pipeline / tasks / panes.py View on Github external
pane.configure_unknowns()

    def configure_references(self, info, obj):
        pane = info.ui.context['pane']
        pane.configure_references()


class UnknownsTableConfigurer(TableConfigurer):
    id = 'unknowns_pane'


class ReferencesTableConfigurer(TableConfigurer):
    id = 'references_pane'


class AnalysesPane(TraitsDockPane):
    name = 'Analyses'
    id = 'pychron.pipeline.analyses'

    unknowns_adapter = Instance(UnknownsAdapter)
    unknowns_table_configurer = Instance(UnknownsTableConfigurer, ())

    references_adapter = Instance(ReferencesAdapter)
    references_table_configurer = Instance(ReferencesTableConfigurer, ())

    def configure_unknowns(self):
        self.unknowns_table_configurer.edit_traits()

    def configure_references(self):
        self.references_table_configurer.edit_traits()

    def _unknowns_adapter_default(self):
github NMGRL / pychron / pychron / extraction_line / tasks / extraction_line_pane.py View on Github external
class CanvasDockPane(TraitsDockPane):
    id = 'pychron.extraction_line.canvas_dock'
    name = 'Extraction Line Canvas'
    canvas = Any

    def traits_view(self):
        v = View(UItem('canvas',
                       editor=InstanceEditor(),
                       style='custom',
                       width=500))
        return v


class CryoPane(TraitsDockPane):
    name = 'Cryo'
    id = 'pychron.extraction_line.cryo'

    def traits_view(self):
        v = View(UItem('cryo_manager',
                       editor=InstanceEditor(),
                       style='custom',
                       defined_when='cryo_manager'))
        return v


class GaugePane(TraitsDockPane):
    name = 'Gauges'
    id = 'pychron.extraction_line.gauges'

    def traits_view(self):
github NMGRL / pychron / pychron / lasers / tasks / laser_panes.py View on Github external
icon_button_editor('stage_manager.autocenter_button', 'find',
                                         tooltip='Do an autocenter at the current location',
                                         enabled_when='stage_manager.autocenter_manager.use_autocenter'),
                      label='Calibrated Position',
                      show_border=True)
        hgrp = HGroup(UItem('stage_manager.stop_button'),
                      UItem('stage_manager.home'),
                      UItem('stage_manager.home_option',
                            editor=EnumEditor(
                                name='stage_manager.home_options')))
        tabs = self._get_tabs()
        v = View(VGroup(hgrp, pgrp, tabs))
        return v


class ControlPane(TraitsDockPane):
    name = 'Control'

    movable = False
    closable = True
    floatable = False

    def traits_view(self):
        led_grp = HGroup(UItem('enabled',
                               editor=LEDEditor(colors=['red', 'green']),
                               style='custom',
                               height=-35),
                         UItem('enable', editor=ButtonEditor(label_value='enable_label')))

        status_grp = HGroup(spring, CustomLabel('status_text',
                                                weight='bold',
                                                use_color_background=False,
github NMGRL / pychron / pychron / dashboard / tasks / client / panes.py View on Github external
from traitsui.table_column import ObjectColumn
from pychron.core.ui.custom_label_editor import CustomLabel


class DashboardCentralPane(TraitsTaskPane):
    def traits_view(self):
        url = CustomLabel('url', label='URL')
        v = View(
            VGroup(url,
                   UItem('selected_device',
                         style='custom')))

        return v


class DashboardDevicePane(TraitsDockPane):
    id = 'pychron.dashboard.devices'

    def traits_view(self):
        cols = [CheckboxColumn(name='use'),
                ObjectColumn(name='name', editable=False)]

        editor = TableEditor(columns=cols,
                             selected='selected_device')
        v = View(UItem('devices', editor=editor))
        return v
github NMGRL / pychron / pychron / lasers / tasks / laser_panes.py View on Github external
spring, UItem('object.wait_control.continue_button')),
                      HGroup(Spring(width=-5, springy=False),
                             Item('object.wait_control.current_time', show_label=False,
                                  editor=RangeEditor(mode='slider',
                                                     low=1,
                                                     # low_name='low_name',
                                                     high_name='object.wait_control.duration')),
                             CustomLabel('object.wait_control.current_time',
                                         size=14,
                                         weight='bold')), show_border=True)

        v = View(VGroup(agrp, mgrp, show_border=True), id='pulse', handler=PulseHandler())
        return v


class OpticsPane(TraitsDockPane):
    id = 'pychron.lasers.optics'
    name = 'Optics'

    def traits_view(self):
        v = View(Group(UItem('laser_controller',
                             editor=InstanceEditor(),
                             style='custom'),
                       show_border=True))
        return v


class ClientMixin(object):
    name = Property(depends_on='model')
    id = 'pychron.lasers.client'

    def _get_name(self):
github NMGRL / pychron / pychron / processing / tasks / figures / panes.py View on Github external
v = View(VGroup(
            HGroup(CustomLabel('figures_help', color='maroon'), spring,
                   icon_button_editor('delete_figure_button', 'database_delete',
                                      enabled_when='selected_figures'),
                   Spring(width=-10, springy=False),
                   UItem('figure_kind'),
                   ),
            UItem('figures', editor=TabularEditor(adapter=FigureAdapter(),
                                                  editable=False,
                                                  multi_select=True,
                                                  selected='selected_figures',
                                                  dclicked='dclicked_figure'))))
        return v


class PlotterOptionsPane(TraitsDockPane):
    """
        Pane for displaying the active editor's plotter options manager
    """
    id = 'pychron.processing.figures.plotter_options'

    name = 'Plot Options'
    pom = Any

    def traits_view(self):
        v = View(UItem('pom',
                       editor=InstanceEditor(),
                       style='custom'))
        return v