home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-10 | 1.9 KB | 63 lines | [TEXT/PJMM] |
- unit InitTheMenus;
-
- {File name: InitTheMenus}
- {Function: Pull in menu lists from a resource file.}
- { This procedure is called once at program start.}
- { AppleMenu is the handle to the Apple menu, it is also}
- { used in the procedure that handles menu events.}
- {History: 6/5/92 Original by Prototyper. }
-
- interface
-
- procedure Init_My_Menus; {Initialize the menus}
-
- var
- AppleMenu: MenuHandle; {Menu handle}
- M_File: MenuHandle; {Menu handle}
- M_Edit: MenuHandle; {Menu handle}
-
- implementation
-
- procedure Init_My_Menus; {Initialize the menus}
- const
- Menu1 = 1001; {Menu resource ID}
- Menu2 = 1002; {Menu resource ID}
- Menu3 = 1003; {Menu resource ID}
- var
- tStr: Str255;
- begin {Start of Init_My_Menus}
- ClearMenuBar; {Clear any old menu bars}
-
- { This menu is the APPLE menu, used for About and desk accessories.}
- tStr := ' ';
- tStr[1] := CHR(appleMark);
- AppleMenu := NewMenu(Menu1, tStr); {Create apple menu }
- AppendMenu(AppleMenu, 'About vListMngr Demo...');
- InsertMenu(AppleMenu, 0); {Insert this menu into the menu bar}
- AddResMenu(AppleMenu, 'DRVR'); {Add in DAs}
-
- M_File := NewMenu(Menu2, 'File');
- AppendMenu(M_File, 'Show Headings/S');
- AppendMenu(M_File, 'Clear Headings/K');
- AppendMenu(M_File, '-');
- AppendMenu(M_File, 'Quit/Q');
- InsertMenu(M_File, 0);
-
- M_Edit := NewMenu(Menu3, 'Edit');
- AppendMenu(M_Edit, 'Edit Cell Data');
- AppendMenu(M_Edit, 'Refresh Cell Data');
- AppendMenu(M_Edit, '-');
- AppendMenu(M_Edit, '(Add Column');
- AppendMenu(M_Edit, '(Delete Column');
- AppendMenu(M_Edit, '-');
- AppendMenu(M_Edit, 'Insert Row');
- AppendMenu(M_Edit, 'Delete Row');
- AppendMenu(M_Edit, '-');
- AppendMenu(M_Edit, 'Frame Cells');
- InsertMenu(M_Edit, 0);
-
- DrawMenuBar; {Draw the menu bar}
-
- end; {End of procedure Init_My_Menus}
-
- end. {End of this unit}