home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
lang
/
skel_azt.sha
/
redraw.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-07-08
|
2KB
|
65 lines
/*
* redraw.c -- display the contents of this window again
*/
#include <quickdraw.h>
#include <control.h>
#include <textedit.h>
#include "qdv.h"
#include "def.h"
void
redraw(i)
int i; /* index of window pointer */
{
extern QDVar *QD;
extern ControlHandle hscroll[NWINDOWS];
extern TEHandle hTE;
extern Rect r;
extern Point tlp[NWINDOWS]; /* top left of destRect */
extern ControlHandle vscroll[NWINDOWS];
extern WindowPtr wp[NWINDOWS];
/* make grow icon, make scroll bars, fill window */
/* caution -- changing the order of drawing the window parts or
* the clip boundaries may cause a continuous loop of update
* events, redrawing the scroll bars. Avoiding such "flicker"
* and the lockout of other events is a tricky facet of having
* multiple scrollable windows that doesn't show up in the
* simpler example programs.
*/
ClipRect(&wp[i]->portRect);
DrawGrowIcon(wp[i]);
if (wp[i] == FrontWindow())
DrawControls(wp[i]);
else {
FillRect(&(*vscroll[i])->contrlRect, &QD->white);
FillRect(&(*hscroll[i])->contrlRect, &QD->white);
FrameRect(&(*vscroll[i])->contrlRect);
FrameRect(&(*hscroll[i])->contrlRect);
};
BlockMove(&wp[i]->portRect, &r, (long)sizeof(Rect));
r.bottom -= 15;
r.right -= 15;
ClipRect(&r);
if (i == 1 && hTE) { /* TEScroll kept track of scrolling */
EraseRect(&r);
TEUpdate(&r, hTE);
}
else if (i == 0) { /* explicitly keep track of scrolling */
SetOrigin(tlp[0].h, tlp[0].v);
OffsetRgn(wp[0]->clipRgn, tlp[0].h, tlp[0].v);
drawgraf();
SetOrigin(0, 0);
};
ClipRect(&wp[i]->portRect); /* if the scroll and grow parts of the
* window are clipped, moving
* overlapping windows will leave
* "holes" in them
*/
} /* end of redraw */