🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.mac.sources
Article #3

MarqueeRect.c

#3
From: Paul DuBois
Date: Thu, 10 Jul 1986 13:55
31 lines
1415 bytes
The procedure below can be used to achieve a marquee effect - that is,
the rectangle is framed with a dashed line, where the dashes move.
To use it, set up a rectangle, then call MarqueeRect repeatedly to
achieve the effect of motion.  A generalization to MarqueeRgn for
regions is straightforward.

The procedure is written in LightspeedC.

---
/* include a QuickDraw header file here */

Pattern		marqueePat = { 0x0f, 0x87, 0xc3, 0xe1, 0xf0, 0x78, 0x3c, 0x1e };


MarqueeRect (r)
Rect	*r;
{
PenState	p;
Byte		b;
int			i;

	GetPenState (&p);
	PenPat (marqueePat);
	PenMode (patCopy);
	FrameRect (r);
	SetPenState (&p);
	b = marqueePat[0];		/* shift pattern up for next call */
	for (i = 0; i < 7; ++i)		/* (could shift sideways instead) */
		marqueePat[i] = marqueePat[i+1];
	marqueePat[7] = b;
}
Technical Details
Message-ID: <1345@felix.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!seismo!lll-crg!lll-lcc!pyramid!hplabs!felix!macintosh

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!seismo!lll-crg!lll-lcc!pyramid!hplabs!felix!macintosh
From: dubois@uwmacc.UUCP (Paul DuBois)
Newsgroups: mod.mac.sources
Subject: MarqueeRect.c
Message-ID: <1345@felix.UUCP>
Date: Thu, 10-Jul-86 09:55:40 EDT
Article-I.D.: felix.1345
Posted: Thu Jul 10 09:55:40 1986
Date-Received: Fri, 11-Jul-86 08:25:32 EDT
Sender: macintosh@felix.UUCP
Reply-To: macintosh@felix.UUCP (The Moderator)
Organization: FileNet Corp., Costa Mesa, CA
Lines: 31
Approved: bytebug@felix.UUCP (Roger L. Long)