How to use the traitsui.api.TabularEditor 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 / geo / tasks / panes.py View on Github external
HGroup(
                #Label('Filter'),
                UItem('sample_filter_parameter',
                      editor=EnumEditor(name='sample_filter_parameters')),
                UItem('sample_filter',
                      width=75),
                UItem('sample_filter',
                      editor=EnumEditor(name='sample_filter_values'),
                      width=-25),
                UItem('filter_non_run_samples',
                      tooltip='Omit non-analyzed samples'),
                icon_button_editor('configure_sample_table',
                                   'cog',
                                   tooltip='Configure Sample Table')),
            UItem('samples',
                  editor=TabularEditor(
                      adapter=self.sample_tabular_adapter,
                      editable=False,
                      selected='selected_samples',
                      multi_select=True,
                      dclicked='dclicked_sample',
                      column_clicked='column_clicked',
                      #update='update_sample_table',
                      #refresh='update_sample_table',
                      stretch_last_section=False),
                  width=75))

        grp = VSplit(
            project_grp,
            sample_grp,
            label='Project/Sample')
github NMGRL / pychron / pychron / database / tasks / panes.py View on Github external
HGroup(icon_button_editor('check_status_button', 'database_go_fatcow',
                                                  tooltip='Check slave status. Equivalent to "Show Slave Status"'),
                               icon_button_editor('start_button', 'start',
                                                  tooltip='Start replication. Equivalent to "Start Slave"',
                                                  enabled_when='not running'),
                               icon_button_editor('stop_button', 'stop',
                                                  tooltip='Stop replication. Equivalent to "Stop Slave"',
                                                  enabled_when='running'),
                               icon_button_editor('skip_button', 'skip_occurrence',
                                                  tooltip='Set global skip counter.\n'
                                                          'Equivalent to "Stop Slave;'
                                                          'Set GLOBAL SQL_SKIP_COUNTER=N;Start Slave;"\n'
                                                          'where N is the number of SQL statements to skip'),
                               UItem('skip_count',
                                     tooltip='Number of SQL statements to skip')),
                        UItem('status_items', editor=TabularEditor(adapter=StatusItemsAdapter(),
                                                                   editable=False)),
                        VGroup(UReadonly('last_error',
                                         height=200,
                                         style_sheet='color: red; font-weight: bold'),
                               label='Error',
                               show_border=True),
                        label='Slave',
                        show_border=True))

        v.width = 500
        return v
github NMGRL / pychron / pychron / system_monitor / tasks / panes.py View on Github external
def traits_view(self):
        #cols=[ObjectColumn(name='name'),
        #      ObjectColumn(name='value'),
        #      ObjectColumn(name='last_time_str', label='Time')]
        #editor=TableEditor(columns=cols, editable=False)
        #v=View(UItem('values',
        #             editor=TableEditor(columns=cols, editable=False)))
        editor = TabularEditor(adapter=DashboardTabularAdapter(),
                               auto_update=True,
                               editable=False)

        v = View(UItem('values',
                       editor=editor))
        return v
github MatthieuDartiailh / HQCMeas / measurement / measurement_monitoring.py View on Github external
"""
    """
    monitored_pairs = List(Instance(MonitoredPair))
    monitored_map = Dict(Str, Instance(MonitoredPair))
    monitored_entries = List(Str)
    monitoring_thread = Instance(Thread)
    status = Str
    measure_name = Str

    monitoring_view = View(
                        VGroup(
                            UItem('measure_name', editor = TitleEditor()),
                            HGroup(Label('STATUS'),
                                   UItem('status', style = 'readonly')),
                            UItem('monitored_pairs',
                                  editor = TabularEditor(
                                              adapter = MonitoredPairAdapter(),
                                                operations = ['move'],
                                                selectable = False,
                                                editable = False,
                                                auto_update = True,
                                                auto_resize = True,
                                                drag_move = True),
                                ),
                            ),
                        title = 'Measurement monitor',
                        resizable = True, width = 300,
                        )

    def define_monitored_entries(self, database, parent = None):
        """
        """
