How to use the traitsui.api.UItem function in traitsui

To help you get started, we’ve selected a few traitsui 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 / git_archive / views.py View on Github external
def traits_view(self):
        v = okcancel_view(VGroup(Item('name'),
                                 VGroup(UItem('message', style='custom'),
                                        show_border=True, label='Message')),
                          width=400,
                          title='New Tag')

        return v
github NMGRL / pychron / pychron / pipeline / editors / flux_results_editor.py View on Github external
width=75),
                    column(name='jerr',
                           format_func=sciformat,
                           label=PLUSMINUS_ONE_SIGMA,
                           width=75),
                    column(name='percent_pred_error',
                           label='%',
                           format_func=ff),
                    column(name='dev', label='dev',
                           format='%0.2f',
                           width=70)]

        unk_editor = TableEditor(columns=unk_cols, sortable=False,
                                 reorderable=False)

        pgrp = VGroup(HGroup(UItem('monitor_positions', editor=MONITOR_EDITOR),
                             show_border=True, label='Monitors'),
                      HGroup(UItem('unknown_positions', editor=unk_editor),
                             show_border=True, label='Unknowns'),
                      label='Tables')

        ggrp = UItem('graph', style='custom')
        tgrp = HGroup(UItem('recalculate_button'),
                      Item('min_j', format_str='%0.4e',
                           style='readonly',
                           label='Min. J'),
                      Item('max_j',
                           style='readonly',
                           format_str='%0.4e', label='Max. J'),
                      Item('percent_j_change',
                           style='readonly',
                           format_func=floatfmt,
github NMGRL / pychron / pychron / experiment / melting_point_calibrator.py View on Github external
def traits_view(self):
        tgrp = HGroup(UItem('execute', editor=ButtonEditor(label_value='execute_label')), UItem('setpoint'))
        ggrp = VGroup(UItem('graph', style='custom'))

        v = View(VGroup(tgrp, ggrp), resizable=True, title='Melting Point Calibration')
        return v
github NMGRL / pychron / pychron / entry / tasks / sample_prep / panes.py View on Github external
def traits_view(self):
        wgrp = HGroup(UItem('worker', editor=EnumEditor(name='workers')),
                      icon_button_editor('add_worker_button', 'add', tooltip='Add a new worker'),
                      show_border=True, label='Worker')
        sgrp = HGroup(UItem('session', editor=EnumEditor(name='sessions')),
                      icon_button_editor('add_session_button', 'add',
                                         tooltip='Add a new session for this worker'),
                      icon_button_editor('edit_session_button', 'application-form-edit',
                                         enabled_when='session',
                                         tooltip='Edit session'),
                      enabled_when='worker',
                      show_border=True, label='Session')
        v = View(VGroup(wgrp, sgrp))
        return v
github NMGRL / pychron / pychron / lasers / tasks / laser_panes.py View on Github external
def traits_view(self):
        agrp = VGroup(HGroup(Item('power', tooltip='Hit Enter for change to take effect'),
                             Item('units', style='readonly', show_label=False),
                             spring,
                             Item('duration', label='Duration (s)', tooltip='Set the laser pulse duration in seconds'),
                             Item('pulse_button',
                                  editor=ButtonEditor(label_value='pulse_label'),
                                  show_label=False,
                                  enabled_when='enabled')))
        mgrp = VGroup(HGroup(Spring(width=-5, springy=False),
                             Item('object.wait_control.high', label='Set Max. Seconds'),
                             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
github MatthieuDartiailh / HQCMeas / hqc_meas / tasks / lock_in_measure_task.py View on Github external
waiting_time = Float(preference = True)

    driver_list = ['SR7265-LI', 'SR7270-LI', 'SR830', 'ZI_HF2LI']

    task_database_entries = {'x' : 1.0}

    task_view = View(
                    VGroup(
                        UItem('task_name', style = 'readonly'),
                        Group(
                            Label('Driver'), Label('Instr'), Label('Mode'),
                            Label('Wait (s)'),
                            UItem('selected_driver',
                                editor = EnumEditor(name = 'driver_list'),
                                width = 100),
                            UItem('selected_profile',
                                editor = EnumEditor(name = 'profile_list'),
                                width = 100),
                            UItem('selected_mode',
                                editor = EnumEditor(values = ['X', 'Y', 'X&Y',
                                                              'Amp', 'Phase',
                                                              'Amp&Phase']),
                                width = 100),
                            UItem('waiting_time',
                                  tooltip = fill('Time to wait before querying\
                                          values from the lock-in', 80),
                                ),
                            columns = 4,
                            show_border = True,
                            ),
                        ),
                     )
github NMGRL / pychron / pychron / envisage / browser / sample_view.py View on Github external
def _configure_analysis_type_filter_button_fired(self):
        grp = BorderHGroup(UItem('use_analysis_type_filtering',
                                 tooltip='Enable Analysis Type filter',
                                 label='Enabled'),
                           spring,
                           UItem('_analysis_include_types',
                                 enabled_when='use_analysis_type_filtering',
                                 style='custom',
                                 editor=CheckListEditor(cols=5,
                                                        name='available_analysis_types')),
                           visible_when='analysis_types_visible',
                           label='Analysis Types')
        v = okcancel_view(grp,
                          height=150,
                          title='Configure Analysis Type Filter')
        info = self.edit_traits(view=v)
        if info.result:
            self.model.refresh_samples()
github NMGRL / pychron / pychron / pipeline / tasks / panes.py View on Github external
def traits_view(self):
        v = View(UItem('object.repositories', editor=myTabularEditor(adapter=RepositoryTabularAdapter(),
                                                                     editable=False,
                                                                     multi_select=True,
                                                                     refresh='object.refresh_needed',
                                                                     selected='object.selected_repositories')),
                 handler=RepositoryPaneHandler())
        return v
github NMGRL / pychron / pychron / lasers / tasks / laser_panes.py View on Github external
def traits_view(self):
        pos_grp = VGroup(UItem('move_enabled_button'),
                         VGroup(HGroup(Item('position'),
                                       UItem(
                                           'object.stage_manager.stage_map_name',
                                           editor=EnumEditor(
                                               name='object.stage_manager.stage_map_names')),
                                       UItem('stage_stop_button')),
                                Item('x',
                                     editor=RangeEditor(low=-25.0, high=25.0)),
                                Item('y',
                                     editor=RangeEditor(low=-25.0, high=25.0)),
                                Item('z',
                                     editor=RangeEditor(low=-25.0, high=25.0)),
                                enabled_when='_move_enabled'),
                         label='Positioning')

        # ogrp = Group(UItem('optics_client', style='custom'),
        #              label='Optics')
        # cgrp = Group(UItem('controls_client', style='custom'),
github NMGRL / pychron / pychron / loading / load_view_selection.py View on Github external
def traits_view(self):
        grp = VGroup(UItem('load_name', editor=EnumEditor(name='loads')),
                     HGroup(UItem('selection_str'), UItem('select_all_button')),
                     HGroup(UItem('canvas',
                                  editor=ComponentEditor(),
                                  style='custom'),
                            UItem('selected_positions', editor=TabularEditor(adapter=PositionsAdapter()))))
        v = View(grp, title='Load Selection',
                 kind='livemodal',
                 resizable=True,
                 buttons=[AppendAction(), ReplaceAction(), 'Cancel'])
        return v