From: cklarson@taquito.engr.ucdavis.edu (Christopher Klaus Larson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Dimming dialog items/controls.  How?
Date: 6 Nov 92 22:21:25 GMT
Organization: College of Engineering - University of California - Davis

In article <chuck-031192125135@choffman.gte.com> chuck@gte.com (Chuck Hoffman) writes:
>In article <1992Nov03.151803.19448@bnr.ca>, brunner@crchh447.bnr.ca (James
>Brunner) wrote:
>> 
>> This may be a stupid question, but how do you dim an item in a dialog box?
>> (Specifically check boxes and radio buttons).  I have tried enabling/disabling
>> the items like:
>> 
>> [... code for enabling/disabling the item ...]
>> 
>> I have also tried having some items disabled using ResEdit to set/clear the
>> "enabled" bit.
>> 
>> But, neither of these methods dim the item.  They only stop it from getting
>> clicks.  What am I doing wrong?  Thanks.  Please respond by e-mail.

Enabling/Disabling an item only determines whether ModalDialog will
return if the item is hit -- it does not effect the item's appearence
or other functions. For example, most editText items are disabled. This
means that the user can type into the item without ModalDialog returning
mouseDowns or keyHits in the item. See the Dialog Manager chapter in IM I
for further information.

>
>Try using HiliteControl function of the Control Manager.  I've not tried
>HiliteControl with the Dialog Manager, but it might work.  Let me know.
>

Use GetDItem to obtain a handle to the control, coerce the handle to type
ControlHandle and call HiliteControl with a hiliteValue of $FF. In THINK C:

  GetDItem (the_dialog,item_number,&item_type,&item_handle,&item_rect);
  HiliteControl ((ControlHandle)item_handle,0xFF);

This method will only work for controls (so check boxes and radio buttons
are ok), hence the name HiliteControl.
                              ^^^^^^^
HiliteControl is described in the Control Manager section of IM I.

--Chris
cklarson@engr.ucdavis.edu

Newsgroups: comp.sys.mac.programmer
Subject: Re: Dimming dialog items/controls.  How?
Summary: 
Expires: 
Followup-To: 
Distribution: 
Organization: College of Engineering - University of California - Davis
Keywords: 

In article <chuck-031192125135@choffman.gte.com> chuck@gte.com (Chuck Hoffman) writes:
>In article <1992Nov03.151803.19448@bnr.ca>, brunner@crchh447.bnr.ca (James
>Brunner) wrote:
>> 
>> This may be a stupid question, but how do you dim an item in a dialog box?
>> (Specifically check boxes and radio buttons).  I have tried enabling/disabling
>> the items like:
>> 
>> [... code for enabling/disabling the item ...]
>> 
>> I have also tried having some items disabled using ResEdit to set/clear the
>> "enabled" bit.
>> 
>> But, neither of these methods dim the item.  They only stop it from getting
>> clicks.  What am I doing wrong?  Thanks.  Please respond by e-mail.
>
>Try using HiliteControl function of the Control Manager.  I've not tried
>HiliteControl with the Dialog Manager, but it might work.  Let me know.
>

Use GetDItem to obtain a handle to the control, coerce the handle to type
ControlHandle and call HiliteControl with a hiliteValue of $FF. In THINK C:

  GetDItem (the_dialog,item_number,&item_type,&item_handle,&item_rect);
  HiliteControl ((ControlHandle)item_handle,0xFF);

This method will only work for controls (so check boxes and radio buttons
are ok), hence the name HiliteControl.
                              ^^^^^^^
HiliteControl is described in the Control Manager section of IM I.

--Chris
cklarson@engr.ucdavis.edu
Newsgroups: comp.sys.mac.programmer