home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
fonts
/
fontshow.sit
/
globals.Pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-09-09
|
3KB
|
55 lines
UNIT Globals(1);
{$U-}
{$D+}
(* This unit contains global variables for the FontShow program *)
(* Version 1.0 by Richard Clark, September 1988 *)
INTERFACE
USES MemTypes, QuickDraw, OSIntf, ToolIntf;
VAR
DragLimits, (* Where are we allowed to drag windows? *)
SizeLimits : Rect; (* What are the resizing bounds on our windows? *)
Quit : Boolean; (* Has Quit been selected? *)
WindowReserve : Ptr; (* This variable is used to reserve memory for the NEXT *)
(* window to be opened. (See programming notes) *)
currFont, (* The current font and size, as determined by the Font *)
currSize : INTEGER; (* and Size menus. *)
AboutWindow : WindowPtr; (* A pointer to our ╥About╙ window (since we only have one) *)
CurrFreeMem : LONGINT; (* The current amount of memory available (as reported by *)
(* FreeMem) *)
PROCEDURE InitGlobals; (* Set up the values of the above globals *)
PROCEDURE SafetyNet; (* If there is a System Error, this is our "resume" procedure *)
IMPLEMENTATION
PROCEDURE InitGlobals;
(* This procedure sets up the initial values of the above global variables *)
BEGIN
DragLimits := ScreenBits.bounds;
InsetRect(DragLimits, 20, 20); (* Don't let windows get any closedr than 20 pixels from *)
SizeLimits := DragLimits; (* the edge of the screen. Also, don't let them get any *)
(* smaller than 20 x 20 pixels, and no larger than *)
(* (screenSize - 40 pixels) *)
windowReserve := NIL; (* Show that we don't have any memory pre-allocated for *)
(* windows yet. *)
AboutWindow := NIL; (* No ╥About╙ window yet *)
Quit := FALSE; (* No need to quit, as we just started *)
currFont := 1; (* Use the ╥Application Font╙ (typically Geneva) initially *)
currSize := 12; (* 12 points seems to be a reasonable size *)
END; (* InitGlobals *)
PROCEDURE SafetyNet;
(* This is the "resume" procedure which is called if a System Error occurs and the user presses *)
(* the "resume" button. It has to be in the same segment as our main loop so it will never be *)
(* unloaded from memory. *)
(* This procedure is referenced from the Initialization segment. *)
BEGIN
ExitToShell; (* try to return to the Finder if an error occurs *)
END; (* safetyNet *)
END.