#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# super ( MenuBarTooltipsExample , self ) . __init__ ( ) #NEWLINE# self . _menubar = MenuBar ( ) #NEWLINE# menuCommand = MenuCommand ( self ) #NEWLINE# self . _menubar . setDescription ( 'Perform some actions by selecting them from the menus' ) #NEWLINE# f = self . _menubar . addItem ( 'File' , None ) #NEWLINE# f . setDescription ( 'File menu' ) #NEWLINE# newItem = f . addItem ( 'New' , None ) #NEWLINE# newItem . setDescription ( 'Add a new..' ) #NEWLINE# opn = f . addItem ( 'Open file...' , menuCommand ) #NEWLINE# opn . setDescription ( 'Retrieve a file from the filesystem' ) #NEWLINE# f . addSeparator ( ) #NEWLINE# item = newItem . addItem ( 'File' , menuCommand ) #NEWLINE# item . setDescription ( 'Open a file' ) #NEWLINE# item = newItem . addItem ( 'Folder' , menuCommand ) #NEWLINE# item . setDescription ( 'Open a folder' ) #NEWLINE# item = newItem . addItem ( 'Project...' , view ) #NEWLINE# item . setDescription ( 'Open a project' ) #NEWLINE# item = f . addItem ( 'Close' , menuCommand ) #NEWLINE# item . setDescription ( 'Closes the selected file' ) #NEWLINE# item = f . addItem ( 'Close All' , menuCommand ) #NEWLINE# item . setDescription ( 'Closes all files' ) #NEWLINE# f . addSeparator ( ) #NEWLINE# item = f . addItem ( 'Save' , menuCommand ) #NEWLINE# item . setDescription ( 'Saves the file' ) #NEWLINE# item = f . addItem ( 'Save As...' , menuCommand ) #NEWLINE# item . setDescription ( 'Saves the file with a different name' ) #NEWLINE# item = f . addItem ( 'Save All' , menuCommand ) #NEWLINE# item . setDescription ( 'Saves all files' ) #NEWLINE# edit = self . _menubar . addItem ( 'Edit' , None ) #NEWLINE# edit . setDescription ( 'Edit menu' ) #NEWLINE# item = edit . addItem ( 'Undo' , menuCommand ) #NEWLINE# item . setDescription ( 'Reverses recent changes' ) #NEWLINE# item = edit . addItem ( 'Redo' , menuCommand ) #NEWLINE# item . setEnabled ( False ) #NEWLINE# item . setDescription ( 'Redoes undone changed' ) #NEWLINE# edit . addSeparator ( ) #NEWLINE# item = edit . addItem ( 'Cut' , menuCommand ) #NEWLINE# item . setDescription ( 'Copies the text to the clipboard and removes it' ) #NEWLINE# item = edit . addItem ( 'Copy' , menuCommand ) #NEWLINE# item . setDescription ( 'Copies the text to the clipboard' ) #NEWLINE# item = edit . addItem ( 'Paste' , menuCommand ) #NEWLINE# item . setDescription ( 'Copies the contents of the clipboard on to the document' ) #NEWLINE# edit . addSeparator ( ) #NEWLINE# find = edit . addItem ( 'Find/Replace' , menuCommand ) #NEWLINE# find . setDescription ( 'Find or Replace text' ) #NEWLINE# item = find . addItem ( 'Google Search' , SearchCommand ( self ) ) #NEWLINE# item . setDescription ( 'Search with Google' ) #NEWLINE# find . addSeparator ( ) #NEWLINE# item = find . addItem ( 'Find/Replace...' , menuCommand ) #NEWLINE# item . setDescription ( 'Finds or replaces text' ) #NEWLINE# item = find . addItem ( 'Find Next' , menuCommand ) #NEWLINE# item . setDescription ( 'Find the next occurrence' ) #NEWLINE# item = find . addItem ( 'Find Previous' , menuCommand ) #NEWLINE# item . setDescription ( 'Find the previous occurrence' ) #NEWLINE# view = self . _menubar . addItem ( 'View' , None ) #NEWLINE# view . setDescription ( 'View menu' ) #NEWLINE# item = view . addItem ( 'Show/Hide Status Bar' , menuCommand ) #NEWLINE# item . setDescription ( 'Toggles the visibility of the Status Bar' ) #NEWLINE# item = view . addItem ( 'Customize Toolbar...' , menuCommand ) #NEWLINE# item . setDescription ( 'Add or remove items in the toolbar' ) #NEWLINE# view . addSeparator ( ) #NEWLINE# item = view . addItem ( 'Actual Size' , menuCommand ) #NEWLINE# item . setDescription ( 'Resize view to the original size' ) #NEWLINE# item = view . addItem ( 'Zoom In' , menuCommand ) #NEWLINE# item . setDescription ( 'Zoom the document in by 10%' ) #NEWLINE# item = view . addItem ( 'Zoom Out' , menuCommand ) #NEWLINE# item . setDescription ( 'Zoom the doucment out by 10%' ) #NEWLINE# self . addComponent ( self . _menubar )