Newsgroups: comp.sys.mac.programmer
Path: utzoo!utgpu!cunews!bnrgate!bmers95!bnr.ca!slang
From: slang@bnr.ca (Steven Langlois)
Subject: Obtaining the Gray colour used for disabled menu items
Message-ID: <1991Jun14.141644.4857@bmers95.bnr.ca>
Sender: usenet@bmers95.bnr.ca
Reply-To: slang@bnr.ca (Steven Langlois)
Organization: Bell-Northern Research Ltd.
Date: Fri, 14 Jun 91 14:16:44 GMT

I have very little experience with colour on the Mac so please bare with me.
I am using James Plamondon's popup menu CDEF from MacTutor Vol.4 No.9 am
I am trying to enhance it a little. There were 2 things I noticed it
couldn't do. 1) there was not way to tell if the a menu selection
was abondoned, i.e. in a dialog, when you get the item selected, find
it was a popup control, and call GetCtlMin to find which item is selected,
you have no way of knowing if the user abandoned a selection or reselected
the same item because in either case, contrlMin will still be the same.
I managed to solve this using the contrlRfCon field. 2) If the menu
item in the popup box is disabled, the text in the popup box is still
solid. When the popup is selected, the current item becomes gray.
What I wanted to do was to draw the text in the popup box in gray when the
current item is disabled. I have been able to do this by painting
inside the popup rect with a gray pattern after drawing the string
in the popup box. The results are good for black and white or in
colour before System 7 because the grayed item looks the same as any
menu grayed item. Under System 7, the gray of disabled items is a
nice solid gray, it doesn't look like a gray pattern applied to
solid black text. How can I draw a disabled item in the popup
box in the grey which is used for disabled menu items?

Any help would be much appreciated.

Steven Langlois
ISDN Basic Rate Access
BNR, a subsidiary of Northern Telecom

Internet: slang@bnr.ca

