[comp.sys.mac.programmer] LSC & hierarchical menus

tedj@hpcilzb.HP.COM (Ted Johnson) (08/02/88)

Does anyone know how to enter the wierd hex value 0x1B in the
"mark char" field of a MENU resource in ResEdit?

Or, does anyone have a cookbook explanation/example of how
to use hierarchical menus with LSC?

Thanks a lot!

-Ted

tedj@hpcilzb.HP.COM (Ted Johnson) (08/04/88)

>Does anyone know how to enter the wierd hex value 0x1B in the
>"mark char" field of a MENU resource in ResEdit?

I just realized that 0x1B is <escape>, so now I am even more puzzled.
How do you type <escape> into ResEdit?

Any clues (expecially examples!) are very much appreciated!

-Ted

olson@endor.harvard.edu (Eric K. Olson) (08/05/88)

In a recent article Ted Johnson writes:
>
>>Does anyone know how to enter the wierd hex value 0x1B in the
>>"mark char" field of a MENU resource in ResEdit?

Open ResEdit with ResEdit and modify the TMPL named "MENU" so that
the mark char field is a HBYT.  Close everything, quit, and re-run
ResEdit.

-Eric
          Lexington Software Design:  Tomorrow's Software Yesterday

Eric K. Olson     olson@endor.harvard.edu     harvard!endor!olson     D0760
   (Name)                (ArpaNet)                 (UseNet)        (AppleLink)

nopuklic@ndsuvax.UUCP (Blayne Puklich) (08/05/88)

[]
In article <730055@hpcilzb.HP.COM> tedj@hpcilzb.HP.COM (Ted Johnson) writes:
>
>>Does anyone know how to enter the wierd hex value 0x1B in the
>>"mark char" field of a MENU resource in ResEdit?
>
>I just realized that 0x1B is <escape>, so now I am even more puzzled.
>How do you type <escape> into ResEdit?
>
>Any clues (expecially examples!) are very much appreciated!
>
>-Ted

     You may want to re-read IM V-236.  Don't put the $1B in the mark
char field, put it in the keyboard equivalent field.  The resource ID
of the hMenu goes in the mark char field.  It's very easy to type in an
escape.  Just type one, and the "missing symbol" will be displayed.
However, I can see you would have a slight problem if you didn't have an
ADB keyboard (such as one from a Mac other than an SE or II).
     I've thought about this before when I started working with hMenus,
and I think I might have a solution for you if you're using a non-ADB
keyboard.  This may be a really hard way to do it, but it's all I can
think of.
     What you could do is go into ResEdit itself and alter the editing
template for the resource type MENU.  This is very easy to do, and I'll
explain it as best I can.
     The first thing to do is BACK UP RESEDIT so you have a copy you
can work with.  Open up one of your copies of ResEdit, and open up the
copy of ResEdit you wish to use for this.  You can run and open the
same copy of ResEdit.
     Next, open up the templates (type TMPL).  Find the MENU template
and open it up.  What you'll be staring at is the editing template
for MENUs.  Go down to the "key equiv" title, and change its type from
CHAR to HBYT.  HBYT stands for Hex BYTe (pretty obvious).  This will
allow you to type in $1B for your escape character.
     While you're at it and still have the MENU template open, you
might want to change the "mark char" from CHAR to DBYT so that you can
put your hierarchical menu's resource ID into that spot as you build
the parent menu's resource.  DBYT stands for Decimal BYTe.
     Now you can save and close your copy of ResEdit that you changed.
The next time you use ResEdit and open up a resource of type MENU,
the two pieces-parts you changed in the editing template will be
displayed as a hex byte and a decimal number, respectively.  This might
make life easier when you're working with hMenus.
     I hope this will help you.  I welcome an easier or better way to
do this, since I have a tendency to develop solutions to my problems
that are the hardest way to do things.  But that's what I get for
being a programmer...

||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++||
||	Blayne Puklich			nopuklic@plains.NoDak.edu	   ||
||	NDSU Student ACM     use this-> NU087763@NDSUVM1.bitnet		   ||
||	Chairperson		  North Dakota State University, Fargo, ND ||
||									   ||
||		"Everyone should have a Corvette, I think."		   ||
||-------------------------------------------------------------------------||

wdh@well.UUCP (Bill Hofmann) (08/07/88)

>Does anyone know how to enter the wierd hex value 0x1B in the
>"mark char" field of a MENU resource in ResEdit?

First, unless I'm terribly confused, it goes into the key equiv
field, and the menu ID goes into the mark char field.

1.	On keyboards with an escape key (SE, II kbds), just type
	<esc>.  This works.
2.	Put a character you'll recognize into the right field,
	close the menu being edited, open it again using the
	"Open General" which opens a hex window (hex on left, ascii
	on right), find your character, select the hex version of it,
	and type "1B".
3.	Derez it, and put the constant "hierarchicalMenu" in the
	field, Rez it again if you can't stand having resource sources.
	Seems to me you could do the same in RMaker: it'll let you
	specify an arbitrary hex value (\1b?).

-Bill Hofmann

clive@drutx.ATT.COM (Clive Steward) (08/08/88)

From article <1091@ndsuvax.UUCP>, by nopuklic@ndsuvax.UUCP (Blayne Puklich):
> []
> In article <730055@hpcilzb.HP.COM> tedj@hpcilzb.HP.COM (Ted Johnson) writes:
>>
>>>Does anyone know how to enter the wierd hex value 0x1B in the
>>>"mark char" field of a MENU resource in ResEdit?
[Blayne, and others give good method of changing TMPL to allow]

There are at least 2 other ways, one of them good(!).

I'm shipping off to comp.binaries.mac queue ResMenu 1.2, which is a
fine menu editor add-on for Resedit.  Freeware from Alan T. Goates.

It's great, includes color as well as hierarchical menus, even lets you 
see the hierarchy work.

The other way, not for the faint of heart, though I did it for a
medium project, is to use the Open General in Resedit, and edit the
hex.  It's really not too hard...but...not again if I can help it.

Clive Steward

steele@Apple.COM (Oliver Steele) (08/09/88)

tedj@hpcilzb.HP.COM (Ted Johnson) writes:
>Does anyone know how to enter the wierd hex value 0x1B in the
>"mark char" field of a MENU resource in ResEdit?

[lots of answers...]

And MenuEdit, archived as menuedit-11.hqx at sumex, will let you do
it.  Move the mouse to the item by which you want the submenu to appear,
move it to where it turns into a right-pointing black triangle, press,
and you'll get a popup-menu that will lead you to a dialog box that will
give you a list of menus you can put there.

 ----------------------------------------------------------------------------
 Oliver Steele					      steele@apple.apple.com
 Apple ATG

 "My mouse is signed by Doug Englebart."