[comp.sys.mac.programmer] Highlighting

djvelleman@amherst.bitnet (09/27/90)

  Is there a routine I can call to highlight a region on the screen the way
TextEdit does--using the user-selected highlighting color on a Mac II, and
inverting black and white on other Macs?  If not, how can I find out what the
users-selected highlighting color is?
  Are there user interface guidelines for this?  Is it only supposed to be used
for straight text, editable in the usual way, or can it be used for other
kinds of selections?
  Dan Velleman
  Math Dept.
  Amherst College

cc100aa@prism.gatech.EDU (Ray Spalding) (09/28/90)

In article <10290.2701c468@amherst.bitnet> djvelleman@amherst.bitnet writes:
>  Is there a routine I can call to highlight a region on the screen the way
>TextEdit does--using the user-selected highlighting color on a Mac II, and
>inverting black and white on other Macs?

I do the following (MPW 2.0.1 C):

#define	hiliteMode	0x938
#define	pHiliteBit	0

HiliteRgn(h)
	RgnHandle h;
{

	if ((*h)->rgnBBox.right - (*h)->rgnBBox.left > 1)
			BitClr((Ptr)hiliteMode,pHiliteBit);
	InvertRgn(h);
}

-- 
Ray Spalding, Technical Services, Office of Information Technology
Georgia Institute of Technology, Atlanta Georgia, 30332-0275
uucp:     ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!cc100aa
Internet: cc100aa@prism.gatech.edu

russotto@eng.umd.edu (Matthew T. Russotto) (09/28/90)

In article <10290.2701c468@amherst.bitnet> djvelleman@amherst.bitnet writes:
>
>  Is there a routine I can call to highlight a region on the screen the way
>TextEdit does--using the user-selected highlighting color on a Mac II, and
>inverting black and white on other Macs?  If not, how can I find out what the
>users-selected highlighting color is?
>  Are there user interface guidelines for this?  Is it only supposed to be used
>for straight text, editable in the usual way, or can it be used for other
>kinds of selections?

Check out Inside Mac, Vol V-- it's called hiliteBit or something like that.
(yes, its in (horrors) a low memory global).

I wouldn't use it for color icons, but it seems reasonable to do it for
black and white ones (not sure what Human Interface has to say)
--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
      .sig under construction, like the rest of this campus.

stanbach@Apple.COM (Francis Stanbach) (09/29/90)

Yes, look at Inside Macintosh Volume V pp. 61-2.

Francis

In article <10290.2701c468@amherst.bitnet> djvelleman@amherst.bitnet writes:
>
>  Is there a routine I can call to highlight a region on the screen the way
>TextEdit does--using the user-selected highlighting color on a Mac II, and
>inverting black and white on other Macs?  If not, how can I find out what the
>users-selected highlighting color is?
>  Are there user interface guidelines for this?  Is it only supposed to be used
>for straight text, editable in the usual way, or can it be used for other
>kinds of selections?
>  Dan Velleman
>  Math Dept.
>  Amherst College


-- 
wmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwm
Francis Stanbach                          Finder Engineer Apple Computer, Inc.
wmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwm