Re: New style menus
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 09, 2002
- 379 views
Pete, the setEnable() and setVisible() both support the following syntax... setEnable(sequence IDLIST, integer flag) eg. ==code starts == global constant FileMenu = create( Menu, "&File", MAIN, 0,0,0,0,0), FileNew = create( MenuItem, "&New\t(Ctrl N)", FileMenu, 0,0,0,0,0), FileOpen = create( MenuItem, "&Open\t(Ctrl O)", FileMenu, 0,0,0,0,0), FileClos = create( MenuItem, "&Close", FileMenu, 0,0,0,0,0), FileSave = create( MenuItem, "&Save\t(Ctrl S)", FileMenu, 0,0,0,0,0), FileSvAs = create( MenuItem, "Save &As", FileMenu, 0,0,0,0,0), FileSep1 = create( MenuItem, "-", FileMenu, 0,0,0,0,0), FilePrnt = create( MenuItem, "&Print\t(Ctrl P)", FileMenu, 0,0,0,0,0), FileSep2 = create( MenuItem, "-", FileMenu, 0,0,0,0,0), FileExit = create( MenuItem, "E&xit", FileMenu, 0,0,0,0,0), FileMenuIds = {FileNew, FileOpen, FileClos, FileSave, FileSvAs, FilePrnt, FileExit}, . . . global procedure updateMainMenu(atom enable) -- -- Called from files.e to enable/disable most of the main menu when -- some/no open files -- setEnable(FileMenuIds & EditMenuIds & ..., enable) end procedure --------- Cheers, Derek Parnell