Changeset 710 for moxy


Ignore:
Timestamp:
Dec 13, 2011 4:18:04 PM (14 years ago)
Author:
jemian
Message:

a little progress with test7.py

Location:
moxy/trunk/src/test
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified moxy/trunk/src/test/test5.py

    r708 r710  
    3838
    3939
     40class MainGuiHandler ( Handler ):
     41    """ Handler class to perform restructuring action when conditions are met.
     42    """
     43
     44    def object_axes_list_changed ( self, info ):
     45        print "object_axes_list_changed"
     46        print info.object.display_group
     47        #
     48        # Build a Group in info.object.display_group that looks like this table
     49        #
     50        divider = "#"*10
     51        for axis in info.object.axes_list:
     52            divider += "   " + "#"*10
     53        print divider
     54        print "%10s" % "axis",
     55        for axis in info.object.axes_list:
     56            print "  %10s" % axis.name.strip(),
     57        print
     58        print divider
     59        print "%10s" % "number",
     60        for axis in info.object.axes_list:
     61            print "  %10g" % axis.number,
     62        print
     63        print divider
     64
     65    def show_about(self, uinfo):
     66        '''About this application ...'''
     67        print """show this app's AboutBox() dialog ..."""
     68
     69
    4070class Moxy(HasTraits):
    4171    '''
     
    4979    axes_dict = DictStrList(value_trait = TestClass)
    5080    axes_dict = {}
    51     for item in range(1, 6):
     81    for item in range(1, 5):
    5282        name = "example%d" % item
    5383        desc = 'this is example %d' % item
     
    5888   
    5989    display_group = Group(
    60                     UItem( 'axes_dict', style = 'custom' ),
    61                     show_border = True,
    62                     scrollable = True,
    63                     layout = 'tabbed',
    64                 ),
     90        UItem('axes_list', style='custom'),
     91        show_border = True,
     92        scrollable = True,
     93    ),
    6594
    6695    status_label = Str('status:')
     
    73102                          desc = "stop monitoring PVs",
    74103                          action = "undo_watch")
    75     AboutAction = Action(name = 'About', desc='the big advert')
     104    AboutAction = Action(name = 'About', desc='the big advert',
     105                         action = 'show_about')
    76106    QuitAction = Action(name = 'Quit',
    77107                         action = '_on_close')
     
    88118        Menu(name='Tab'),
    89119        # Help: About, -, Help
    90         Menu(Separator(), HelpAction, name='Help'),
     120        Menu(HelpAction, Separator(), AboutAction, name='Help'),
    91121    )
     122   
     123    def reconstructDisplayGroup(self):
     124        pass
    92125
    93126    def connect(self):
     
    102135
    103136    view = View(
     137                Tabbed('axes_list'),
    104138                display_group,
    105139                title="Moxy (development) GUI",
     
    110144                   StatusItem(name = 'status_msg', width = 0.5),
    111145                ],
     146                handler = MainGuiHandler(),
    112147                resizable=True,
    113148                menubar = menubar,
  • TabularUnified moxy/trunk/src/test/test6.py

    r709 r710  
    6565
    6666
    67 class PersonHandler ( Handler ):
     67class ViewHandler ( Handler ):
    6868    """ Handler class to perform restructuring action when conditions are met.
    6969    """
     
    112112        buttons   = [ 'OK' ],
    113113        resizable = True,
    114         handler   = PersonHandler()
     114        handler   = ViewHandler()
    115115    )
    116116
Note: See TracChangeset for help on using the changeset viewer.