How to use the traitsui.api.InstanceEditor 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 / experiment / run_history_view.py View on Github external
def traits_view(self):
        agrp = HGroup(UItem('mass_spectrometer', editor=EnumEditor(name='mass_spectrometers')),
                      Item('n', label='Limit'))

        adapter = AnalysisAdapter()
        adapter.run_history_columns()

        v = View(VSplit(VGroup(agrp,
                               UItem('analyses', editor=TabularEditor(dclicked='selected',
                                                                      editable=False,
                                                                      adapter=adapter))),
                        UItem('analysis_view',
                              visible_when='analysis_view',
                              style='custom', editor=InstanceEditor())),
                 title='Run History',
                 width=700,
                 height=700,
                 resizable=True,
                 buttons=['OK'])
        return v
github pep-pig / Topology-optimization-of-structure-via-simp-method / Python / shorthaircat.py View on Github external
######################
    main_view = View(
                Group(
                              Group(HSplit(HSplit(VSplit(
                              Item(name='engine_view',
                                   style='custom',
                                   resizable=True,
                                   height =500,
                                   width = 200,
                                   show_label=False

                                   ),
                                     ),
                              Item(name='current_selection',
                                   editor=InstanceEditor(),
                                   enabled_when='current_selection is not None',
                                   style='custom',
                                   resizable = True,
                                   height = 500,
                                   width = 200,
                                   springy=True,
                                   show_label=False),
                                   )),label = 'Settings',show_border = False),
                              Group(
                                  Group(

                                      Item(name = 'density_filter',editor = RangeEditor()),
                                      '_',
                                      HSplit(
                                      Item('initial_button', show_label=False),
github enthought / mayavi / examples / mayavi / interactive / mayavi_traits_ui.py View on Github external
# The mayavi engine view.
    engine_view = Instance(EngineView)

    # The current selection in the engine tree view.
    current_selection = Property


    ######################
    view = View(HSplit(VSplit(Item(name='engine_view',
                                   style='custom',
                                   resizable=True,
                                   show_label=False
                                   ),
                              Item(name='current_selection',
                                   editor=InstanceEditor(),
                                   enabled_when='current_selection is not None',
                                   style='custom',
                                   springy=True,
                                   show_label=False),
                                   ),
                               Item(name='scene',
                                    editor=SceneEditor(),
                                    show_label=False,
                                    resizable=True,
                                    height=500,
                                    width=500),
                        ),
                resizable=True,
                scrollable=True
                )
github NMGRL / pychron / pychron / envisage / browser / recall_editor.py View on Github external
def traits_view(self):
        v = View(UItem('analysis_view', style='custom', editor=InstanceEditor()))
        return v
github NMGRL / pychron / pychron / envisage / browser / advanced_filter_view.py View on Github external
def traits_view(self):
        v = okcancel_view(VGroup(icon_button_editor('add_filter_button', 'add'),
                                 UItem('filters', editor=ListEditor(mutable=False,
                                                                    style='custom',
                                                                    editor=InstanceEditor()))),
                          title='Advanced Search',
                          width=700,
                          height=350)
        return v
github enthought / mayavi / tvtk / pyface / ui / wx / scene.py View on Github external
Group(Item(name='background'),
                                  Item(name='foreground'),
                                  Item(name='parallel_projection'),
                                  Item(name='disable_render'),
                                  Item(name='off_screen_rendering'),
                                  Item(name='jpeg_quality'),
                                  Item(name='jpeg_progressive'),
                                  Item(name='magnification'),
                                  Item(name='anti_aliasing_frames'),
                                  Item(name='full_screen',
                                       show_label=False),
                                  ),
                            Group(Item(name='render_window',
                                       style='custom',
                                       visible_when='object.stereo',
                                       editor=InstanceEditor(view=View(_stereo_view)),
                                       show_label=False),
                                  ),
                            label='Scene'),
                         Group( Item(name='light_manager',
                                style='custom', show_label=False),
                                label='Lights'),
                         Group(
                             Item(
                                 name='movie_maker',
                                 style='custom', show_label=False
                             ),
                             label='Movie'),
                         buttons=['OK', 'Cancel']
                        )

    ########################################
github NMGRL / pychron / pychron / hardware / gauges / granville_phillips / micro_ion_controller.py View on Github external
def gauge_view(self):
        v = View(Group(Item('gauges', style='custom',
                            show_label=False,
                            editor=ListEditor(mutable=False,
                                              style='custom',
                                              editor=InstanceEditor())),
                       show_border=True,
                       label=self.display_name))
        return v
github gallantlab / pycortex / cortex / mixer.py View on Github external
self.set(viewpoint=vp, trait_change_notify=False)
        if 'saved_views' in options:
            cPickle.dump(self.saved_views, open(os.path.join(cwd, options['saved_views']), 'w'))

    view = View(
        HGroup(
            Group(
                Item("figure", editor=SceneEditor(scene_class=MayaviScene)),
                Group("mix", "pivot", show_labels=True),
                show_labels=False),
            Group(
                Item('colormap',
                     editor=ImageEnumEditor(values=lut_manager.lut_mode_list(),
                     cols=6, path=lut_manager.lut_image_dir)),
                "fliplut", Item("show_colorbar", label="colorbar"), "vmin", "vmax", "_", 
                Item('datapack', editor=InstanceEditor(name="datavars", editable=False), width=100),
                Item('datavars', editor=ListEditor(style='custom')),
                "_",
                "showlabels", "showrois", Item("reset_btn", show_label=False),
                "_",
                "hide_backfaces",
                "_",
                Item('viewpoint', editor=InstanceEditor(name='saved_views', editable=False), style='custom', 
                    visible_when="len(saved_views) > 0"),
            ),
        show_labels=False),
        resizable=True, title="Mixer")
github enthought / jigna / jigna / editors / factory_mapping.py View on Github external
from jigna.editors.api import IntEditor as JIntEditor, FloatEditor as JFloatEditor, \
    BoolEditor as JBoolEditor, StringEditor as JStringEditor, EnumEditor as JEnumEditor, \
    RangeEditor as JRangeEditor, ListEditor as JListEditor, InstanceEditor as JInstanceEditor

from traitsui.api import TextEditor, RangeEditor, EnumEditor, ListEditor, InstanceEditor, \
    BooleanEditor

class FactoryMapping(object):

    traitsui_to_jigna_editor = {
                          TextEditor: JStringEditor, 
                          RangeEditor: JRangeEditor,
                          EnumEditor: JEnumEditor,
                          ListEditor: JListEditor,
                          InstanceEditor: JInstanceEditor,
                          BooleanEditor: JBoolEditor,
                        }

    trait_to_jigna_editor = {
                       Int: {'simple': JIntEditor},
                       Str: {'simple': JStringEditor},
                       Float: {'simple': JFloatEditor},
                       Range: {'simple': JRangeEditor},
                       Bool: {'simple': JBoolEditor},
                       Enum: {'simple': JEnumEditor},
                       List: {'simple': JListEditor},
                       Instance: {'simple': JInstanceEditor}
                    }

    @classmethod
    def get_editor_factory(cls, obj, item):
github NMGRL / pychron / pychron / pipeline / identify_peak_view.py View on Github external
def traits_view(self):

        v = View(HGroup(Item('threshold')),
                 UItem('peaks', editor=TabularEditor(adapter=PeaksAdapter(),
                                                     selected='selected')),
                 UItem('selected', style='custom', editor=InstanceEditor()),
                 title='Candidate Associations',
                 resizable=True,
                 kind='livemodal',
                 width=500,
                 height=500)
        return v
# ============= EOF =============================================