def traits_view(self): s_grp = HGroup(UItem('source', editor=EnumEditor(name='sources')), UItem('filter_str', editor=myTextEditor(multiline=False, placeholder='Filter Irradiations')), icon_button_editor('clear_filter_button', 'clear')) a_grp = HSplit(Item('available_irradiations', show_label=False, width=0.2, editor=TabularEditor(adapter=ImportNameAdapter(), editable=False, selected='selected', multi_select=True, scroll_to_row='scroll_to_row')), Item('imported_irradiations', show_label=False, width=0.8, editor=TabularEditor(adapter=ImportedNameAdapter(), editable=False))) v = View(VGroup(s_grp, a_grp), kind='livemodal', resizable=True, width=700, buttons=[ImportButton(), 'OK', 'Cancel'], title='Import Irradiations') # v = View(VGroup( # VGroup(HGroup(spring, Item('data_source')), # VGroup(source_grp, # VGroup(HGroup(Item('import_kind', show_label=False), # UItem('open_button', visible_when='import_kind=="rid_list"')), # UItem('text_selected'), # , # label='Results')))), # kind='livemodal', # buttons=['OK', 'Cancel'], # title='Import Irradiations') return v
def traits_view(self): editor = myTextEditor(bgcolor='#F7F6D0', fontsize=10, wrap=False, tab_width=15) v = View(UItem('text', style='custom', editor=editor)) return v
def traits_view(self): v = View(UItem('summary', style='custom', editor=myTextEditor(editable=False, fontsize=14)), title='Summary', width=700, resizable=True) return v
def traits_view(self): cols = [ ObjectColumn(name='name', label='', editable=False), ObjectColumn(name='counts'), ObjectColumn(name='settle', label='Settle (s)'), ObjectColumn(name='isotopes_label', editable=False, width=175, label='Isotopes') ] hgrp = VGroup( UItem('object.hop_sequence.hops', editor=myTableEditor(columns=cols, clear_selection_on_dclicked=True, sortable=False, selected='selected')), HGroup( icon_button_editor('add_hop_button', 'add', tooltip='Add peak hop'), icon_button_editor('remove_hop_button', 'delete', tooltip='Delete selected peak hop', enabled_when='selected'))) sgrp = UItem('selected', style='custom', editor=InstanceEditor()) grp = HSplit(hgrp, sgrp) save_action = Action(name='Save', image=icon('document-save'), enabled_when='object.saveable', action='save') save_as_acion = Action( name='Save As', image=icon('document-save-as'), action='save_as', enabled_when='object.saveasable', ) teditor = myTextEditor(bgcolor='#F7F6D0', fontsize=12, fontsize_name='fontsize', wrap=False, tab_width=15) v = View( VGroup( VGroup(grp, label='Editor'), VGroup(UItem('object.text', editor=teditor, style='custom'), label='Text')), # toolbar=ToolBar(), width=690, title=self.title, buttons=['OK', save_action, save_as_acion], resizable=True) return v
class A(HasTraits): text = Str traits_view = View(UItem('text', editor=myTextEditor(wrap=False, editable=False, tab_width=15, bgcolor='#F7F6D0', fontsize=10)), resizable=True, width=700)
def traits_view(self): cols = [ObjectColumn(name='name', label='', editable=False), ObjectColumn(name='counts'), ObjectColumn(name='settle', label='Settle (s)'), ObjectColumn(name='isotopes_label', editable=False, width=175, label='Isotopes')] hgrp = VGroup( UItem('object.hop_sequence.hops', editor=myTableEditor(columns=cols, clear_selection_on_dclicked=True, sortable=False, selected='selected')), HGroup(icon_button_editor('add_hop_button', 'add', tooltip='Add peak hop'), icon_button_editor('remove_hop_button', 'delete', tooltip='Delete selected peak hop', enabled_when='selected'))) sgrp = UItem('selected', style='custom', editor=InstanceEditor()) grp = HSplit(hgrp, sgrp) save_action = Action(name='Save', image=icon('document-save'), enabled_when='object.saveable', action='save') save_as_acion = Action(name='Save As', image=icon('document-save-as'), action='save_as', enabled_when='object.saveasable', ) teditor = myTextEditor(bgcolor='#F7F6D0', fontsize=12, fontsize_name='fontsize', wrap=False, tab_width=15) v = View(Tabbed(VGroup(grp, label='Editor'), VGroup(UItem('object.text', editor=teditor, style='custom'), label='Text')), # toolbar=ToolBar(), width=690, title=self.title, buttons=['OK', save_action, save_as_acion], resizable=True) return v
def show_summary(self): """ show a summary view for ``spec`` using its ``result`` :return: """ if self.executed_selected: from pychron.core.ui.text_editor import myTextEditor v = View(UItem('summary', style='custom', editor=myTextEditor(editable=False, fontsize=14)), title='Summary', width=900, kind='livemodal', resizable=True) open_view(self.executed_selected[0].result, view=v)
def show_summary(self): """ show a summary view for ``spec`` using its ``result`` :return: """ if self.executed_selected: from pychron.core.ui.text_editor import myTextEditor v = View(UItem('summary', style='custom', editor=myTextEditor(editable=False, fontsize=14)), title='Summary', width=900, kind='livemodal', resizable=True) open_view(self.executed_selected[0].result, view=v)
def traits_view(self): info_grp = HGroup( UItem('selected_branch', editor=EnumEditor(name='branches')), Item('path', style='readonly')) # Item('nanalyses', style='readonly') dir_grp = UItem('path', style='custom', editor=myDirectoryEditor( root_path=paths.workspace_root_dir, dclick_name='dclicked', selected_name='selected', root_path_name='path')) # top = Tabbed(VGroup(UItem('selected_text', # editor=myTextEditor()), # label='Text'), # VGroup(UItem('selected_path_commits', # editor=TabularEditor(adapter=CommitAdapter())), # label='Commits')) right = VGroup( UItem('selected_text', editor=myTextEditor()), VGroup(UItem('selected_path_commits', editor=TabularEditor(editable=False, multi_select=True, selected='selected_commits', adapter=CommitAdapter())), 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())
def traits_view(self): s_grp = HGroup( UItem('source', editor=EnumEditor(name='sources')), UItem('filter_str', editor=myTextEditor(multiline=False, placeholder='Filter Irradiations')), icon_button_editor('clear_filter_button', 'clear')) a_grp = HSplit( Item('available_irradiations', show_label=False, width=0.2, editor=TabularEditor(adapter=ImportNameAdapter(), editable=False, selected='selected', multi_select=True, scroll_to_row='scroll_to_row')), Item('imported_irradiations', show_label=False, width=0.8, editor=TabularEditor(adapter=ImportedNameAdapter(), editable=False))) v = View(VGroup(s_grp, a_grp), kind='livemodal', resizable=True, width=700, buttons=[ImportButton(), 'OK', 'Cancel'], title='Import Irradiations') # v = View(VGroup( # VGroup(HGroup(spring, Item('data_source')), # VGroup(source_grp, # VGroup(HGroup(Item('import_kind', show_label=False), # UItem('open_button', visible_when='import_kind=="rid_list"')), # UItem('text_selected'), # , # label='Results')))), # kind='livemodal', # buttons=['OK', 'Cancel'], # title='Import Irradiations') return v
def traits_view(self): info_grp = HGroup(UItem('selected_branch', editor=EnumEditor(name='branches')), Item('path', style='readonly')) # Item('nanalyses', style='readonly') dir_grp = UItem('path', style='custom', editor=myDirectoryEditor(root_path=paths.workspace_root_dir, dclick_name='dclicked', selected_name='selected', root_path_name='path')) # top = Tabbed(VGroup(UItem('selected_text', # editor=myTextEditor()), # label='Text'), # VGroup(UItem('selected_path_commits', # editor=TabularEditor(adapter=CommitAdapter())), # label='Commits')) right = VGroup(UItem('selected_text', editor=myTextEditor()), VGroup(UItem('selected_path_commits', editor=TabularEditor(editable=False, multi_select=True, selected='selected_commits', adapter=CommitAdapter())), 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())
return s if __name__ == '__main__': from pychron.core.ui.text_editor import myTextEditor from pychron.processing.isotope import Isotope from traitsui.api import View, UItem ig = IsotopeGroup() a40 = Isotope('Ar40', 'H1') a40.set_uvalue((50000.12345, 0.4123412341)) a36 = Isotope('Ar36', 'CDD') a36.set_uvalue((51230.12345 / 295.5, 0.132142341)) a38 = Isotope('Ar38', 'L1') a38.set_uvalue((51230.12345 / 1590.5, 0.132142341)) ig.isotopes = dict(Ar40=a40, Ar36=a36, Ar38=a38) ig.age = 1.143 a = AirResult(runid='1234123-01A', isotope_group=ig) a.tripped_conditional = AutomatedRunConditional('age>10') v = View(UItem('summary', style='custom', editor=myTextEditor(editable=False, fontsize=14)), title='Summary', width=1000, resizable=True) a.configure_traits(view=v) # ============= EOF =============================================
return s if __name__ == '__main__': from pychron.core.ui.text_editor import myTextEditor from pychron.processing.isotope import Isotope from traitsui.api import View, UItem ig = IsotopeGroup() a40 = Isotope('Ar40', 'H1') a40.set_uvalue((50000.12345, 0.4123412341)) a36 = Isotope('Ar36', 'CDD') a36.set_uvalue((51230.12345 / 295.5, 0.132142341)) a38 = Isotope('Ar38', 'L1') a38.set_uvalue((51230.12345 / 1590.5, 0.132142341)) ig.isotopes = dict(Ar40=a40, Ar36=a36, Ar38=a38) ig.age = 1.143 a = AirResult(runid='1234123-01A', isotope_group=ig) a.tripped_conditional = AutomatedRunConditional('age>10') v = View(UItem('summary', style='custom', editor=myTextEditor(editable=False, fontsize=14)), title='Summary', width=1000, resizable=True) a.configure_traits(view=v) # ============= EOF =============================================
def traits_view(self): editor = myTextEditor(bgcolor="#F7F6D0", fontsize=10, wrap=False, tab_width=15) v = View(UItem("text", style="custom", editor=editor), width=500, resizable=True) return v