home *** CD-ROM | disk | FTP | other *** search
- /* *****************************************************************************
- FILE: Display.c
-
- DESCRIPTION: Drawing functions
-
- AUTHOR: Kurt W.G. Matthies
-
- Copyright © 1990 by Code of the West, Inc. All Rights Reserved.
-
- Revision History:
- ==========================================================
- 4.26.90 - June 1990 MacUser Release (modified for multiple windows)
- 3.30.90 - May 1990 MacUser Release
- ==========================================================
-
- ***************************************************************************** */
- #include "AppGlobals.h"
-
- #include "WindowUtilPr.h"
- #include "DisplayPr.h"
-
- /*---------------------------------------------------------------------------------
- drawDocContents - draw the contents of theDoc - you can put your own drawing
- 4.24.90kwgm routine in here
- ----------------------------------------------------------------------------------*/
- void
- drawDocContents (theDoc)
- DocPtr theDoc;
- {
- register short len, portWidth, strWidth, height, lineHeight, portHeight;
- FontInfo fInfo;
- Rect frameRect;
- Str255 aStr;
-
- setFrameClip (theDoc, &frameRect); /* set clip to frame area */
-
- GetFontInfo (&fInfo); /* get font information */
- GetWTitle (theDoc, aStr); /* get window title */
-
- len = height = 0;
- lineHeight = fInfo.ascent + fInfo.descent + fInfo.leading; /* from font info */
-
- /* get the size of the drawing area */
- portWidth = frameRect.right - frameRect.left;
- portHeight = frameRect.bottom - frameRect.top;
-
- strWidth = StringWidth (aStr); /* get string width in pixels */
-
- MoveTo (0, lineHeight);
- while (height < portHeight) /* fill drawing are with string */
- {
- while (len < portWidth)
- {
- DrawString (aStr);
- len += strWidth;
- }
-
- len = 0;
- height += lineHeight;
-
- MoveTo (0, height);
- }
-
- } /* drawDocContents */
-
- /* =============================== EOF =======================================
- Copyright © 1990 by Code of the West, Inc. All Rights Reserved.
- ================================================================================ */
-