home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / util / foxutili.sit / FoxMenus < prev    next >
Text File  |  1989-01-17  |  6KB  |  91 lines

  1. Ñ General Instructions
  2.  
  3. ╩╩FoxMenus takes a file with MENU resources and builds a FoxBase program file to create those menus. If you don't understand what that means I guarantee that this program is of no conceivable use to you. Otherwise, read on...
  4.  
  5.  
  6. Ñ How to print these instructions
  7.  
  8. ╩╩If you open this Application as a document in Microsoft Word (or any program or desk accessory capable of opening arbitrary documents) it will appear to be just these instructions.  They can then be formatted and printed in whatever way you wish.  In MS-Word, hold down the shift key while you select 'Open╔' from the 'File' menu.  In McSink, hold down the Option key.  (Don't try to save text into this program, though, or you'll break it!)  Alternatively, you can change the Type of this file to 'TEXT' and open it with any word processor (but remember to change it back, or the program won't work).
  9.  
  10.  
  11. Ñ How to use FoxMenus
  12.  
  13. ╩╩When FoxMenus starts up it will ask for a menu resource file. You can give it any file with MENU resources- Mac program, rez output, ResEdit file, whatever. If you give it a file without any menus if will tell you so, and let you try again. Then it will ask you for the name of the FoxBase program file you want to create. It suggests "SetUpMenus.prg" (and I recommend that you use that) but you can choose any name. The "Cancel" button will go back to the Finder.
  14.  
  15. ╩╩You have two choices for naming the arrays created by FoxMenus. They can be named just like the title of the menu they contain, or they can be of the form "m1", "m2", "m3", etc. In addition, you may choose to prefix all array names (including the menubar array) with two underscores. You should only do this if you think the names of the arrays will conflict with other variables in your FoxBase program.
  16.  
  17.  
  18. Ñ Which menu features are supported and which are not?
  19.  
  20. ╩╩You may include any item mark you like, any command key, and any icon (but don't forget to move the icon into the FoxBase or FoxUser file). You may specify one font style (bold, italic, underline, outline, or shadow). You may disable any individual menu item or an entire menu.
  21.  
  22. ╩╩You may not create hierarchical menus. FoxMenus won't mind, but FoxBase doesn't support this yet and there's no telling what would happen when you tried to use the program.
  23.  
  24.  
  25. Ñ Error Handling
  26.  
  27. ╩╩FoxMenus will always generate legal array names. If the menu title is "Very, very long menu" the array name for that menu will be "very__very". The rules are: A leading capital letter is converted to lowercase. A leading non-alpha character is converted to an underscore. All characters not in {A-Z, a-z, 0-9, and "_"} are converted to an underscore. All names are truncated to ten characters.
  28.  
  29. ╩╩This means that if your menus are not unique in the first ten characters (or eight, if you are using the underscore prefix option) the code generated will not work properly. You can either edit the code into an acceptable format, or just use the "m1" style array names.
  30.  
  31. ╩╩Generally, if there is a Mac error, it will be reported as a number. FoxMenus will then try to close any open file and quit to the Finder. If you open a file with a very large resource map, FoxMenus may crash or behave badly. This should never be a problem because you will generally be using files which only contain a handful of MENU resources. If this happens, though, just increase the MultiFinder partition size and it should run fine.
  32.  
  33. ╩╩If you create such a huge number of menus that the output file size is greater than about 30K, FoxMenus may crash, produce bad output, or otherwise behave badly. Since I've never seen a file come within a sixth that size, I don't expect this problem to come up.
  34.  
  35. ╩╩If you get a "Fatal Error -9999" that means that you ran out of disk space or your disk has some other problem. This is NOT a bug in FoxMenus.
  36.  
  37.  
  38. Ñ Format of the output file
  39.  
  40. ╩╩The program file generated will look like this:
  41.  
  42. * SetUpMenus
  43. * Created by FoxMenus on Wed, Oct 19, 1988 at 3:22 PM
  44.  
  45. Public menubar({number of menus}),╩{list of menu arrays}
  46.  
  47. menubar(1) = "First menu title"
  48. firstmenu(1) = "First Item"
  49. firstmenu(2) = "Second Item"
  50. etc.
  51.  
  52. menubar(2) = "Second menu title"
  53. etc.
  54.  
  55. Menu Bar menubar
  56. Menu 1, firstmenu
  57. Menu Off 1,4
  58. Menu Off 1,7
  59. etc.
  60. Menu 2, secondmenu
  61. Menu Off 2
  62. etc.
  63.  
  64. Return
  65.  
  66. -----
  67.  
  68. ╩╩The array of menu titles is always called "menubar". It will be dimensioned to however many menus there are. Please note that the arrays are declared as PUBLIC. This is convenient since you may often want to alter menus within your program, but be aware of potential variable name conflicts.
  69.  
  70.  
  71. Ñ How do I build menu resource files?
  72.  
  73. ╩╩There are many tools you can use. There are a number of public domain programs available. ResEdit has a poor but working menu builder, and there is a very nice add-in for ResEdit that makes it do menus very well. It is called ResMENU, and it was written by Alan T. Goates. This Freeware is available from places like CompuServe, Genie, or by Arpa FTP. You can also use Rez, but why bother?
  74.  
  75.  
  76. Ñ The Future
  77.  
  78. ╩╩There is no future for this program. Unlike FoxBinder, it is a stopgap measure. Eventually Fox Software will provide direct support for resources in the future --  not just menus, but windows, code, browse configurations, etc. Until then, this should make life a little easier.  To make life a lot easier, get a copy of my "MenuChange XCMD installer".  It creates an XCMD which allows FoxBase programmers to alter, add, or delete menus on the fly, much more quickly than can be done using FoxBase's "Menu" commands.
  79.  
  80.  
  81. Ñ Revision History
  82.  
  83. ╩╩Version 1.1 - First general release.  Better window placement.  Compiled with LSP 2.0.
  84.  
  85.  
  86. Ñ Credits
  87.  
  88. ╩╩Without Think's Lightspeed Pascal, this would have been written in assembler. It might have been available by 1990.
  89. ╩╩Without Fox Software's FoxBase+/Mac, I might still be using Omnis or 4D. I might be insane by 1990...
  90. ╩╩Thanks to both companies.
  91.