<s> from libtimesheet . ApplicationConstants import Notification <EOL> from pyjamas . ui . MenuBar import MenuBar <EOL> from pyjamas . ui . MenuItem import MenuItem <EOL> from pyjamas . ui . VerticalPanel import VerticalPanel <EOL> class Menu ( MenuBar ) : <EOL> def __init__ ( self ) : <EOL> try : <EOL> MenuBar . __init__ ( self , vertical = False ) <EOL> self . mFileOpen = MenuCmd ( ) <EOL> self . mFileSaveAs = MenuCmd ( ) <EOL> self . mFilePreferences = MenuCmd ( ) <EOL> self . mViewEdit = MenuCmd ( ) <EOL> self . mViewSummary = MenuCmd ( ) <EOL> self . mHelpContents = MenuCmd ( ) <EOL> self . mHelpAbout = MenuCmd ( ) <EOL> menuFile = MenuBar ( vertical = True ) <EOL> menuFile . addItem ( "<STR_LIT>" , self . mFileOpen ) <EOL> menuFile . addItem ( "<STR_LIT>" , self . mFileSaveAs ) <EOL> menuFile . addItem ( "<STR_LIT>" , self . mFilePreferences ) <EOL> self . addItem ( MenuItem ( "<STR_LIT>" , menuFile ) ) <EOL> menuView = MenuBar ( vertical = True ) <EOL> menuView . addItem ( "<STR_LIT>" , self . mViewEdit ) <EOL> menuView . addItem ( "<STR_LIT>" , self . mViewSummary ) <EOL> self . addItem ( MenuItem ( "<STR_LIT>" , menuView ) ) <EOL> menuHelp = MenuBar ( vertical = True ) <EOL> menuHelp . addItem ( "<STR_LIT>" , self . mHelpContents ) <EOL> menuHelp . addItem ( "<STR_LIT>" , self . mHelpAbout ) <EOL> self . addItem ( MenuItem ( "<STR_LIT>" , menuHelp ) ) <EOL> except : <EOL> raise <EOL> class MenuCmd : <EOL> def setHandler ( self , handler ) : <EOL> self . handler = handler <EOL> def execute ( self ) : <EOL> self . handler ( ) </s>
