How to use the traitsui.api.EnumEditor 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 / entry / tasks / sample / project_optionals_view.py View on Github external
def traits_view(self):
        lc_grp = HGroup(UItem('lock_project_lab_contact',
                              label='Lab Contact',
                              tooltip='Prevent Lab Contact from being automatically cleared'),
                        Item('project_lab_contact',
                             editor=EnumEditor(name='lab_contacts')))

        i_grp = HGroup(UItem('lock_project_institution',
                             tooltip='Prevent Institution from being automatically cleared'),
                       Item('project_institution', label='Institution'))

        c_grp = HGroup(UItem('lock_project_comment',
                             tooltip='Prevent Comment from being automatically cleared'),
                       VGroup(UItem('project_comment', style='custom'), label='Comment', show_border=True))
        v = View(VGroup(lc_grp, i_grp, c_grp),
                 buttons=['OK', 'Cancel'],
                 resizable=True,
                 title='Set Optional Project Values')
        return v
github bpteague / cytoflow / cytoflowgui / preferences.py View on Github external
#### 'PreferencesPane' interface ##########################################

    # The factory to use for creating the preferences model object.
    model_factory = CytoflowPreferences

    #### 'AttractorsPreferencesPane' interface ################################

    task_map = Dict(Str, Unicode)

    view = View(
        VGroup(HGroup(Item('always_use_default_layout'),
                      Label('Always use the default active task on startup'),
                      show_labels = False),
               HGroup(Label('Default active task:'),
                      Item('default_task',
                           editor=EnumEditor(name='handler.task_map')),
                      enabled_when = 'always_use_default_layout',
                      show_labels = False),
               label='Application startup'),
        resizable=True)

    ###########################################################################
    # Private interface.
    ###########################################################################

    def _task_map_default(self):
        return dict((factory.id, factory.name)
                    for factory in self.dialog.application.task_factories)
