[comp.sys.mac] How do you inactivate statText and editText items in a modeless dialog box?

steig@batcomputer.tn.cornell.edu (Mark J. Steiglitz) (06/05/87)

I want some statText and editText items disabled (so that DialogSelect
doesn't return true) and inactivated (so that the text is dimmed, the
editText cannot be edited, and mouse clicks in the item are interpreted the
same as mouse clicks in the blank part of the dialog box) in a modeless dialog
box.

I have been able to get the items disabled using ResEdit, but I have not
been able to inactivate them.  I have been using HiliteControl to inactivate
chkCtrl and radCtrl items.  Is there an equivalent procedure for statText
and editText items?

-- 
|Mark J. Steiglitz          |Bitnet: steig@crnlthry, araj@crnlvax5            |
|USnail: 66 Steiglitz Road  |Arpanet: steig@tcgould.tn.cornell.edu            |
|        Liberty, NY  12754 |         araj@vax5.ccs.cornell.edu               |
|                           |Usenet: steig@batcomputer.tn.cornell.edu.uucp    |

han@apple.UUCP (06/05/87)

In article <1271@batcomputer.tn.cornell.edu>, steig@batcomputer.tn.cornell.edu (Mark J. Steiglitz) writes:
> 
> I want some statText and editText items disabled (so that DialogSelect
> doesn't return true) and inactivated (so that the text is dimmed, the
> editText cannot be edited, and mouse clicks in the item are interpreted the
> same as mouse clicks in the blank part of the dialog box) in a modeless dialog
> box.
> 
> I have been able to get the items disabled using ResEdit, but I have not
> been able to inactivate them.  I have been using HiliteControl to inactivate
> chkCtrl and radCtrl items.  Is there an equivalent procedure for statText
> and editText items?

Controls can be deactivate.  Text cannot.  You may want to go and use
a UserItem for the StatText and EditText items (and allocate your own 
TEHandle for the EditText items) that way you get more control over
fonts and sizes and styles.


=====================================================================
Byron Han            |   UUCP:  {sun,voder,nsc,mtxinu,dual}!apple!han
Apple Computer, Inc. |  CSNET: han@apple.csnet 
20525 Mariani Ave,   | ATTNet: 408-973-6450
Cupertino, CA 95014  |  GENIE: BYRONHAN
MS 27Y               | CSERVE: 72167,1664
=====================================================================
All opinions and statements do not necessarily represent those of my
employer, Apple Computer Inc.
=====================================================================

lsr@apple.UUCP (06/06/87)

In article <935@apple.UUCP> han@apple.UUCP (Byron Han) writes:
>In article <1271@batcomputer.tn.cornell.edu>, steig@batcomputer.tn.cornell.edu (Mark J. Steiglitz) writes:
>> 
>> I want some statText and editText items disabled (so that DialogSelect
>> doesn't return true) and inactivated (so that the text is dimmed, the
>> editText cannot be edited, and mouse clicks in the item are interpreted the
>
>Controls can be deactivate.  Text cannot.  You may want to go and use
>a UserItem for the StatText and EditText items (and allocate your own 
>TEHandle for the EditText items) that way you get more control over
>fonts and sizes and styles.

More specifically, you can get grayed text by painting over the text with a
gray pattern in patBic (pattern bit clear) mode.  This is what the Menu
Manager uses to gray out a menu item.

You should be able to define a userItem on top of your text item, which
simply draws a gray rectangle (if necessary).  That way you can use the
Dialog Manager for the text editing, but gray out the text when necessary.

(I haven't tried this out, so you may have to experiment with the ordering
of the dialog items so that the gray rectangle is drawn after the text.)

-- 
Larry Rosenstein

Object Specialist
Apple Computer

AppleLink: Rosenstein1
UUCP:  {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.com