github enthought / traitsui / examples / tutorials / traitsui_4.0 / editors / tabular_editor / sm_person_example.py View on Github external
MarriedPerson_age_image = Property
    MarriedPerson_bg_color = Color(0xE0E0FF)
    MarriedPerson_spouse_text = Property
    Person_spouse_text = Constant('')

    def _get_MarriedPerson_age_image(self):
        if self.item.age < 18:
            return 'red_flag'
        return None

    def _get_MarriedPerson_spouse_text(self):
        return self.item.partner.name

#--[Tabular Editor Definition]--------------------------------------------

tabular_editor = TabularEditor(
    adapter=ReportAdapter(),
    operations=['move'],
    images=[ImageResource('red_flag', search_path=search_path)],
)

#--[Report Class]---------------------------------------------------------


class Report(HasTraits):

    people = List(Person)

    view = View(
        Group(
            Item('people', id='table', editor=tabular_editor),
            show_labels=False,
github NMGRL / pychron / pychron / dvc / tasks / panes.py View on Github external
def traits_view(self):
        origin_grp = VGroup(UItem('filter_origin_value',
                                  tooltip='Fuzzy filter list of repositories available at "Origin". '
                                          'e.g. "foo" will match "foo", "foobar", "fobaro", "barfoo", etc'),
                            UItem('repository_names',
                                  editor=TabularEditor(selected='selected_repository',
                                                       column_clicked='origin_column_clicked',
                                                       adapter=OriginAdapter(),
                                                       editable=False)),
                            show_border=True, label='Origin')

        local_grp = VGroup(UItem('filter_repository_value',
                                 tooltip='Fuzzy filter list of repositories available at on this computer. '
                                         'e.g. "foo" will match "foo", "foobar", "fobaro", "barfoo", etc'),
                           UItem('local_names',
                                 editor=TabularEditor(adapter=RepoAdapter(),
                                                      column_clicked='column_clicked',
                                                      selected='selected_local_repositories',
                                                      editable=False,
                                                      multi_select=True,
                                                      )),
                           show_border=True, label='Local')
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
github tvaught / experimental / portfolio_metrics / chaco_mpt_display.py View on Github external
if isinstance(self.item.color, tuple):
            return color_tuple_to_int(self.item.color[:3])
        else:
            return None

class SymbolPoolAdapter(TabularAdapter):

    columns = [('Symbols', 'symbol')]
    column_widths = [30]
    font        = 'Arial 10'
    alignment   = 'left'


symbols_tabular_editor = TabularEditor(adapter=SymbolListAdapter(),
                                    operations=['move'], drag_move=True)
symbol_pool_tabular_editor = TabularEditor(adapter=SymbolPoolAdapter(),
                                    operations=['move'], drag_move=True,
                                    )

class PortfolioModel(HasTraits):


    symbols = List(init_symbols)
    # Test this for now...
    symbols2 = List(Instance(Symbol))
    symbol_pool = List(Instance(Symbol))

    # Arbitrary date range for pulling asset data
    startdate = Str("2000-07-1")
    enddate = Str("2005-12-31")

    dbfilename = File("data/stocks.db")
github enthought / mayavi / mayavi / tools / data_wizards / data_source_wizard.py View on Github external
Item('vector_w', label='w',
                               editor=EnumEditor(name='_data_sources_names',
                                        invalid='_is_not_ok')),
                           enabled_when='has_vector_data',
                       ),
                       label='Vector data',
                       show_border=True,
                   ),

    _array_view = \
                View(
                    Item('_array_label', editor=TitleEditor(),
                        show_label=False),
                    Group(
                    Item('_data_sources_wrappers',
                      editor=TabularEditor(
                          adapter=ArrayColumnAdapter(),
                      ),
                    ),
                    show_border=True,
                    show_labels=False
                ))

    _questions_view = View(
                Item('_top_label', editor=TitleEditor(),
                        show_label=False),
                HGroup(
                    Item('_data_type_text', style='readonly',
                                resizable=False),
                    spring,
                    'data_type',
                    spring,
github NMGRL / pychron / pychron / processing / tasks / interpreted_age / group_dialog.py View on Github external
def traits_view(self):
        v = View(VGroup(HGroup(Item('name')),
                        UItem('projects',
                              editor=TabularEditor(adapter=ProjectAdapter(),
                                                   selected='selected_project',

                                                   editable=False))),
                 buttons=['OK', 'Cancel'], resizable=True,
                 title='Save Interpreted Age Group',
                 width=300)
        return v