github MatthieuDartiailh / HQCMeas / hqc_meas / tasks / lock_in_measure_task.py View on Github external
"""
    selected_mode = Str(preference = True)
    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 / find_references_config.py View on Github external
'Blank Cocktail', 'Blank',
                                                                    'Air', 'Cocktail'])),
                               show_border=True,
                               label='Analysis Types'),
                        VGroup(UItem('mass_spectrometers', style='custom',
                                     editor=CheckListEditor(name='available_mass_spectrometers')),
                               show_border=True,
                               label='Mass Spectrometers'),
                        VGroup(UItem('extract_devices', style='custom',
                                     editor=CheckListEditor(name='available_extract_devices')),
                               show_border=True,
                               label='Extract Devices'),
                        VGroup(UItem('irradiations', style='custom',
                                     editor=CheckListEditor(name='available_irradiations')),
                               Item('monitor_sample',
                                    editor=EnumEditor(name='monitor_samples')),
                               show_border=True,
                               label='Monitors'),
                        Item('replace', label='Replace analyses used to find the references with the references'),
                        Item('threshold', label='Threshold (hrs)')),

                 title='Configure Find References',
                 buttons=['OK', 'Cancel'],
                 kind='livemodal')

        return v
github NMGRL / pychron / pychron / hardware / newport / newport_axis.py View on Github external
def full_view(self):
        '''
        '''

        encoder_group = Group(Item('encoder_resolution'),
                              Item('encoder_full_step_resolution'),
                              Item('microstep_factor'),
                              label='Encoder'
                              )
        general_group = Group(Item('name', style='readonly'),
                              Item('id', style='readonly'),
                              Item('kind', editor=EnumEditor(values=KINDS)),
                              Item('units', editor=EnumEditor(values=UNITS)),
                              Item('sign', editor=EnumEditor(values=SIGNS)),
                              Item('trajectory_mode', editor=EnumEditor(values=TRAJECTORY_MODES)),
                              encoder_group,
                              label='General')
        motor_group = Group(Item('average_motor_voltage'),
                            Item('maximum_motor_current'),
                            Item('gear_constant'),
                            Item('tachometer_gain'),
                            label='Motor')

        home_group = Group(Item('home_search_mode', editor=EnumEditor(values=HOME_SEARCH_MODES)),
                           Item('home_search_low_speed'),
                           Item('home_search_high_speed'),
                           label='Home',
                           )

        pid_group = Group(Item('proportional_gain'),
                          Item('integral_gain'),
github mne-tools / mne-python / mne / gui / _coreg_gui.py View on Github external
def _make_view_coreg_panel(scrollable=False):
    """Generate View for CoregPanel."""
    view = View(VGroup(
        # Scaling
        HGroup(Item('n_scale_params', label='Scaling mode',
                    editor=EnumEditor(values={0: '1:None',
                                              1: '2:Uniform',
                                              3: '3:3-axis'})), Spring()),
        VGrid(Item('scale_x', editor=laggy_float_editor_scale,
                   show_label=True, tooltip="Scale along right-left axis (%)",
                   enabled_when='n_scale_params > 0', width=_SCALE_WIDTH),
              Item('scale_x_dec', enabled_when='n_scale_params > 0',
                   width=_INC_BUTTON_WIDTH),
              Item('scale_x_inc', enabled_when='n_scale_params > 0',
                   width=_INC_BUTTON_WIDTH),
              Item('scale_step', tooltip="Scaling step (%)",
                   enabled_when='n_scale_params > 0', width=_SCALE_STEP_WIDTH),
              Spring(),

              Item('scale_y', editor=laggy_float_editor_scale, show_label=True,
                   enabled_when='n_scale_params > 1',
                   tooltip="Scale along anterior-posterior axis (%)",
github NMGRL / pychron / pychron / furnace / tasks / nmgrl / panes.py View on Github external
def traits_view(self):
        canvas_grp = VGroup(
            HGroup(UItem('stage_manager.stage_map_name', editor=EnumEditor(name='stage_manager.stage_map_names')),
                   spring),
            UItem('stage_manager.canvas', style='custom', editor=ComponentEditor()))

        v = View(VGroup(UItem('graph', style='custom'), canvas_grp))
        return v
github NMGRL / pychron / pychron / processing / tasks / query / panes.py View on Github external
def _query_edit_view(self):
        v = View(HGroup(
            UItem('parameter',
                  editor=EnumEditor(name='parameters')),
            UItem('comparator',
                  editor=EnumEditor(name='comparisons')),
            UItem('criterion'),
            UItem('criterion',
                  width=-25,
                  editor=EnumEditor(name='criteria'))),
                 height=125)
        return v
github mne-tools / mne-python / mne / gui / _kit2fiff_gui.py View on Github external
Item('hsp_file', label='Digitizer\nHead Shape',
                           tooltip=tooltips['hsp_file']),
                      Item('hsp_fname', show_label=False, style='readonly'),
                      Item('fid_file', label='Digitizer\nFiducials',
                           tooltip=tooltips['fid_file']),
                      Item('fid_fname', show_label=False, style='readonly'),
                      Item('reset_dig', label='Clear Digitizer Files',
                           show_label=False),
                      Item('use_mrk', editor=use_editor, style='custom',
                           tooltip=tooltips['use_mrk']),
                      label="Sources", show_border=True),
               VGroup(Item('misc_chs_desc', label='MISC Channels',
                           style='readonly'),
                      Item('stim_slope', label="Event Onset", style='custom',
                           tooltip=tooltips['stim_slope'],
                           editor=EnumEditor(
                               values={'+': '2:Peak (0 to 5 V)',
                                       '-': '1:Trough (5 to 0 V)'},
                               cols=2)),
                      Item('stim_coding', label="Value Coding", style='custom',
                           editor=EnumEditor(values={'>': '1:little-endian',
                                                     '<': '2:big-endian',
                                                     'channel': '3:Channel#'},
                                             cols=3),
                           tooltip=tooltips["stim_coding"]),
                      Item('stim_chs', label='Channels', style='custom',
                           tooltip=tooltips["stim_chs"],
                           editor=TextEditor(evaluate_name='stim_chs_ok',
                                             auto_set=True)),
                      Item('stim_chs_comment', label='Evaluation',
                           style='readonly', show_label=False),
                      Item('stim_threshold', label='Threshold',
github enthought / mayavi / tvtk / tools / tvtk_doc.py View on Github external
# List of available class names as strings.
    available = List(TVTK_CLASSES)

    ########################################
    # Private traits.

    finder = Instance(DocSearch)

    n_completion = Int(25)

    ########################################
    # View related traits.

    view = View(Group(Item(name='class_name',
                           editor=EnumEditor(name='available')),
                      Item(name='class_name',
                           has_focus=True
                           ),
                      Item(name='search',
                           editor=TextEditor(enter_set=True,
                                             auto_set=False)
                           ),
                      Item(name='clear_search',
                           show_label=False),
                      Item('_'),
                      Item(name='completions',
                           editor=ListEditor(columns=3),
                           style='readonly'
                           ),
                      Item(name='doc',
                           resizable=True,