TweetFollow Us on Twitter

Hierarchical
Volume Number:3
Issue Number:8
Column Tag:Macintosh II

Hierarchical Menus

By Steven Sheets, Hoffman Estates, IL

MenuFun: Macintosh // Menu Manager

Like most of the toolbox managers, the Menu Manager of the Macintosh // has undergone several enhancements and improvements. The Apple Menu is automatically multicolored (like the Apple logo) on any color monitor, while every portion of the menu bar and menus can be displayed in any RGB color by the program. Menus can now include Hierarchical Menus. These Hierarchical menus (sometimes called Cascading Menus or Submenus, or Nested menus ) can have menus within menus within menus, up to 5 levels of depth. This article will show you how to include Hierarchical and Color Menus in your own program.

The Menu Manager programmers have implemented the new features in a exceptionally intelligent way. Of course the new Menu Manager is backwardly compatible so that all the old programs will run their menus correctly, however the new features can be added to a program that will run on either the old or new Manager. Color can added without any new Tool Box calls (though there are a few new ones for Mac // only programs). By adding certain resources, which the new Menu Manager looks for and uses, the Menus will be displayed in color. Of course these resources are ignored by the old Menu Manager. Thus Color Menus will be automatically used when the program is running on a Mac //, and will not be used when it runs on the Mac Plus or SE. The use of Hierarchical Menus are even more universal. Not only do they function on the Mac //, but Hierarchical Menus have been implement into the latest System/Finder (ie. they run on the Mac Plus and/or SE). Programs using Hierarchical menus can be written without having to worry about what machine the program will run on.

Documenting Programs

The new system file does have an impact on documenting programs however. The capture menu script used to restore the ability to capture pulled down menus with cmd-shift-3 only partially works with the new system. The figures in this article were captured using it, but only after cleaning them up. The little arrow character is not correctly displayed when the menu capture resource is installed, and in fact, the menu manager pretty much gets clobbered so don’t try to use it except on a floppy system dedicated to that purpose. Another interesting change is that cmd-shift-3, which captures the screen in a paint document, only works in black and white 2-bit mode. If you try to capture a color display, it beeps!

[This is a good place for the Editor to begin his editorial Apple bashing about how none of Apple’s programs (paint, draw, write, project and terminal) have ever been upgraded for new system features. The ‘ole Do as I say, not as I do syndrome. Since Apple has announced upgrades of these products, it will be interesting next month to see if they work any differently. In any case, the very useful menu capture facility, removed with the 128K ROMS, is nearly dead and buried now, and that is a shame, since it was very useful for this article, even if it didn’t really work correctly. For anyone wondering what to write about or develop, a new screen capture function that handles both nested menus and color would be very nice. -Ed]

Fig. 1 Hierarchal Menus

RGB Color

First a quick review of Macintosh // RGB color is needed. Unlike the old Quickdraw color where only 8 colors are available, the new Macintosh // Quickdraw allows 16,777,216 colors. The new Color Quickdraw does this by using the new record type RGBColor to define exactly what color is being used (to draw, erase, fill, etc.). The format of RGBColor is:

TYPE
 RGBColor = RECORD
 red  : INTEGER;
 green  : INTEGER;
 blue : INTEGER;
 END;

The three unsigned 16-Bit integer values in the RGBColor record defines the intensity values for the 3 additive primary colors (Red, Green, Blue). Since values of each primary colors are in the range 0 to 65535, hex notation is usually easier to work with. For example the values ($FFFF,$0,$0) gives a solid red RGB color. White is ($FFFF,$FFFF,$FFFF), Black is ($0,$0,$0), medium Gray is ($7FFF,$7FFF,$7FFF) and Yellow is ($FFFF,$FFFF,$0).

Remember that the display device (monitor, printer, etc.) that is being used defines what actual color is displayed. When some drawing is done in a specific RGB color, the output device tries to match the closest specific color it has to draw with. Most devices (like the Apple Video Card/Monitor) can display any of the range of 16,777,216 colors, but can only display so many at a given time. For example the Apple Video Card/Monitor, can either display 16 or 256 colors depending on how much memory is on the card. So subtle differences in colors can sometimes be lost on monitors, especially if many colors are being displayed at the same time.

Color Menus

As stated, all parts of the menu bar and menus can be displayed in any RGB color. These parts include each Menu (Title and Background color) and each Menu Item (Title, Mark, Command Key and Background color). The information for what color to draw each menu part is not stored in the MenuHandle nor the MenuList, but in a new data structure, the Menu Color Information Table (or MCIT). The MCIT is created by the InitMenu call of the Mac // Menu Manager, and is modified by subsequential Menu Manager calls. The MCIT contains 1 or more Menu Color Entries. There are different types of entries, but they all have the following format:

TYPE
 MCInfoRec = RECORD
 MenuID : INTEGER;
 MenuItem : INTEGER;
 RGB1 : RGBColor;
 RGB2 : RGBColor;
 RGB3 : RGBColor;
 RGB4 : RGBColor;
 Filler : INTEGER;
 END;

The MCIT will always contain a special “End-of-table” entry (MenuID = -99). The MCIT can also include 3 other types of entries; the Menu Bar Entry, the Menu Title Entry and the Menu Item Entry. In all three entries, filler is a reserved integer used by the Menu Manager (should not be used by the program).

In a Menu Bar Entry, MenuID and MenuItem equals 0. It contains the 4 RGB Colors that are used to draw the default Menu Title color, default Menu Background color (background of the pull down menu), default Menu Item color and default Menu Bar color (RGB1-RGB4, in that order). There should be at most only 1 Menu Bar Entry, though there does not have to be one. If there is not a Menu Bar Entry, the default colors are Black on White (normal monochrome menu).

In a Menu Title Entry, MenuID is not equal to 0 and MenuItem is equal to 0. The MenuID number will match the ID number of the Menu it is describing. RGB1 is the Title Color; RGB2 is the Menu Bar Color; RGB3 is the default Menu Item color; RGB4 is the default Menu Background color. There should be at most only 1 Menu Title Entry per each Menu displayed in the MenuList, though there does not have to be one. If there is no Menu Title Entry to match a Menu, the Menu uses the colors defined in the Menu Bar Entry.

In a Menu Item Entry, MenuID and MenuItem do not equal 0. The MenuID and MenuItem defines a specific Menu Item (with the Menu ID of MenuID and the Menu Item number of MenuItem). RGB1 is the Mark color of that Menu, RGB2 is the Name color (ie. text), RGB3 is the Command Key color and RGB4 is the Background color. There should be at most only 1 Menu Item Entry per each Menu Item displayed in the MenuList, though there does not have to be one. If there is no Menu Item Entry for a specific Menu Item, the Menu Title Entry is used.

Thus the Menu Bar Entry defines the global default colors. These default colors can be overridden for a specific menu by a Menu Title Entry. The Menu Title Entry defines the default colors for a single Menu, unless overridden by the Menu Item Entry. The Menu Item Entry defines the colors for a single Menu Item.

There are a few ways to alter the MCIT. The Mac // Menu Manager has modified two of the older calls so that they work with the MCIT. When InitMenu is called, InitMenu checks for a resource of type “mctb” and ID number 0. Resource of this type contain 1 or more Menu Color Entries. InitMenu loads the entries the resource contains into the MCIT (assuming the resource exists). That specific resource (type “mctb” and ID number 0) is usually in the System file of the Macintosh // and usually contains the Menu Bar Entry. For most Mac // System files, this resource contains the color information for a Black on White menu. By altering this resource in the System file, the colors of the menu can be changed for all programs. A modified version of the resource can be added to any application so that the colors change for that application only (because resources inside an application override the resource of the same type and ID number that reside in the System file).

The other older Menu Manager call that works with the MCIT is the GetMenu call. When GetMenu load a certain “MENU” resource, it also looks for the resource of type “mctb” with the same ID number. GetMenu then loads the Entries, contained in the resource, into the MCIT. Usually the resource holds the Menu Title Entry and Menu Item Entries for that specific Menu.

The “mctb” resources is a variable size resource with the following format:

TYPE
 MenuCInfo = RECORD
 NumEntries :  INTEGER;
 Entry  : ARRAY[1.. NumEntries] OF MCInfoRec;
 END;
 MenuCInfoPtr  = ^ MenuCInfo;
 MenuCInfoHdl  = ^ MenuCInfoPtr;

There are also 6 new Mac // Menu Manager calls that work with or alter the MCIT. They can get, set and dispose of the MCIT, and can get, set and delete individual entries in the MCIT. However this is not the best way to alter the MCIT for most cases. By using these older calls, the program can still display Menus in color, without having to write Macintosh // specific code.

The sample program shows how to create resources inside a program that display color menus. However, instead of using RMaker, ResEdit could be used to make these resources. Color could even be added to preexisting programs without having any effect on the functionality of that program. The following is the ResEdit Template to be used when modifying “mctb” resources. To add a template to ResEdit, create a resource of type “TMPL” and name “mctb”. The template contains the following information:

Label Type Comments

# of Entries OCNT

***** LSTC

Menu ID DWRD

Menu ID DWRD

Red1 HWRD could be DWRD also

Green1 HWRD

Blue1 HWRD

Red2 HWRD

Green2 HWRD

Blue2 HWRD

Red3 HWRD

Green3 HWRD

Blue3 HWRD

Red4 HWRD

Green4 HWRD

Blue4 HWRD

Filler DWRD leave empty

***** LSTE

Hierarchical Menus

Hierarchical Menus are created the same way as any other menus; either by using GetMenu or using NewMenu. You can use any of the normal Menu Manager (AddResMenu, SetItem, CheckItem, etc.) calls to create or modify the Menu. As such, any SubMenu can have all the variations (different Styles, Keyboard Equivalents, Disable, Icons, Marks, Scrolling) available on a normal menu.

Fig. 2 Menus nested three deep!

A Menu becomes a Hierarchical Menu when it is inserted into the Menu List with the InsertMenu call. Normally InsertMenu contains the MenuHandle and a integer value that explains where in the list to insert that specific Menu. If that value is zero, the menu is added to the end of the Menu List. With the new Menu Manager, if that value was set to -1, the Menu becomes a Hierarchical Menu. It will become part of the MenuList, but it will be placed in a “Hierarchical” portion of the list. It will not be displayed in the Menu bar. Hierarchical Menu will only be displayed when the menu item it attached is highlighted.

Menu Items become attached to another Hierarchical Menu by having 2 values in their data structure. First the Keyboard Equivalent byte must be set to $1B. Next the Menu ID of the Hierarchical Menu must be placed in the Character Mark byte. This can be done directly in the program with the AppendMenu and/or SetItemMark calls, or the values can be placed in the MENU resources of the program. The example program does it this way. Note that the fact that the Character Mark byte must hold the Menu ID of the Hierarchical Menu. This limit all Hierarchical Menus to the ID numbers 0 to 255.

When a Menu is selected that contains a Menu Item that is attached to a Hierarchical Menu, first the “Father” Menu is displayed. If the specific Menu Item is highlighted, the Hierarchical Menu is displayed. If some item in the Hierarchical Menu is finally chosen, it’s Menu ID and Item ID are returned in MenuSelect (or MenuKey). The fact that the “Father” Menu was initially selected is completely invisible to the program. If the “Father” Menu contains nothing but SubMenus, it might not even be checked for in the Menu Case statement of the program. The example program contains such a Menu.

Final Comments

The example program demonstrates a simple use of Color Menus and Hierarchical Menus. It creates a window and displays a text message. The user can control the message contents, font, size, style, justification and color (Foreground and Background colors using the Old Quickdraw color commands).

The program places the Color, Font, Size, Style and Justification menus into the Display Menu, and places the Foreground and Background menus into the Color Menu. Thus, one Hierarchical Menu controls all of the standard Text editing menus that are appearing in more and more programs. This will provide more space on the Menu Bar; space that is needed as features are added to programs.

The “mctb” resources color the Menu Titles Green, the Desk Accessory’s Menu Items Red, the Color Menu Items the various colors and the rest of the Menu Items Blue. Besides showing the colors the text can be displayed in, the other color menus form the Menus Items into logical groups for quick recognition.

Some last hints about using Color Menus and Hierarchical Menus, overuse of these new features will confuse a user, not enhance the program. Do not use colors combinations that are hard to read (ie. Red on Blue background). Group types of menu items into the same color; do not give menu items arbitrary colors. Do not go down too many layers of depth with Hierarchical Menu, or a user will lose track of where he is. Be restrained!

The is one other change to the Menu Manager on the Mac // that is worth mentioning. How and where a menu bar is drawn is no longer in ROM. Now the ROM calls a Menu Bar Defproc to place the Menu Bar. The same way the Menu Defproc handles the menu (drawing, highlighting, calculation size), the Menu Bar Defproc handle the Menu Bar. Menu Bar Defproc are stored in resources as type “mbdf” and the default Menu Bar Defproc has ID number 0. There is a new Menu Manager call, named InitProcMenu, that allows switching of a Menu Bar Defproc. Perhaps a Menu Bar that displays icons or pictures, or a defproc that draws the Menu Bar along the bottom or right side of the screen will be seen in a future article.

Fig. 3 MenuFun selects color


{MenuFun by Steve Sheets 6/3/87  }

{Simple Demonstration of Mac // Menu Manager.}

PROGRAM LMC;

{Various Constants:Menu ID Numbers  }
 CONST
 AppleMenuID = 40;
 FileMenuID = 41;
 EditMenuID = 42;
 DisplayMenuID = 43;
 ColorMenuID = 44;
 FontMenuID = 45;
 SizeMenuID = 46;
 StyleMenuID = 47;
 JustMenuID = 48;
 FColorMenuID = 49;
 BColorMenuID = 50;

{Var:Menus, Window, Text, Rectangle, Done Flag,}
{Colors, Font, Size and Justification Settings.}
 VAR
 AppleMenu, FileMenu, EditMenu, DisplayMenu, ColorMenu,        
 FontMenu, SizeMenu, StyleMenu, JustMenu, FColorMenu, 
 BColorMenu : MenuHandle;
 MyWindow : windowptr;
 Done : boolean;
 MyStr : str255;
 MyRect : Rect;
 MyFColor, MyBColor, MyFont, MySize, MyJust : integer;
 MyBold, MyItalic, MyUnderline, MyOutline, MyShadow,           
 MyCondense, MyExtend : boolean;
 MyStyle : Style;

{Redraws the window, by creating an update event.}
 PROCEDURE ReDraw;
 VAR
 tempPort : Grafptr;
 BEGIN
 GetPort(tempPort);
 SetPort(MyWindow);
 InvalRect(MyRect);
 SetPort(tempPort);
 END;

{Given the style settings, checks the various Style Menus and createsthe 
correct Style variable.}
 PROCEDURE CheckStyle;
 BEGIN
 MyStyle := [];
 IF MyBold THEN
 BEGIN
 SetItemMark(StyleMenu, 1, CHAR(diamondMark));
 MyStyle := MyStyle + [Bold];
 END
 ELSE
 SetItemMark(StyleMenu, 1, CHAR(noMark));
 IF MyItalic THEN
 BEGIN
 SetItemMark(StyleMenu, 2, CHAR(diamondMark));
 MyStyle := MyStyle + [Italic];
 END
 ELSE
 SetItemMark(StyleMenu, 2, CHAR(noMark));
 IF MyUnderLine THEN
 BEGIN
 SetItemMark(StyleMenu, 3, CHAR(diamondMark));
 MyStyle := MyStyle + [Underline];
 END
 ELSE
 SetItemMark(StyleMenu, 3, CHAR(noMark));
 IF MyOutline THEN
 BEGIN
 SetItemMark(StyleMenu, 4, CHAR(diamondMark));
 MyStyle := MyStyle + [Outline];
 END
 ELSE
 SetItemMark(StyleMenu, 4, CHAR(noMark));
 IF MyShadow THEN
 BEGIN
 SetItemMark(StyleMenu, 5, CHAR(diamondMark));
 MyStyle := MyStyle + [Shadow];
 END
 ELSE
 SetItemMark(StyleMenu, 5, CHAR(noMark));
 IF MyCondense THEN
 BEGIN
 SetItemMark(StyleMenu, 6, CHAR(diamondMark));
 MyStyle := MyStyle + [Condense];
 END
 ELSE
 SetItemMark(StyleMenu, 6, CHAR(noMark));
 IF MyExtend THEN
 BEGIN
 SetItemMark(StyleMenu, 7, CHAR(diamondMark));
 MyStyle := MyStyle + [Extend];
 END
 ELSE
 SetItemMark(StyleMenu, 7, CHAR(noMark));
 END;

{Given the color number (1-8), returns color constant.}
 FUNCTION GetColor (C : integer) : longint;
 BEGIN
 CASE C OF
 1 : 
 GetColor := BlackColor;
 2 : 
 GetColor := WhiteColor;
 3 : 
 GetColor := RedColor;
 4 : 
 GetColor := GreenColor;
 5 : 
 GetColor := BlueColor;
 6 : 
 GetColor := CyanColor;
 7 : 
 GetColor := MagentaColor;
 8 : 
 GetColor := YellowColor;
 END;
 END;

{Draws Text in Rectangle in correct Colors, Font,  Size, Style and Justification.}
 PROCEDURE DoDraw;
 VAR
 tempStr : str255;
 tempInteger : integer;
 BEGIN
 ForeColor(GetColor(MyFColor));
 BackColor(GetColor(MyBColor));
 GetItem(FontMenu, MyFont, tempStr);
 GetFNum(tempStr, tempInteger);
 TextFont(tempInteger);
 CASE MySize OF
 1 : 
 TextSize(9);
 2 : 
 TextSize(10);
 3 : 
 TextSize(12);
 4 : 
 TextSize(18);
 5 : 
 TextSize(24);
 6 : 
 TextSize(32);
 END;
 TextFace(MyStyle);
 TextBox(POINTER(ord4(@MyStr) + 1), LENGTH(MyStr), MyRect, MyJust - 2);
 END;

{Edit the Text.  }
 PROCEDURE DoEdit;
 VAR
 MyDialog : DialogPtr;
 N : integer;
 MyH : handle;
 MyR : rect;
 BEGIN
 MyDialog := GetNewDialog(130, NIL, POINTER(-1));
 GetDItem(MyDialog, 4, N, MyH, MyR);
 SetIText(MyH, MyStr);
 REPEAT
 ModalDialog(NIL, N);
 UNTIL (N = 1) OR (N = 2);
 IF N = 1 THEN
 BEGIN
 GetIText(MyH, MyStr);
 ReDraw;
 END;
 DisposDialog(MyDialog);
 END;

{Standard main menu procedure that handles menu selections.  Can show 
About Box, Edit the Text, change the Done Flag (so the program quits), 
handle edit commands (Cut,Copy,Paste,Clear), and change all the Colors, 
Font, Size, Style and Justification of the Text. }
 PROCEDURE MainMenu (tempResult : LONGINT);
 VAR
 tempInteger : integer;
 tempStr : str255;
 BEGIN
 tempInteger := LoWord(tempResult);
 CASE HiWord(tempResult) OF
 AppleMenuID : 
 IF tempInteger = 1 THEN
 tempInteger := Alert(128, NIL)
 ELSE
 BEGIN
 GetItem(appleMenu, tempInteger, tempStr);
 tempInteger := OpenDeskAcc(tempStr);
 END;
 FileMenuID : 
 IF tempInteger = 1 THEN
 DoEdit
 ELSE IF tempInteger = 3 THEN
 Done := (Alert(129, NIL) = 2);
 EditMenuID : 
 IF NOT SystemEdit(tempInteger - 1) THEN
 sysbeep(1);
 FColorMenuID : 
 IF (tempInteger <> 0) AND (tempInteger <> MyFColor) THEN
 BEGIN
 CheckItem(FColorMenu, MyFColor, false);
 MyFColor := tempInteger;
 CheckItem(FColorMenu, MyFColor, true);
 ReDraw;
 END;
 BColorMenuID : 
 IF (tempInteger <> 0) AND (tempInteger <> MyBColor) THEN
 BEGIN
 CheckItem(BColorMenu, MyBColor, false);
 MyBColor := tempInteger;
 CheckItem(BColorMenu, MyBColor, true);
 ReDraw;
 END;
 FontMenuID : 
 IF (tempInteger <> 0) AND (tempInteger <> MyFont) THEN
 BEGIN
 CheckItem(FontMenu, MyFont, false);
 MyFont := tempInteger;
 CheckItem(FontMenu, MyFont, true);
 ReDraw;
 END;
 SizeMenuID : 
 IF (tempInteger <> 0) AND (tempInteger <> MySize) THEN
 BEGIN
 CheckItem(SizeMenu, MySize, false);
 MySize := tempInteger;
 CheckItem(SizeMenu, MySize, true);
 ReDraw;
 END;
 StyleMenuID : 
 BEGIN
 CASE tempInteger OF
 1 : 
 MyBold := NOT MyBold;
 2 : 
 MyItalic := NOT MyItalic;
 3 : 
 MyUnderLine := NOT MyUnderLine;
 4 : 
 MyOutline := NOT MyOutline;
 5 : 
 MyShadow := NOT MyShadow;
 6 : 
 MyCondense := NOT MyCondense;
 7 : 
 MyExtend := NOT MyExtend;
 OTHERWISE
 END;
 CheckStyle;
 ReDraw;
 END;
 JustMenuID : 
 IF (tempInteger <> 0) AND (tempInteger <> MyJust) THEN
 BEGIN
 CheckItem(JustMenu, MyJust, false);
 MyJust := tempInteger;
 CheckItem(JustMenu, MyJust, true);
 ReDraw;
 END;
 OTHERWISE
 END;
 HiliteMenu(0);
 END;

{Setup for Menus, Window, Done flag, Text, Rectangle, Colors, Font, Size, 
Style and Justification of the Text.}
 PROCEDURE DoSetup;
 BEGIN
 AppleMenu := GetMenu(AppleMenuID);
 AddResMenu(AppleMenu, ‘DRVR’);

 FileMenu := GetMenu(FileMenuID);

 EditMenu := GetMenu(EditMenuID);

 DisplayMenu := GetMenu(DisplayMenuID);

 ColorMenu := GetMenu(ColorMenuID);

 FontMenu := GetMenu(FontMenuID);
 AddResMenu(FontMenu, ‘FONT’);
 MyFont := 1;
 CheckItem(FontMenu, MyFont, true);

 SizeMenu := GetMenu(SizeMenuID);
 MySize := 3;
 CheckItem(SizeMenu, MySize, true);

 StyleMenu := GetMenu(StyleMenuID);
 MyBold := false;
 MyItalic := false;
 MyUnderLine := false;
 MyOutline := false;
 MyShadow := false;
 MyCondense := false;
 MyExtend := false;
 CheckStyle;

 JustMenu := GetMenu(JustMenuID);
 MyJust := 3;
 CheckItem(JustMenu, MyJust, true);

 FColorMenu := GetMenu(FColorMenuID);
 MyFColor := 1;
 CheckItem(FColorMenu, MyFColor, true);

 BColorMenu := GetMenu(BColorMenuID);
 MyBColor := 2;
 CheckItem(BColorMenu, MyBColor, true);

 InsertMenu(AppleMenu, 0);
 InsertMenu(FileMenu, 0);
 InsertMenu(EditMenu, 0);
 InsertMenu(DisplayMenu, 0);
 InsertMenu(ColorMenu, -1);
 InsertMenu(FontMenu, -1);
 InsertMenu(SizeMenu, -1);
 InsertMenu(StyleMenu, -1);
 InsertMenu(JustMenu, -1);
 InsertMenu(FColorMenu, -1);
 InsertMenu(BColorMenu, -1);

 DrawMenuBar;
 MyWindow := GetNewWindow(128, NIL, POINTER(-1));
 MyRect := MyWindow^.portRect;
 GetIndString(MyStr, 128, 1);
 InitCursor;
 Done := false;
 END;

{Standard main program loop that handles all events (ie. mouse down, 
key downs & updates) until the Done flag is set.   }
 PROCEDURE MainLoop;
 VAR
 tempEvent : EventRecord;
 tempWindow : windowptr;
 tempCode : integer;
 tempPort : Grafptr;
 tempRect : rect;
 tempLong : longint;
BEGIN
REPEAT
 SystemTask;
 IF GetNextEvent(everyEvent, tempEvent) THEN
 BEGIN
 CASE tempEvent.what OF
 mouseDown : 
 BEGIN
 tempCode := FindWindow(tempEvent.where, tempWindow);
 CASE tempCode OF
 inDrag, inContent : 
 BEGIN
 IF tempWindow <> FrontWindow THEN
 SelectWindow(tempWindow)
 ELSE
 BEGIN
 IF MyWindow = tempWindow THEN
 BEGIN
 SetRect(tempRect, -25000, -25000, 25000, 25000);
 DragWindow(MyWindow, tempEvent.where, tempRect);
 END;
 END;
 END;
 inGrow : 
 BEGIN
 IF tempWindow <> FrontWindow THEN
 SelectWindow(tempWindow)
 ELSE
 BEGIN
 IF MyWindow = tempWindow THEN
 BEGIN
 SetRect(tempRect, -25000, -25000, 25000, 25000);
 tempLong := GrowWindow(MyWindow, tempEvent.where, tempRect);
 SizeWindow(MyWindow, LoWord(tempLong), HiWord(tempLong), false);
 MyRect := MyWindow^.portRect;
 ReDraw;
 END;
 END;
 END;
 inMenuBar : 
 MainMenu(MenuSelect(tempEvent.where));
 inSysWindow : 
 SystemClick(tempEvent, tempWindow);
 OTHERWISE
 END; { of tempCode case }
 END; { of mouseDown }
 keydown, autoKey : 
 IF BitAnd(tempEvent.modifiers, cmdKey) <> 0 THEN
 MainMenu(MenuKey(CHR(tempEvent.message MOD 256)));
 updateEvt : 
 IF MyWindow = WindowPtr(tempEvent.message) THEN
 BEGIN
 GetPort(tempPort);
 SetPort(MyWindow);
 BeginUpdate(MyWindow);
 DoDraw;
 EndUpdate(MyWindow);
 SetPort(tempPort);
 END;
 OTHERWISE
 END;
 END;
 UNTIL Done;
END;

{***PROGRAM*** }
BEGIN
 DoSetup;
 MainLoop;
END.

*  MenuFun.R
*    RMaker Source code for resources to be included in
*    the MenuFun application.  Includes about info.
* 
MenuFun Rsrc

* Main Window, Alerts, & Text Edit Dialog
Type WIND
  ,128
MenuFun
40 106 240 406
Visible NoGoAway
0
0

Type ALRT
  ,128
50 106 230 406
128
4444

  ,129
50 106 150 406
129
444

Type DLOG
  ,130

50 56 175 456
Visible NoGoAway
3
0
130

Type DITL
  ,128
4

button
140 120 159 180
OK

staticText
20 65 39 235
MenuFun by Steve Sheets

staticText
40 50 59 250
Sample Mac // Menu Program

staticText
60 30 119 270
This program uses the Mac // Menu Manager to create Hierarchical and 
Color Menus.

  ,129
3

button
60 180 80 240
Cancel

button
60 60 80 120
OK

staticText
20 37 40 263
Do you wish to quit this program?

  ,130
4

button
85 110 105 170
OK

button
85 230 105 290
Cancel

staticText
20 20 40 160
Text to be Diplayed:

editText
45 20 65 380


* Menu Resources
Type MENU
  ,40
\14
  About MenuFun...
  (-

  ,41
File
  Edit Text/E
  (-
  Quit/Q

  ,42
Edit
  Undo/Z
  (-
  Cut/X
  Copy/C
  Paste/V
  Clear

* Menu containing various Menu Items that are attached
*   to other SubMenus (ie. Hierarchical Menu).  Note
*   inserted hex values using the \ command.  Ex:
*   /\1B sets Keyboard Equivalent to $1B and !\2C sets
*   Character Mark to $2C or 44 (Color Menu ID number).
  ,43
Display
  Color/\1B!\2C
  Font/\1B!\2D
  Size/\1B!\2E
  Style/\1B!\2F
  Justification/\1B!\30

* SubMenus attached to Display Menu
  ,44
Color
  Foreground/\1B!\31
  Background/\1B!\32

  ,45
Font

  ,46
Font
  9
  10
  12
  18
  24
  32

  ,47
Style
  Bold<B/B
  Italic<I/I
  Underline<U/U
  Outline<O/O
  Shadow<S/S
  Condense
  Extended

  ,48
Justification
  Right/R
  Left/L
  Center

* SubMenus attached to Color SubMenu
  ,49
Foreground
  Black
  White
  Red
  Green
  Blue
  Cyan
  Magenta
  Yellow

  ,50
Background
  Black
  White
  Red
  Green
  Blue
  Cyan
  Magenta
  Yellow

* Starting Display Text
Type STR#
  ,128
1
Welcome to MenuFun

* Menu Color Resources
*   First comes the number of entries.  Each entry contatins 
*   the Menu ID number & the Menu Item number, followed by 
*   4 RGB values (three 16-bit integers in Hex) ending with
*   a single integer filler.
Type mctb = GNRL
* For MMenu Bar Entry (ID #0), Default Title & Title Back
* ground Color is Green on White, while Default Item (Command, 
* Mark & Name) and Item Background is Blue on White.
  ,0
* Number of entries
.I
1
.I
* Menu ID number & the Menu Item number, in this case 0 & 0
* Menu Bar Entry.
0 0
.H
* 4 RGB Colors each containing 3 integers (Green, White,
*   Blue, White) and the final placing holding integer.
0000 FFFF 0000 FFFF FFFF FFFF 0000 0000 FFFF FFFF FFFF FFFF 0000

* For Apple Menu (ID #40), 3 entries.  Title & Title Back
* ground Coloris Green on White, while Default Item (Command, 
* Mark & Name) and Item Background is Red on White.  Items 1 
* & 2 set Mark, Command and Name Color to Blue and Background 
* to White.
  ,40
.I
3
.I
40 0
.H
0000 FFFF 0000 FFFF FFFF FFFF FFFF 0000 0000 FFFF FFFF FFFF 0000
.I
40 1
.H
0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF FFFF 0000
.I
40 2
.H
0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF FFFF 0000

* For Foreground Menu (ID #49), 8 entries (1 per Menu Item).
*   1st and 2nd Items, Mark, Command and Name colors are 
* black, while Background color is White.  3rd through 8th 
* Items are the same as 1st Item, except that the Mark, 
* Command and Name colors are Red, Green, Blue, Cyan, Magenta 
* or Yellow (in that order).
  ,49
.I
8
.I
49 1
.H
0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FFFF FFFF 0000
.I
49 2
.H
0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FFFF FFFF 0000
.I
49 3
.H
FFFF 0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF 0000
.I
49 4
.H
0000 FFFF 0000 0000 FFFF 0000 0000 FFFF 0000 FFFF FFFF FFFF 0000
.I
49 5
.H
0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF FFFF 0000
.I
49 6
.H
0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF FFFF FFFF 0000
.I
49 7
.H
FFFF 0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF FFFF 0000
.I
49 8
.H
FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF 0000

* For Background Menu (ID #50), identical to Foreground Menu.
  ,50
.I
8
.I
50 1
.H
0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FFFF FFFF 0000
.I
50 2
.H
0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FFFF FFFF 0000
.I
50 3
.H
FFFF 0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF 0000
.I
50 4
.H
0000 FFFF 0000 0000 FFFF 0000 0000 FFFF 0000 FFFF FFFF FFFF 0000
.I
50 5
.H
0000 0000 FFFF 0000 0000 FFFF 0000 0000 FFFF FFFF FFFF FFFF 0000
.I
50 6
.H
0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF FFFF FFFF 0000
.I
50 7
.H
FFFF 0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF FFFF 0000
.I
50 8
.H
FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF 0000 FFFF FFFF FFFF 0000
 
AAPL
$119.00
Apple Inc.
+0.00
MSFT
$47.75
Microsoft Corpora
+0.00
GOOG
$540.37
Google Inc.
+0.00

MacTech Search:
Community Search:

Software Updates via MacUpdate

Skype 7.2.0.412 - Voice-over-internet ph...
Skype allows you to talk to friends, family and co-workers across the Internet without the inconvenience of long distance telephone charges. Using peer-to-peer data transmission technology, Skype... Read more
HoudahSpot 3.9.6 - Advanced file search...
HoudahSpot is a powerful file search tool built upon MacOS X Spotlight. Spotlight unleashed Create detailed queries to locate the exact file you need Narrow down searches. Zero in on files Save... Read more
RapidWeaver 6.0.3 - Create template-base...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
iPhoto Library Manager 4.1.10 - Manage m...
iPhoto Library Manager lets you organize your photos into multiple iPhoto libraries. Separate your high school and college photos from your latest summer vacation pictures. Or keep some photo... Read more
iExplorer 3.5.1.9 - View and transfer al...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
MacUpdate Desktop 6.0.3 - Discover and i...
MacUpdate Desktop 6 brings seamless 1-click installs and version updates to your Mac. With a free MacUpdate account and MacUpdate Desktop 6, Mac users can now install almost any Mac app on macupdate.... Read more
SteerMouse 4.2.2 - Powerful third-party...
SteerMouse is an advanced driver for USB and Bluetooth mice. It also supports Apple Mighty Mouse very well. SteerMouse can assign various functions to buttons that Apple's software does not allow,... Read more
iMazing 1.1 - Complete iOS device manage...
iMazing (was DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and from... Read more
PopChar X 7.0 - Floating window shows av...
PopChar X helps you get the most out of your font collection. With its crystal-clear interface, PopChar X provides a frustration-free way to access any font's special characters. Expanded... Read more
OneNote 15.4 - Free digital notebook fro...
OneNote is your very own digital notebook. With OneNote, you can capture that flash of genius, that moment of inspiration, or that list of errands that's too important to forget. Whether you're at... Read more

Latest Forum Discussions

See All

Lucha Amigos (Games)
Lucha Amigos 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Forget Ninja Turtles, and meet Wrestlers Turtles! Crazier, Spicier and…Bouncier! Sling carapaces of 7 Luchadores to knock all... | Read more »
Raby (Games)
Raby 1.0.3 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0.3 (iTunes) Description: ***WARNING - Raby runs on: iPhone 5, iPhone 5C, iPhone 5S, iPhone 6, iPhone 6 Plus, iPad Mini Retina, iPad Mini 3, iPad 4, iPad Air,... | Read more »
Oddworld: Stranger's Wrath (Games)
Oddworld: Stranger's Wrath 1.0 Device: iOS Universal Category: Games Price: $5.99, Version: 1.0 (iTunes) Description: ** PLEASE NOTE: Oddworld Stranger's Wrath requires at least an iPhone 4S, iPad 2, iPad Mini or iPod Touch 5th gen... | Read more »
Bounce On Back (Games)
Bounce On Back 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: | Read more »
Dwelp (Games)
Dwelp 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: === 50% off for a limited time, to celebrate release === Dwelp is an elegant little puzzler with a brand new game mechanic. To complete a... | Read more »
Make Way for Fat Chicken, from the Maker...
Make Way for Fat Chicken, from the Makers of Scrap Squad Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Relevant Games has announced they will be releasing their reverse tower defense game, | Read more »
Tripnary Review
Tripnary Review By Jennifer Allen on November 26th, 2014 Our Rating: :: TRAVEL BUCKET LISTiPhone App - Designed for the iPhone, compatible with the iPad Want to create a travel bucket list? Tripnary is a fun way to do exactly that... | Read more »
Ossian Studios’ RPG, The Shadow Sun, is...
Ossian Studios’ RPG, The Shadow Sun, is Now Available for $4.99 Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Mmmm, Tasty – Having the Angry Birds for...
The very first Angry Birds debuted on iOS back in 2009. When you sit back and tally up the number of Angry Birds games out there and the impact they’ve had on pop culture as a whole, you just need to ask yourself: “How would the birds taste... | Read more »
Rescue Quest Review
Rescue Quest Review By Jennifer Allen on November 26th, 2014 Our Rating: :: PATH BASED MATCH-3Universal App - Designed for iPhone and iPad Guide a wizard to safety by matching gems. Rescue Quest might not be an entirely original... | Read more »

Price Scanner via MacPrices.net

Apple Store Black Friday sale for 2014: $100...
BLACK FRIDAY The Apple Store has posted their Black Friday deals for 2014. Receive a $100 PRODUCT(RED) branded iTunes gift card with the purchase of select Macs, $50 with iPads, and $25 with iPods,... Read more
Black Friday: 15% off iTunes Gift Cards
Staples is offering 15% off $50 and $100 iTunes Gift Cards on their online store as part of their Black Friday sale. Click here for more information. Shipping is free. Best Buy is offering $100... Read more
BEVL Releases Dock Tailored for iPhone 6 and...
Seattle based BEVL has released their first product: an iPhone dock that is divergent in build quality, rock-solid function and visual simplicity to complement the iPhone. BEVL is now accepting... Read more
Black Friday: $150 off 13-inch Retina MacBook...
 Best Buy has 13-inch 2.6GHz Retina MacBook Pros on sale for $150 off MSRP on their online store as part of their Black Friday sale. Choose free shipping or free local store pickup (if available).... Read more
Black Friday: $300 off 15-inch Retina MacBook...
 B&H Photo has the new 2014 15″ Retina MacBook Pros on sale for $300 off MSRP as part of their Black Friday sale. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina... Read more
Black Friday: Up to $140 off MacBook Airs, fr...
 B&H Photo has 2014 MacBook Airs on sale for up to $140 off MSRP as part of their Black Friday sale. Shipping is free, and B&H charges NY sales tax only: - 11″ 128GB MacBook Air: $799 $100... Read more
Black Friday: 13-inch 2.5GHz MacBook Pro on s...
 Best Buy has the 13″ 2.5GHz MacBook Pro on sale for $899.99 on their online store as part of their Black Friday sale. Choose free shipping or free instant local store pickup (if available). Their... Read more
Black Friday: 21-inch 1.4GHz iMac on sale for...
 Best Buy has the 21″ 1.4GHz iMac on sale for $899.99 on their online store as part of their Black Friday sale. Their price is $200 off MSRP. Choose free shipping or free local store pick up. Price... Read more
Black Friday iPad Air 2 sale prices, $100 off...
 Best Buy has iPad Air 2s on sale for $100 off MSRP on their online store for Black Friday. Choose free shipping or free local store pickup (if available). Sale prices available for online orders... Read more
2014 1.4GHz Mac mini on sale for $449, save $...
 B&H Photo has the new 1.4GHz Mac mini on sale for $449.99 including free shipping plus NY tax only. Their price is $50 off MSRP, and it’s the lowest price available for this new model. Adorama... Read more

Jobs Board

*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.