Written by Michael Lail Okuma America Corporation Charlotte, NC LOADING INSTRUCTIONS: Input the file "okfile1.mac". When the user picks the File menu the new menu will be loaded. INTRODUCTION: This version of FILE was written to go along with the CoCreate File menu. Most users use basic commands to save (store), open (load), etc. This macro gives users common commands which operates like Windows based programs with using commands such as SAVE, SAVE AS, CLOSE, etc. This macro also remembers the last 4 files one opens for ease of opening files. COMPATABILITY: This macro has been tested uses on: HP-UX 9.xx, 10.xx ME10 Rev. 7.xx, 8.xx IMPLEMENTATION: The interface is implemented as: (1) A FILE menu intended to replace the standard CoCreate FILE_1 menu, (2) A CONFIG FILE menu that allows setting of user preferences for the Filing System, (3) Numerous pop-up ERROR, WARNING and NOTICE boxes, (4) Audible ERROR, WARNING and NOTICE tones, and (5) Modification of the FILE and EXIT screen menus. The FILE MENU: The CONFIG FILE menu: |--------------------| |--------------------| | FILE MENU | 1 | FILE CONFIG | |--------------------| |--------------------| | Goto CONFIG Menu | 2 | TEXT EDITOR | |--------------------| |--------------------| | OPEN | 3 |Builtin | VuePad | |--------------------| |--------------------| | SAVE | 4 | | Vi | |--------------------| |--------------------| | SAVE AS | 5 | ERROR SOUNDS | |--------------------| |--------------------| | CLOSE | 6 | Off | Beep | |--------------------| |--------------------| | | 7 | | Tune | |--------------------| |--------------------| | NEW | 8 | WARNING SOUNDS | |--------------------| |--------------------| | MERGE | 9 | Off | Beep | |--------------------| |--------------------| | Keep Scale|On |Off | 10 | | Tune | |--------------------| |--------------------| | Absolute |On |Off | 11 | NOTICE SOUNDS | |--------------------| |--------------------| | | 12 | Off | Beep | |--------------------| |--------------------| | EXIT | 13 | | Tune | |--------------------| |--------------------| | | 14 | SOUND VOLUME | 1 | |--------------------| |--------------------| | COPY | 15 | SOUND DURATION| .3 | |--------------------| |--------------------| | DELETE | 16 |MESSAGE BOX POSITION| |--------------------| |--------------------| | EDIT FILE | 17 | |Upper Right| |--------------------| |--------------------| | INPUT | 18 |Lower Left| Middle | |--------------------| |--------------------| | GoTo Open Dir | 19 | ERROR MESSAGES | |--------------------| |--------------------| | Previous File #1 | 20 | On | Off | |--------------------| |--------------------| | Previous File #2 | 21 | WARNING MESSAGES | |--------------------| |--------------------| | Previous File #3 | 22 | On | Off | |--------------------| |--------------------| | Previous File #4 | 23 | NOTICE MESSAGES | |--------------------| |--------------------| | FILE_1 | FILE_2| 24 | On | Off | |--------------------| |--------------------| |ASSOC DOC | REV CHK | 25 | WD File Menu | |--------------------| |--------------------| DETAIL DESCRIPTION OF FILE MENU This File menu features a "graying out" effect wherein currently available functions are shown in white text and functions that are not available in the current context are shown in "grayed out" letters. All the filing functions automatically open and close the FILE BROWSER to provide for easy and quick selection of file names as appropriate (however, the user is still free to type filenames in at the command line). Menu Line 1 - FILE MENU This line features manipulation icons for pinning, moving and turning off the menu. Picking on the menu title, FILE MENU, will refresh the menu bringing it up-to-date with the current context. Menu Line 2 - Goto CONFIG Menu Picking this button brings up the configuration screen menu for changing/setting the various user customizable features. Menu Line 3 - OPEN This button is used to OPEN (or load) an ME10 drawing into an empty ME10 session. If a drawing is currently OPEN or geometry exists, the OPEN button is "grayed out" until the the OPENed file is CLOSEd or the existing geometry is deleted (that's what the NEW button is for). If the user does not have write permission to the file to be OPENed, an informational message is given that the file is being OPENed as READ ONLY. In this case, the file is loaded; however, the filename is not recorded as the OPEN filename and the SAVE function is not available, but the SAVE AS function is available. Menu Line 4 - SAVE This button SAVEs (using STORE MI ALL DEL_OLD) the currently OPENed drawing back to the file system using the filename of the currently OPEN drawing. The current ME10 working directory does not matter, as the macro temporarily changes back to the directory from which the file was OPENed before performing the SAVE and then returns to the currently active directory. The SAVE button is only available after a drawing has been OPENed. The SAVE function complains and refuses to write a file if there is nothing in the current drawing in order to avoid accidentally overwriting good data with an empty drawing. Menu Line 5 - SAVE AS This button SAVEs the current drawing to a user specified file name, and makes this new file name the currently OPEN file. The SAVE AS button is always available. The SAVE AS function also refuses to save an empty drawing. If the file for the SAVE AS already exists, a warning tone is issued and the user is asked to confirm the overwriting of the file. If warning messages are turned off, the existing file will be overwritten. SAVE AS issues an error if the user does not have write permission to the specified file or in the specified directory. If the specified file name does not end in ".mi", the macro automatically appends the ".mi" suffix to the filename. The macro also checks for certain "illegal" file name characters that have could cause problems (i.e. filenames with blanks or *, etc.). Menu Line 6 - CLOSE This button is used to SAVE the currently OPENed drawing and then to delete it from the current ME10 session. The CLOSE function calls the SAVE function; all the information on SAVE above applies to CLOSE also. Menu Line 8 - NEW This command deletes everything in the current ME10 session. If a drawing file is currently OPEN, the user is asked if they would like to first CLOSE (i.e. save) the currently OPEN drawing first. If warning messages are turned off, the geometry is deleted. If there is existing geometry (but not an OPEN file), the user is asked if they want to continue and delete the geometry. If warning messages are turned off, the deletion is done without warning. The NEW button is always available. Menu Lines 9 - 11: MERGE The MERGE button, LOAD SUBPART, is used to load a drawing as a subpart of the currently active part into the current drawing. The MERGE button is only available when the current ME10 session is not empty. As usual, the macro warnes if the specified file does not exist or is not readable. If the user clicks the Keep Scale option to ON, it makes the new part load with the drawing scale it was stored with. This option must be set before the filename is specified. If the Absolute option is set to On, the part will be loaded at its absolute position. If the Absolute option is left Off, the user can either interactively place the loaded part or click Absolute to On to load it at its absolute position. Menu Line 13: EXIT This button is used to EXIT from ME10. It calls the NEW function, so the user is warned if a file is OPEN or if geometry exists. If the warning messages are turned off, the ME10 program is terminated with extreme predujice. Menu Line 15: COPY The COPY button is used to copy a file. It issues a warning message before overwriting an existing file. Menu Line 16: DELETE The DELETE button is used to delete a file. A warning message will appear if the user does not have permissions to delete the file. When deleteing a file a verification will be nessacary before performing the deletion of a file. Menu Line 17: EDIT FILE The EDIT FILE button loads the selected file into the selected text editor. This command will issue a warning message if the file is "read only". Menu Line 18: INPUT The INPUT button is used to INPUT a macro file into ME10. Menu Line 19: GoTo Open Dir This button makes the current ME10 working directory be the directory from which the currently OPENed drawing was OPENed. This button is only available if a drawing is currently OPEN. Menu Lines 20 - 23: Last Four Opened Files If the ME10 session is empty and there is no OPEN drawing, these buttons can be used to quickly OPEN any of the last four OPENed files. The file ".me10_hist" in the user's home directory, in UNIX, or a tmp directory in Windows, is used to store the previously OPENed filenames and directories between ME10 sessions. If the file does exist, it needs to be readable and writeable by the user. The list of files are sorted so the currently OPEN file is at the top of the list. The macro will create this "history" file if it does not exist. Menu Lines 24 - 25: Access to Standard CoCreate File Screen Menus NOTE: The SAVE button on the CoCreate FILE 1 menu has been blanked out to avoid confusion. DETAIL DESCRIPTION OF FILE CONFIG Menu TEXT EDITOR - If the VuePad or Vi editors are selected, the EDIT FILE button will spawn a separate process with its own window for the editing so that the user is free to keep the editor open and continue to use ME10. SOUND VOLUME and SOUND DURATION - These settings only effect the "Tune" sounds, NOT the "Beep" sound. The range for volume is from 0 to 1. The sound duration is on the order of magnitude of seconds.