[comp.sys.mac.programmer] How to highlight icons in modal dialogs?

milikich@iccgcc.decnet.ab.com (Mike Milikich, Allen-Bradley Company) (11/28/90)

I am trying to highlight one of a pair of icons in a modal dialog, just like
chooser does for selecting the serial port for Imagewriter configuration. First,
it seems like I will have to re-paint the selected icon after every call to
ModalDialog, since it redraws the whole thing. Is this true? Secondly, what is
the best way to do the highlighting? A call to InvertRect doesn't seem to work
consistently. Does anyone have advice or sample code they can share? If this is
too elementary a problem, you can reply to me directly. Thanks...

Mike

-- 
--------------------------------------------------------------------------------
| milikich%iccgcc.decnet@consrt.rok.com |"...and the men who hold high places  |
| allen-bradley company                 | must be the ones to start..."        |
| 747 alpha drive                       |--------------------------------------|
| highland heights, ohio  44143         | I don't speak for A-B,               |
| (216) 646-3494  FAX : (216) 646-4343  | and I know they don't speak for me.  |
--------------------------------------------------------------------------------

hairston@henry.ece.cmu.edu (David Hairston) (11/30/90)

[milikich@iccgcc.decnet.ab.com (Mike Milikich, Allen-Bradley Company) writes:]

[] I am trying to highlight one of a pair of icons in a modal dialog, just
[] like chooser does for selecting the serial port for Imagewriter
[] configuration. First, it seems like I will have to re-paint the selected
[] icon after every call to ModalDialog, since it redraws the whole thing.
[] Is this true? Secondly, what is the best way to do the highlighting?
[] A call to InvertRect doesn't seem to work consistently. Does anyone have
[] advice or sample code they can share? If this is too elementary a problem,
[] you can reply to me directly. Thanks...

if the icon is a dialog item of your modal dialog then you'll need to keep
track of its "inverse" state (i.e. re/set a flag to indicate when you've
inverted the icon and remember to clear the flag when the modal dialog
updates since it redraws a fresh window).

you might also consider reserving space on the modal dialog with icon-
sized userItems and then doing the appropriate drawing yourself.

hope this helps some ...

  -dave-  
hairston@henry.ece.cmu.edu