{--------------------------------------------}
{------------ File MQPlot.p ----------------}
{--------------------------------------------}
{$P}
{MQPlot.p}
{Copyright © 1989 by Charles F. McMath All rights reserved.}
{ This is the main program for the MacApp
plotter application. The original plotter was
written by Dave Smith and Dave Kelly for MacTutor
Magazine. This coversion was done by Chuck
McMath to demonstrate the same program done using
MacApp. It also hopefully demonstrates some of
the strengths of MacApp!
)
PROGRAM QPlot;
USES
{ • MacApp }
UMacApp,
{ • Building Blocks }
UDialog, UPrinting,
{ • Implementation Use }
SANE, ToolUtils, Fonts, Resources, Script,
PickerIntf, Packages,
{ • the PlotUNIT }
UQPlot;
VAR
gQPlotApplication: TQPlotApplication;
BEGIN
InitUMacApp(5);
InitUDialog;
InitPrinting;
New(gQPlotApplication);
gQPlotApplication.
IQPlotApplication(kFileType);
gQPlotApplication.Run;
END.
{--------------------------------------------}
{------------ File UQPlot.p ----------------}
{--------------------------------------------}
{Copyright © 1989 by Charles F. McMath.
All rights reserved.}
UNIT UQPlot;
INTERFACE
USES
{ • MacApp - this includes all of the
things necessary from the MacApp Library }
UMacApp,
{ • Building Blocks }
UDialog, UPrinting,
{ • Implementation Use }
SANE, ToolUtils, Fonts, Resources, Script,
PickerIntf, Packages;
CONST
kSignature = ‘FGT3’; {Appl. signature}
kFileType = ‘PICT’; {our filetype }
kQPlotWindowID = 1001;
TYPE
TQPlotApplication = OBJECT(TApplication)
fDefGraph: INTEGER; { Graph color index }
fDefAxis: INTEGER; { Axis color index }
fDefBack: INTEGER; { Back color index }
fPrintOpt: INTEGER; { Page/Window size }
PROCEDURE TQPlotApplication.
IQPlotApplication
(itsMainFileType:OSType);
FUNCTION TQPlotApplication.DoMakeDocument
(itsCmdNumber:CmdNumber): TDocument;
OVERRIDE;
PROCEDURE TQPlotApplication.
HandleFinderRequest; OVERRIDE;
PROCEDURE TQPlotApplication.DoSetupMenus;
OVERRIDE;
FUNCTION TQPlotApplication.DoMenuCommand
(aCmdNumber: CmdNumber): TCommand;
OVERRIDE;
PROCEDURE TQPlotApplication.ShowAboutApp;
END;
TQPlotDocument = OBJECT(TDocument)
fAParam: Real; { these parameters }
fBParam: Real; { correspond }
{ to those }
fCParam: Real; { in the quadratic }
fStep: Real; { equation. }
fXScale: INTEGER; { X axis scale }
fYScale: INTEGER; { Y axis scale }
fResult: INTEGER; { real results? }
fRoot1: REAL; { first root }
fRoot2: REAL; { second root }
fPlotView: TQPlotView;
PROCEDURE TQPlotDocument.IQPlotDocument
(itsFileType, itsCreator: OSType;
usesDataFork, usesRsrcFork: BOOLEAN;
keepsDataOpen, keepsRsrcOpen:
BOOLEAN);
PROCEDURE TQPlotDocument.DoMakeWindows;
OVERRIDE;
PROCEDURE TQPlotDocument.DoMakeViews
(forPrinting: BOOLEAN); OVERRIDE;
PROCEDURE TQPlotDocument.PosePlotDialog;
PROCEDURE TQPlotDocument.Quad
(a, b, c : REAL;VAR x1, x2 : REAL;
VAR result : INTEGER);
FUNCTION TQPlotDocument.SolveIt
(a, b, c: REAL; VAR x1, x2: REAL):
INTEGER;
PROCEDURE TQPlotDocument.DoNeedDiskSpace
(VAR dataForkBytes,
rsrcForkBytes: LONGINT); OVERRIDE;
PROCEDURE TQPlotDocument.DoWrite
(aRefNum: INTEGER;
makingCopy: BOOLEAN); OVERRIDE;
END;
TQPlotView = OBJECT(TView)
fPlotDoc: TQPlotDocument; { link to doc }
fOnePage: BOOLEAN; { if TRUE, page size }
fDrawing: PicHandle; { our picture! }
PROCEDURE TQPlotView.IQPlotView
(theDoc: TQPlotDocument;
theGrafColor, theAxisColor,
theBackColor: INTEGER);
PROCEDURE TQPlotView.Free; OVERRIDE;
PROCEDURE TQPlotView.CalcMinSize
(VAR minSize: VPoint); OVERRIDE;
PROCEDURE TQPlotView.DoSetupMenus;
OVERRIDE;
FUNCTION TQPlotView.DoMenuCommand
(aCmdNumber: CmdNumber): TCommand;
OVERRIDE;
PROCEDURE TQPlotView.PrQDStuff
(pRect : rect; QDdevice : integer);
PROCEDURE TQPlotView.SuperViewChangedSize
(delta: VPoint;
invalidate: BOOLEAN); OVERRIDE;
PROCEDURE TQPlotView.Resize
(width, height: VCoordinate;
invalidate: BOOLEAN); OVERRIDE;
PROCEDURE TQPlotView.Draw(area: Rect); OVERRIDE;
END;
IMPLEMENTATION
{$I UQPlot.inc1.p}
END.
{--------------------------------------------}
{---------- File UQPlot.inc1.p --------------}
{--------------------------------------------}
{Copyright © 1989 by Charles F. McMath.
All rights reserved.}
CONST
kPlotWindowID = 1001;
kPlotDLOG = 2000;
kPlotID = ‘PPRM’;
kStaggerAmt = 16;
{ these are command numbers }
cGraphColor = 1201;
cAxisColor = 1202;
cBackColor = 1203;
cGrafBlack = 10001;
cGrafWhite = 10002;
cGrafRed = 10003;
cGrafGreen = 10004;
cGrafBlue = 10005;
cGrafCyan = 10006;
cGrafMagenta = 10007;
cGrafYellow = 10008;
cAxisBlack = 11001;
cAxisWhite = 11002;
cAxisRed = 11003;
cAxisGreen = 11004;
cAxisBlue = 11005;
cAxisCyan = 11006;
cAxisMagenta = 11007;
cAxisYellow = 11008;
cBackBlack = 12001;
cBackWhite = 12002;
cBackRed = 12003;
cBackGreen = 12004;
cBackBlue = 12005;
cBackCyan = 12006;
cBackMagenta = 12007;
cBackYellow = 12008;
cPrintWS = 1301;
cPrintPS = 1302;
(*
* The following constants relate to DLOG
* and ALRT numbers.
*)
kAboutDLOG = 1024; { our about box }
VAR
gStaggerCount: INTEGER;
colors: ARRAY [1..8] OF INTEGER;
crString: Str255;
{------------------------------------------------}
FUNCTION Int2Str(theInt: INTEGER): Str255;
(*
* This utility function takes an integer and
* converts it into a string.
*)
VAR
tempLong: LongInt;
tempStr: Str255;
BEGIN
tempLong := theInt;
NumToString(tempLong, tempStr);
Int2Str := tempStr;
END; { Int2Str }
{------------------------------------------------}
FUNCTION Real2String(theReal: REAL;
numDigits: INTEGER): Str255;
(*
* This function takes a real number,
* and converts it to a string with
* the specified number of digits PAST the
* decimal point.
*)
VAR
theForm: DecForm;
xTemp: Extended;
tempStr: DecStr;
BEGIN
theForm.style := FixedDecimal;
theForm.digits := numDigits;
xTemp := theReal;
Num2Str(theForm, xTemp, tempStr);
Real2String := tempStr;
END; { Real2String }
{------------------------------------------------}
FUNCTION String2Real(theString: Str255): REAL;
(*
* This function takes a string form of a real
* number, and converts it into the real number.
*)
VAR
xTemp: Extended;
BEGIN
xTemp := Str2Num(theString);
String2Real := Num2Real(xTemp);
END; { String2Real }
{------------------------------------------------}
{------ QPlot Application Methods ------------}
{------------------------------------------------}
PROCEDURE TQPlotApplication.IQPlotApplication
(itsMainFileType: OSType);
(*
* This procedure initializes the application.
* It sets up all of our global variables and
* fills the color index array.
*)
VAR
aQPlotView: TQPlotView;
BEGIN
IApplication(itsMainFileType);
crString[0] := CHR(1);
crString[1] := CHR(13);
colors[1] := 33; { black }
colors[2] := 30; { white }
colors[3] := 205; { red }
colors[4] := 341; { green }
colors[5] := 409; { blue }
colors[6] := 273; { cyan }
colors[7] := 137; { magenta }
colors[8] := 69; { yellow }
fDefGraph := colors[3];
fDefAxis := colors[1];
fDefBack := colors[2];
fPrintOpt := 1;
gStaggerCount := 0;
END; { TQPlotApplication.IQPlotApplication }
{------------------------------------------------}
FUNCTION TQPlotApplication.DoMakeDocument
(itsCmdNumber: CmdNumber): TDocument;
OVERRIDE;
(*
* This function is called whenever we’re
* creating a new document. It creates the
* document object and returns it (properly
* initialized, of course).
*)
VAR
aQPlotDocument: TQPlotDocument;
BEGIN
New(aQPlotDocument);
FailNil(aQPlotDocument);
aQPlotDocument.IQPlotDocument
(kFileType, kSignature,
kUsesDataFork, NOT kUsesRsrcFork,
NOT kDataOpen, NOT kRsrcOpen);
aQPlotDocument.fSavePrintInfo := FALSE;
DoMakeDocument := aQPlotDocument;
END; { TQPlotApplication.DoMakeDocument }
{------------------------------------------------}
PROCEDURE TQPlotApplication.HandleFinderRequest;
OVERRIDE;
BEGIN
{ just override this so we don’t put up a
blank document }
END; { TQPlotApplication.HandleFinderRequest }
{------------------------------------------------}
PROCEDURE TQPlotApplication.DoSetupMenus;
OVERRIDE;
(*
* This procedure enables the appropriate menu
* items for the application.
*)
BEGIN
INHERITED DoSetupMenus;
Enable(cGraphColor, TRUE);
Enable(cAxisColor, TRUE);
Enable(cBackColor, TRUE);
(*
* Enable all of these, and put a check by
* the current one.
*)
EnableCheck(cGrafBlack, TRUE,
fDefGraph=colors[1]);
EnableCheck(cGrafWhite, TRUE,
fDefGraph=colors[2]);
EnableCheck(cGrafRed, TRUE,
fDefGraph=colors[3]);
EnableCheck(cGrafGreen, TRUE,
fDefGraph=colors[4]);
EnableCheck(cGrafBlue, TRUE,
fDefGraph=colors[5]);
EnableCheck(cGrafCyan, TRUE,
fDefGraph=colors[6]);
EnableCheck(cGrafMagenta, TRUE,
fDefGraph=colors[7]);
EnableCheck(cGrafYellow, TRUE,
fDefGraph=colors[8]);
EnableCheck(cAxisBlack, TRUE,
fDefAxis=colors[1]);
EnableCheck(cAxisWhite, TRUE,
fDefAxis=colors[2]);
EnableCheck(cAxisRed, TRUE,
fDefAxis=colors[3]);
EnableCheck(cAxisGreen, TRUE,
fDefAxis=colors[4]);
EnableCheck(cAxisBlue, TRUE,
fDefAxis=colors[5]);
EnableCheck(cAxisCyan, TRUE,
fDefAxis=colors[6]);
EnableCheck(cAxisMagenta, TRUE,
fDefAxis=colors[7]);
EnableCheck(cAxisYellow, TRUE,
fDefAxis=colors[8]);
EnableCheck(cBackBlack, TRUE,
fDefBack=colors[1]);
EnableCheck(cBackWhite, TRUE,
fDefBack=colors[2]);
EnableCheck(cBackRed, TRUE,
fDefBack=colors[3]);
EnableCheck(cBackGreen, TRUE,
fDefBack=colors[4]);
EnableCheck(cBackBlue, TRUE,
fDefBack=colors[5]);
EnableCheck(cBackCyan, TRUE,
fDefBack=colors[6]);
EnableCheck(cBackMagenta, TRUE,
fDefBack=colors[7]);
EnableCheck(cBackYellow, TRUE,
fDefBack=colors[8]);
END; { TQPlotApplication.DoSetupMenus }
{------------------------------------------------}
FUNCTION TQPlotApplication.DoMenuCommand
(aCmdNumber: CmdNumber): TCommand;
OVERRIDE;
(*
* This function handles menu requests that
* pertain to the application. It ensures that
* choices that change colors work correctly.
*)
BEGIN
DoMenuCommand := gNoChanges;
CASE aCmdNumber OF
cAboutApp: ShowAboutApp;
cGrafBlack,
cGrafWhite,
cGrafRed,
cGrafGreen,
cGrafBlue,
cGrafCyan,
cGrafMagenta,
cGrafYellow:
fDefGraph := colors[aCmdNumber -
cGrafBlack + 1];
cAxisBlack,
cAxisWhite,
cAxisRed,
cAxisGreen,
cAxisBlue,
cAxisCyan,
cAxisMagenta,
cAxisYellow:
fDefAxis := colors[aCmdNumber -
cAxisBlack + 1];
cBackBlack,
cBackWhite,
cBackRed,
cBackGreen,
cBackBlue,
cBackCyan,
cBackMagenta,
cBackYellow:
fDefBack := colors[aCmdNumber -
cBackBlack + 1];
cPrintWS,
cPrintPS:
fPrintOpt := aCmdNumber -
cPrintWS + 1;
OTHERWISE
DoMenuCommand := INHERITED
DoMenuCommand(aCmdNumber);
END; { case }
END; { TQPlotApplication.DoMenuCommand }
{------------------------------------------------}
PROCEDURE DrawBox(wPtr: WindowPtr; itemNum: INTEGER);
(*
* This procedure is the UserItem proc that
* gets called for the about box.
*)
VAR
ityp: INTEGER;
itemHdl: Handle;
tRect: Rect;
BEGIN
GetDItem(DialogPtr(wPtr), 5, ityp, itemHdl, tRect);
FrameRect(tRect);
END; { DrawBox }
{------------------------------------------------}
PROCEDURE TQPlotApplication.ShowAboutApp;
(*
* Show our about box. This version is almost
* identical to the original, except for the
* addition of some stuff about MacApp
* (incidentally, this is required by the license
* agreement for programs developed with MacApp!)
*)
VAR
idStrHandle: StringHandle;
freeSpace: Size;
myHeapSpace: LongInt;
tempStr1: Str255;
tempStr2: Str255;
tempStr3: Str255;
diaPtr: DialogPtr;
itemHit: INTEGER;
ityp: INTEGER;
itemHdl: Handle;
tRect: Rect;
BEGIN
idStrHandle :=
StringHandle(GetResource(kSignature, 0));
FailNIL(idStrHandle);
MoveHHi(Handle(idStrHandle));
HLock(Handle(idStrHandle));
freeSpace := FreeMem;
myHeapSpace := MaxMem(freeSpace);
NumToString(myHeapSpace, tempStr2);
tempStr2 := concat(‘Memory = ‘, tempStr2);
tempStr3 := ‘’;
tempStr1 := ‘’;
ParamText(idStrHandle^^, tempStr1, tempStr2, tempStr3);
diaPtr := GetNewDialog(kAboutDLOG, NIL, Pointer(-1));
FailNIL(diaPtr);
GetDItem(diaPtr, 5, ityp, itemHdl, tRect);
SetDItem(diaPtr, 5, ityp, Handle(@DrawBox), tRect);
InitCursor;
ModalDialog(NIL, itemHit);
DisposDialog(diaPtr);
HUnlock(Handle(idStrHandle));
END; { TQPlotApplication.ShowAboutApp }
{------------------------------------------------}
{-------- QPlot Document Methods ------------}
{------------------------------------------------}
PROCEDURE TQPlotDocument.IQPlotDocument
(itsFileType, itsCreator: OSType;
usesDataFork, usesRsrcFork: BOOLEAN;
keepsDataOpen, keepsRsrcOpen:
BOOLEAN);
(*
* Initialize the QPlot document. For our
* document, this means that we will present the
* dialog box that asks for the quadratic
* parameters, and we’ll solve the equation while
* we’re here.
*)
VAR
x1, x2: REAL;
BEGIN
IDocument(itsFileType, itsCreator, usesDataFork, usesRsrcFork,
keepsDataOpen, keepsRsrcOpen);
PosePlotDialog;
fResult := SolveIt(fAParam, fBParam,
fCParam, x1, x2);
IF (fResult<>-1) THEN
BEGIN
fRoot1 := x1;
fRoot2 := x2;
END
ELSE
BEGIN
fRoot1 := -999;
fRoot2 := -999
END;
fPlotView := NIL;
END; { TQPlotDocument.IQPlotDocument }
{------------------------------------------------}
PROCEDURE TQPlotDocument.DoMakeWindows; OVERRIDE;
(*
* This procedure is called when we have to
* make a new document (and its associated
* window). We just get a simple window and shove
* it on the screen.
*)
VAR
aWindow: TWindow;
BEGIN
aWindow := NewSimpleWindow(kPlotWindowID,
kWantHScrollBar, kWantVScrollBar, SELF, fPlotView);
aWindow.SimpleStagger(kStaggerAmt,
kStaggerAmt, gStaggerCount);
END; { TQPlotDocument.DoMakeWindows }
{------------------------------------------------}
PROCEDURE TQPlotDocument.DoMakeViews
(forPrinting: BOOLEAN); OVERRIDE;
(*
* This procedure is called when we are making
* a new document. It creates all views that are
* needed. In our case, it’s only one. We then
* initialize the view.
*)
VAR
plotApp: TQPlotApplication;
aQPlotView: TQPlotView;
aHandler: TStdPrintHandler;
tRect: Rect;
BEGIN
plotApp := TQPlotApplication(gApplication);
NEW(aQPlotView);
FailNIL(aQPlotView);
aQPlotView.IQPlotView(SELF,
plotApp.fDefGraph, plotApp.fDefAxis,
plotApp.fDefBack);
fPlotView := aQPlotView;
(*
* Now make the view printable by creating a
* print handler.
*)
IF NOT(forPrinting) THEN
BEGIN
New(aHandler);
FailNIL(aHandler);
aHandler.IStdPrintHandler(SELF,
aQPlotView, FALSE, TRUE, TRUE);
{ set up for 1/2" margins }
SetRect(tRect,35,35,-35,-35);
aHandler.InstallMargins(tRect, FALSE);
END;
END; { TQPlotDocument.DoMakeViews }
{------------------------------------------------}
PROCEDURE TQPlotDocument.PosePlotDialog;
(*
* This procedure puts up the dialog that
* requests the quadratic parameters.
*)
FUNCTION CvtEditReal(aText: TEditText):
Real;
VAR
tempStr: Str255;
BEGIN
aText.GetText(tempStr);
CvtEditReal := String2Real(tempStr);
END; { CvtEditReal }
FUNCTION CvtEditInt(aText: TEditText):
INTEGER;
VAR
tempStr: Str255;
tempLong: LongInt;
BEGIN
aText.GetText(tempStr);
StringToNum(tempStr, tempLong);
CvtEditInt := tempLong;
END; { CvtEditInt }
VAR
aWindow: TWindow;
dismisser: IDType;
aQPlotView: TQPlotView;
dView: TDialogView;
anEditText: TEditText;
aVal: TEditText;
bVal: TEditText;
cVal: TEditText;
stepVal: TEditText;
xVal: TEditText;
yVal: TEditText;
tempStr: Str255;
BEGIN
(*
* First make our calls (which never get
* executed) to tell the linker we want to create
* these types of objects.
*)
IF gCreateWithTemplates THEN
BEGIN
NEW(aQPlotView);
NEW(dView);
NEW(anEditText);
END;
(*
* Get the dialog window and find the dialog subview.
*)
aWindow := NewTemplateWindow(kPlotDLOG, NIL);
dView := TDialogView(aWindow.
FindSubView(kPlotID));
(*
* Retrieve references to each of the edit
* text items. We will need to reference them
* later to get their values.
*)
aVal := TEditText(dView.FindSubView(‘a ‘));
bVal := TEditText(dView.FindSubView(‘b ‘));
cVal := TEditText(dView.FindSubView(‘c ‘));
stepVal := TEditText(dView.FindSubView(‘step’));
xVal := TEditText(dView.FindSubView(‘xscl’));
yVal := TEditText(dView.FindSubView(‘yscl’));
dView.SelectEditText(‘a ‘, kRedraw);
dismisser := dView.PoseModally;
(*
* Now that we have the values, convert them
* to numbers and plug them into the quadratic
* equation solver. Note that we don’t test to
* see if the OK button was pressed, because in
* this dialog, you can’t exit except by saying
* OK.
*)
fAParam := CvtEditReal(aVal);
fBParam := CvtEditReal(bVal);
fCParam := CvtEditReal(cVal);
fStep := CvtEditReal(stepVal);
fXScale := CvtEditInt(xVal);
fYScale := CvtEditInt(yVal);
aWindow.Close;
END; { TQPlotDocument.PosePlotDialog }
{------------------------------------------------}
PROCEDURE TQPlotDocument.Quad(a, b, c : REAL;
VAR x1, x2 : REAL;
VAR result : INTEGER);
(*
* This procedure is identical to the one
* written in ‘vanilla’ Pascal
*)
VAR check : real;
FUNCTION PositiveCalc
(a, b, check : real) : real;
BEGIN
PositiveCalc := (-b + sqrt(check)) /
(2 * a);
END; { PositiveCalc ---------- }
FUNCTION NegativeCalc
(a, b, check : real) : real;
BEGIN
NegativeCalc := (-b - sqrt(check)) /
(2 * a);
END; { NegativeCalc ---------- }
BEGIN
result := 0;
check := (b * b) - (4 * a * c);
IF result = 0 THEN
BEGIN
{ Check if double root exists }
IF check = 0 THEN
BEGIN
result := 2;
x1 := positivecalc(a, b, check);
x2 := x1;
END;
{ Check if real result}
IF check > 0 THEN
BEGIN
result := 1;
x1 := positivecalc(a, b, check);
x2 := negativecalc(a, b, check);
END;
{ Check if root is complex }
IF check < 0 THEN
BEGIN
result := 3;
check := -check;
x1 := positivecalc(a, b, check);
x2 := negativecalc(a, b, check);
END;
END;
END; { TQPlotDocument.Quad }
{------------------------------------------------}
FUNCTION TQPlotDocument.SolveIt(a, b, c: REAL;
VAR x1, x2: REAL): INTEGER;
(*
* This function is identical to the one
* written for the original program.
*)
VAR
result: INTEGER;
BEGIN
IF (a <> 0) THEN
quad(a, b, c, x1, x2, result)
ELSE
result := -1;
SolveIt := result;
END; { TQPlotDocument.SolveIt }
{------------------------------------------------}
PROCEDURE TQPlotDocument.DoNeedDiskSpace
(VAR dataForkBytes,
rsrcForkBytes: LONGINT); OVERRIDE;
(*
* This procedure calculates the amount of
* disk space we need to store our document on
* disk. In our case, it’s just the size of the
* drawing since no additional information is
* stored in our file.
*)
BEGIN
INHERITED DoNeedDiskSpace(dataForkBytes, rsrcForkBytes);
dataForkBytes := dataForkBytes +
512 { header } +
GetHandleSize(Handle(fPlotView.fDrawing));
END; { TQPlotDocument.DoNeedDiskSpace }
{------------------------------------------------}
PROCEDURE TQPlotDocument.DoWrite(aRefNum: INTEGER;
makingCopy: BOOLEAN); OVERRIDE;
(*
* This procedure is called to write the data
* onto the disk.
*)
VAR
count: LongInt;
buffer: ARRAY [1..256] OF INTEGER;
pHdl: PicHandle;
i: INTEGER;
err: OSErr;
BEGIN
INHERITED DoWrite(aRefNum, makingCopy);
(*
* Now write the blank 512 byte header needed
* for PICT files.
*)
FOR i:= 1 TO 256 DO
buffer[i] := 0;
count := 512;
err := FSWrite(aRefNum, count, @buffer);
IF ((err<>noErr) OR (count<>512)) THEN
SysBeep(10); { @@@ error alert }
pHdl := fPlotView.fDrawing;
HLock(Handle(pHdl));
count := GetHandleSize(Handle(pHdl));
err := FSWrite(aRefNum, count, Ptr(pHdl^));
HUnlock(Handle(pHdl));
IF ((err<>noErr) OR
(count <> GetHandleSize(Handle(pHdl)))) THEN
SysBeep(10); { @@@ error alert }
END; { TQPlotDocument.DoWrite }
{------------------------------------------------}
{---------- QPlot View Methods ----------------}
{------------------------------------------------}
PROCEDURE TQPlotView.IQPlotView(theDoc:
TQPlotDocument; theGrafColor,
theAxisColor, theBackColor: INTEGER);
(*
* This procedure is called to initialize a
* QPlot view. It sets the view’s variables to
* good initial values.
*)
VAR
vOrigin: VPoint;
vSize: VPoint;
tempPort: GrafPtr;
BEGIN
SetVPt(vOrigin, 0, 0);
SetVPt(vSize, 600, 400);
IView(theDoc, NIL, vOrigin, vSize, sizeVariable, sizeVariable);
fPlotDoc := theDoc;
fDrawing := NIL;
fOnePage := FALSE;
END; { TQPlotView.IQPlotView }
{------------------------------------------------}
PROCEDURE TQPlotView.Free; OVERRIDE;
(*
* This procedure is called when the view is
* finished, and we are cleaning up any space we
* have allocated. We just dispose of the picture
* handle.
*)
BEGIN
KillPicture(fDrawing);
INHERITED Free;
END; { TQPlotView.Free }
{------------------------------------------------}
PROCEDURE TQPlotView.CalcMinSize
(VAR minSize: VPoint); OVERRIDE;
(*
* This procedure is called to calculate the
* minimum size of the view. It is called
* initially when the view is being created, and
* later on when we tell the view to recalculate
* its view size.
*)
VAR
vSize: Point;
tWind: TWindow;
tRect: Rect;
BEGIN
INHERITED CalcMinSize(minSize);
IF fOnePage THEN
BEGIN
minSize := fPrintHandler.fViewPerPage;
END
ELSE
BEGIN
IF (fSuperView<>NIL) THEN
minSize := fSuperView.fSize
ELSE
BEGIN
vSize := Point(0);
IF SELF.Focus THEN ;
QDToViewPt(vSize, minSize);
END;
END;
END; { TQPlotView.CalcMinSize }
{------------------------------------------------}
PROCEDURE TQPlotView.DoSetupMenus; OVERRIDE;
(*
* This procedure is called to enable menu
* items that pertain to the view.
*)
BEGIN
INHERITED DoSetupMenus;
EnableCheck(cPrintWS, TRUE, NOT fOnePage);
EnableCheck(cPrintPS, TRUE, fOnePage);
END; { TQPlotView.DoSetupMenus }
{------------------------------------------------}
FUNCTION TQPlotView.DoMenuCommand
(aCmdNumber: CmdNumber): TCommand;
OVERRIDE;
(*
* This function is called to handle menu
* commands that pertain to the view.
*)
VAR
tempVPt: VPoint;
tRect: Rect;
BEGIN
DoMenuCommand := gNoChanges;
IF (aCmdNumber = cPrintWS) OR
(aCmdNumber = cPrintPS) THEN
BEGIN
fOnePage := (aCmdNumber=cPrintPS);
AdjustSize;
END
ELSE
DoMenuCommand :=
INHERITED DoMenuCommand(aCmdNumber);
END; { TQPlotView.DoMenuCommand }
{------------------------------------------------}
PROCEDURE TQPlotView.PrQDStuff(pRect : rect;
QDdevice : integer);
(*
* This is the main drawing procedure for the
* view. It is (almost) unchanged from the
* original version. Since in MacApp you don’t
* know who you’re drawing for (Display vs.
* LaserWriter) most of the display-specific code
* has been deleted. Drawing still works
* correctly, since we erase the invalid
* areas before we draw it.
*)
CONST
Display = 1;
LaserWriter = 2;
ImageWriter = 3;
NoJust = 0;
LeftJust = 1;
CenterJust = 2;
RightJust = 3;
FullJust = 4;
LinesInParagraph = 5;
{selected MacDraw comments}
picDwgBeg = 130;
picDwgEnd = 131;
picGrpBeg = 140;
picGrpEnd = 141;
TextBegin = 150;
TextEnd = 151;
StringBegin = 151;
StringEnd = 153;
TextCenter = 154;
{postscript comments}
SetLineWidth = 182;
PostScriptBegin = 190;
TextIsPostscript = 194;
PostScriptEnd = 191;
TYPE
widhdl = ^widptr;
widptr = ^widpt;
widpt = Point;
TTxtPicRec = PACKED RECORD
tJus : Byte;
tFlip : Byte;
tRot : Integer;
tLine : Byte;
tCmnt : Byte;
END;
VAR
le, tp, ri, bo : integer;
str1, str2, str3, str4, str5 : str255;
str6, str7, str8, str9 : str255;
hPos, vPos, hor, ver : integer;
x, y, z1, z2 : real;
rBox, ClipBox : rect;
Width : Widhdl;
leading : integer;
LineNo : integer;
ParagraphBegin : Point;
Indent : integer;
Paragraph : ARRAY[1..LinesInParagraph]
OF str255;
TxtPicRec : TTxtPicRec;
TxtPicPtr : QDPtr;
TxtPicHdl : QDHandle;
TextClipRgn : RgnHandle;
SaveClip : RgnHandle;
fInfo : FontInfo;
BEGIN
SaveClip := NewRgn;
GetClip(SaveClip);
ClipRect(pRect);
TextClipRgn := NewRgn;
penNormal;
TextFont(geneva);
TextSize(10);
TextFace([]);
hor := (pRect.right - pRect.left) DIV 2;
ver := (pRect.bottom - pRect.top) DIV 2;
Width := Widhdl(NewHandle(sizeof(widpt)));
Width^^.h := 10;
Width^^.v := 1;
TxtPicPtr := @TxtPicRec;
TxtPicHdl := @TxtPicPtr;
TxtPicRec.tJus := LeftJust;
TxtPicRec.tFlip := 0; {no flip}
TxtPicRec.tRot := 0; {no rotation}
TxtPicRec.tLine := 2; {1 1/2 spacing}
GetFontInfo(fInfo);
leading := fInfo.descent + fInfo.ascent +
fInfo.leading;
Indent := 2;
WITH fPlotDoc DO
BEGIN
x := -fXScale / 2;
y := fAParam * x * x + (fBParam * x)
+ fCParam;
hPos := INTEGER(ROUND(x * hor * 2 / fXScale + hor));
vPos := INTEGER(round(-y * ver * 2 / fYScale + ver));
z1 := -fBParam / (2 * fAParam);
z2 := (4 * fAParam * fCParam -
(fBParam * fBParam)) / (4 * fAParam);
END;
le := 2;
tp := ver + (ver DIV 3);
ri := 140;
IF ri >= (hor + hor DIV 3) THEN
ri := hor + hor DIV 3;
bo := ver + ver - 2;
setRect(rBox, le, tp - 14, ri, bo);
ParagraphBegin.h := 4;
ParagraphBegin.v := tp;
{Graph Text}
WITH fPlotDoc DO
BEGIN
str1 := Int2Str(-fXScale DIV 2);
str2 := Int2Str(fYScale DIV 2);
str3 := Int2Str(fXScale DIV 2);
str4 := Int2Str(-fYScale DIV 2);
Paragraph[1] := CONCAT(
‘y=ax^2 + bx + c’, crString);
Paragraph[2] := CONCAT(‘a=’,
Real2String(fAParam,1),
‘, b=’,
Real2String(fBParam,1),
‘, c=’,
Real2String(fCParam,1),
crString);
Paragraph[3] := CONCAT(‘x1=’,
Real2String(fRoot1,2),
‘, x2=’,
Real2String(fRoot2,2),
crString);
END;
CASE fPlotDoc.fResult OF
1 :
Paragraph[4] :=
CONCAT(
‘Two Real Roots, x1, x2’,
crString);
2 :
Paragraph[4] :=
CONCAT(‘Double Root’,
crString);
3 :
Paragraph[4] :=
CONCAT(‘Two Complex Roots ‘,
crString);
OTHERWISE
;
END;
Paragraph[5] := CONCAT(‘Slope 0 = (‘,
Real2String(z1, 1),
‘,’,Real2String(z2,1), ‘)’,
crString);
PenNormal;
BackColor(TQPlotApplication(gApplication).
fDefBack);
ForeColor(TQPlotApplication(gApplication).
fDefAxis);
{Drawing Boundary}
{Begin MacDraw Document}
PicComment(picDwgBeg, 0, NIL);
PicComment(picGrpBeg, 0, NIL);
PicComment(SetLineWidth,
GetHandleSize(Handle(Width)),
Handle(Width));
IF QDdevice = Display THEN
FillRect(pRect, white);
FrameRect(pRect);
{Two Axis}
PicComment(picGrpBeg, 0, NIL);
moveto(0, ver);
line(hor + hor, 0);
moveto(hor, 0);
line(0, ver + ver);
PicComment(picGrpEnd, 0, NIL);
ForeColor(TQPlotApplication(gApplication).
fDefGraph);
{Plot Itsef}
PicComment(picGrpBeg, 0, NIL);
moveto(hPos, vPos);
WITH fPlotDoc DO
REPEAT
x := x + fStep;
y := fAParam * x * x + (fBParam * x) + fCParam;
hPos := integer(round(x * hor * 2 / fXScale + hor));
vPos := integer(round(-y * ver * 2 / fYScale + ver));
WITH pRect DO
IF (hPos < right) AND
(hPos > left) AND
(vPos < bottom) AND
(vPos > top) THEN
LineTo(hPos, vPos)
ELSE
moveto(hPos, vPos);
UNTIL x >= fXScale / 2;
PicComment(picGrpEnd, 0, NIL);
ForeColor(Colors[1]);
{Axis Text}
moveto(4, ver + 14);
DrawString(str1);
moveto(hor - 40, 14);
DrawString(str2);
moveto(hor + hor - 50, ver + 14);
DrawString(str3);
moveto(hor - 40, ver + ver - 14);
DrawString(str4);
{Box }
PicComment(picGrpBeg, 0, NIL);
PicComment(picGrpBeg, 0, NIL);
PicComment(SetLineWidth,
GetHandleSize(Handle(Width)),
Handle(Width));
IF QDdevice = Display THEN
fillRect(rBox, white);
frameRect(rBox);
PicComment(picGrpEnd, 0, NIL); {of box}
GetClip(TextClipRgn);
ClipBox := rBox;
ClipRect(ClipBox);
{Box Text}
PicComment(TextBegin, sizeof(TTxtPicRec),
Handle(TxtPicHdl));
FOR LineNo := 1 TO LinesInParagraph DO
BEGIN
moveto(ParagraphBegin.h,
ParagraphBegin.v);
move(Indent, (LineNo - 1) *
leading);
DrawString(Paragraph[LineNo]);
END;
PicComment(TextEnd, 0, NIL);
PicComment(PicGrpEnd, 0, NIL);{of Box/text}
PicComment(PicGrpEnd, 0, NIL);{of sel. all}
picComment(picDwgEnd, 0, NIL); {of drawing}
SetClip(SaveClip);
disposHandle( handle(width));
DisposeRgn(TextClipRgn);
DisposeRgn(SaveClip);
END; { TQPlotView.PrQDStuff }
{------------------------------------------------}
PROCEDURE TQPlotView.SuperViewChangedSize
(delta: VPoint; invalidate: BOOLEAN);
OVERRIDE;
(*
* This procedure changes the view size when
* the window is resized.
*)
BEGIN
(*
* We only need to go through these
* shenanigans if we are NOT displaying a page-
* sized picture. This resizes the view’s extent
* rectangle and invalidates the area, forcing the
* view to redraw the picture in the new size.
*)
IF NOT(fOnePage) THEN
BEGIN
AdjustSize;
ForceRedraw;
END;
END; { TQPlotView.SuperViewChangedSize }
{------------------------------------------------}
PROCEDURE TQPlotView.Resize (width,
height: VCoordinate; invalidate:
BOOLEAN); OVERRIDE;
(*
* This procedure is called from AdjustSize.
* It is here because when we toggle between Page
* Size and Window Size plots, we need to tell the
* view to redraw itself (because it changed size,
* even though the window didn’t).
*)
BEGIN
ForceRedraw;
INHERITED Resize(width, height, FALSE);
ForceRedraw;
END; { TQPlotView.Resize }
{------------------------------------------------}
PROCEDURE TQPlotView.Draw(area: Rect); OVERRIDE;
(*
* This procedure is called to draw the view
* when it needs to be drawn. The picture we
* created before is ALWAYS drawn to take
* up the entire window.
*)
VAR
tRect: Rect;
BEGIN
GetQDExtent(tRect); { always draw pict to
fill entire extent of the view }
EraseRect(tRect);
IF (fDrawing=NIL) THEN
BEGIN
fDrawing := OpenPicture(tRect);
PrQDStuff(tRect, 1);
ClosePicture;
PenNormal;
END;
DrawPicture(fDrawing, tRect);
END; { TQPlotView.Draw }
{--------------------------------------------}
{------------ File UQPlot.r ----------------}
{--------------------------------------------}
/* Copyright © 1989 by Charles F. McMath.
All rights reserved. */
#ifdef Debugging
include “Debug.rsrc”;
#endif
include “MacApp.rsrc”;
include “Printing.rsrc”;
include “Dialog.rsrc”;
include “QPlot” ‘CODE’;
resource ‘BNDL’ (128) {
‘FGT3’,
0,
{ ‘ICN#’,
{ 0, 128, 1, 129 },
‘FREF’,
{0, 128, 1, 129 }
}
};
resource ‘FREF’ (128) {
‘APPL’, 0, “”
};
resource ‘FREF’ (129) {
‘PICT’, 1, “”
};
type ‘FGT3’ as ‘STR ‘;
resource ‘FGT3’ (0) {
“© by Dave Kelly & Dave Smith \nver”
“4 JAN 1988;”
“ MacApp version by Chuck McMath”
};
resource ‘WIND’ (1001, purgeable) {
{45, 15, 445, 615},
zoomDocProc,
invisible,
goAway,
0x0,
“<<<>>>”
};
resource ‘view’ (1001, purgeable) {
{
root, ‘WIND’, { 50, 20 }, { 260, 430 },
sizeVariable, sizeVariable, shown,
enabled,
Window { “TWindow”, zoomDocProc,
goAwayBox, resizable,
modeless,
ignoreFirstClick,
freeOnClosing,
disposeOnFree,
closesDocument,
openWithDocument,
dontAdaptToScreen,
stagger, forceOnScreen,
dontCenter, ‘QPLT’, “” };
‘WIND’, ‘SCLR’, { 0, 0 },
{ 260-kSBarSizeMinus1,
430-kSBarSizeMinus1 },
sizeRelSuperView,
sizeRelSuperView,
shown, enabled,
Scroller { “TScroller”,
vertScrollBar,
horzScrollBar,
0, 0, 16, 16,
vertConstrain,
horzConstrain,
{ 0, 0, 0, 0 } };
‘SCLR’,IncludeViews { 1002 }
}
};
resource ‘view’ (1002, purgeable) {
{
root, ‘QPLT’,
{ 0, 0 }, { 134, 414 },
sizeFixed, sizeFixed,
shown, enabled,
View { “TQPlotView”}
}
};
resource ‘view’ (2000, purgeable) {
{ /* array viewArray: 15 elements */
root, noID,
{ 100, 105 }, { 150, 300 },
sizeVariable, sizeVariable,
notShown, enabled,
Window {
“TWindow”,
documentProc,
noGoAwayBox,
notResizable,
modal,
ignoreFirstClick,
freeOnClosing,
disposeOnFree,
doesntCloseDocument,
dontOpenWithDocument,
dontAdaptToScreen,
dontStagger,
dontForceOnScreen,
center,
noID,
“Plot Parameters”
},
/* [2] */
root, ‘PPRM’,
{0, 0},{150, 300}, sizeVariable,
sizeVariable, shown, disabled,
DialogView { “TDialogView”, ‘ok ‘,
noID },
/* [3] */
‘PPRM’, ‘ok ‘,
{110, 230}, {26, 45}, sizeFixed,
sizeFixed, shown, enabled,
Button {
“TButton”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
dismisses,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
“OK”
},
/* [4] */
‘PPRM’, ‘a ‘,
{30, 15},{20, 45},
sizeFixed, sizeFixed,
shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“1”,
unlimited,
0b1111000000000
0000000000100000000
},
/* [5] */
‘PPRM’, ‘b ‘,
{30, 100},{20, 45}, sizeFixed,
sizeFixed, shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“-1”,
unlimited,
0b111100000000000
00000000100000000
},
/* [6] */
‘PPRM’, ‘c ‘,
{30, 180},{20, 45}, sizeFixed,
sizeFixed, shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“-6”,
unlimited,
0b1111000000000000000
0000100000000
},
/* [7] */
‘PPRM’, ‘step’,
{80, 10},{20, 55}, sizeFixed,
sizeFixed, shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“.05”,
unlimited,
0b11110000000000000000
000100000000
},
/* [8] */
‘PPRM’, ‘xscl’,
{80, 100},{20, 50}, sizeFixed,
sizeFixed, shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“10”,
unlimited,
0b1111000000000000000
0000100000000
},
/* [9] */
‘PPRM’, ‘yscl’,
{80, 185},{20, 50}, sizeFixed,
sizeFixed, shown, enabled,
EditText {
“TEditText”,
0b1111,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{2, 2, 2, 2},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“20”,
unlimited,
0b111100000000000000000
00100000000
},
/* [10] */
‘PPRM’, ‘alab’,
{10, 35},{16, 20},
sizeFixed, sizeFixed,
shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“a”
},
/* [11] */
‘PPRM’, ‘blab’,
{10, 120},{16, 20}, sizeFixed,
sizeFixed, shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“b”
},
/* [12] */
‘PPRM’, ‘clab’,
{10, 200},{16, 20}, sizeFixed,
sizeFixed, shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“c”
},
/* [13] */
‘PPRM’, ‘slab’,
{60, 10},{16, 55},
sizeFixed, sizeFixed,
shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“step size”
},
/* [14] */
‘PPRM’, ‘xlab’,
{60, 95},{16, 55},
sizeFixed, sizeFixed,
shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“x scale”
},
/* [15] */
‘PPRM’, ‘ylab’,
{60, 180},{16, 70}, sizeFixed,
sizeFixed, shown, disabled,
StaticText {
“TStaticText”,
0b0,
{1, 1},
sizeable,
notDimmed,
notHilited,
doesntDismiss,
{0, 0, 0, 0},
plain,
0,
{0x0,0x0,0x0},
“”,
justLeft,
“y scale”
}
}
};
resource ‘SIZE’ (-1) {
dontSaveScreen,
acceptSuspendResumeEvents,
enableOptionSwitch,
canBackground,
MultiFinderAware,
backgroundAndForeground,
dontGetFrontClicks,
ignoreChildDiedEvents,
is32BitCompatible,
reserved,
reserved,
reserved,
reserved,
reserved,
reserved,
reserved,
#if qDebug
275 * 1024,
200 * 1024
#else
(250-32) * 1024,
(175-32) * 1024
#endif
};
resource ‘DLOG’ (1024) {
{100, 100, 318, 416},
dBoxProc,
-1,
noGoAway,
0x0,
1024,
“About Plotter”
};
resource ‘DITL’ (1024, purgeable) {
{ /* array DITLarray: 5 elements */
/* [1] */
{112, 235, 141, 284},
Button {
enabled,
“OK”
},
/* [2] */
{10, 88, 141, 289},
StaticText {
disabled,
“Plot Demo\n\nGraphs “
“Quadratic Equations\n^0”
“\n^1\n^2\n^3”
},
/* [3] */
{10, 10, 96, 81},
Picture {
disabled,
128
},
/* [4] */
{154, 22, 208, 283},
StaticText {
disabled,
“This application brought”
“ to you courtesy”
“ of MacApp® 2.0.”
“ Copyright “1985-1988”
“ Apple Computer, Inc.”
},
/* [5] */
{149, 17, 211, 290},
UserItem {
disabled
}
}
};
resource ‘cmnu’ (1) {
1,
textMenuProc,
0x7FFFFFFD,
enabled,
apple,
{ /* array: 2 elements */
/* [1] */
“About Plotter”, noIcon, noKey, noMark,
plain, cAboutApp;
/* [2] */
“-”, noIcon, noKey, noMark, plain, nocommand
}
};
resource ‘cmnu’ (2) {
2,
textMenuProc,
allEnabled,
enabled,
“File”,
{ /* array: 8 elements */
/* [1] */
“Plot”, noIcon, “P”, noMark, plain, cNew;
/* [2] */
“-”, noIcon, noKey, noMark, plain, nocommand;
/* [3] */
“Save”, noIcon, “S”, noMark, plain, cSave;
/* [4] */
“Save As”, noIcon, noKey, noMark, plain,
cSaveAs;
/* [5] */
“Page Setup”, noIcon, “U”, noMark, plain,
cPageSetup;
/* [6] */
“Print”, noIcon, “O”, noMark, plain, cPrint;
/* [7] */
“-”, noIcon, noKey, noMark, plain, nocommand;
/* [8] */
“Quit”, noIcon, “Q”, noMark, plain, cQuit
}
};
resource ‘cmnu’ (3) {
3,
textMenuProc,
allEnabled,
enabled,
“Edit”,
{ /* array: 6 elements */
/* [1] */
“Undo”, noIcon, “Z”, noMark, plain, cUndo;
/* [2] */
“-”, noIcon, noKey, noMark, plain, nocommand;
/* [3] */
“Cut”, noIcon, “X”, noMark, plain, cCut;
/* [4] */
“Copy”, noIcon, “C”, noMark, plain, cCopy;
/* [5] */
“Paste”, noIcon, “V”, noMark, plain, cPaste;
/* [6] */
“Clear”, noIcon, noKey, noMark, plain, cClear
}
};
resource ‘cmnu’ (4) {
4,
textMenuProc,
allEnabled,
enabled,
“Graph”,
{ /* array: 3 elements */
/* [1] */
“Graph”, noIcon, “\0x1B”, “\0x0A”, plain,
1201;
/* [2] */
“Axis”, noIcon, “\0x1B”, “\0x0B”, plain, 1202;
/* [3] */
“Background”, noIcon, “\0x1B”, “\0x0C”, plain,
1203
}
};
resource ‘cmnu’ (5) {
5,
textMenuProc,
allEnabled,
enabled,
“Print Options”,
{ /* array: 2 elements */
/* [1] */
“Window Size”, noIcon, “[“, noMark, plain,
1301;
/* [2] */
“Page Size”, noIcon, “]”, noMark, plain, 1302
}
};
resource ‘cmnu’ (10) {
10,
textMenuProc,
allEnabled,
enabled,
“Graph Colors”,
{ /* array: 8 elements */
/* [1] */
“Black”, noIcon, noKey, noMark, plain, 10001;
/* [2] */
“White”, noIcon, noKey, noMark, plain, 10002;
/* [3] */
“Red”, noIcon, noKey, noMark, plain, 10003;
/* [4] */
“Green”, noIcon, noKey, noMark, plain, 10004;
/* [5] */
“Blue”, noIcon, noKey, noMark, plain, 10005;
/* [6] */
“Cyan”, noIcon, noKey, noMark, plain, 10006;
/* [7] */
“Magenta”, noIcon, noKey, noMark, plain,
10007;
/* [8] */
“Yellow”, noIcon, noKey, noMark, plain, 10008
}
};
resource ‘cmnu’ (11) {
11,
textMenuProc,
allEnabled,
enabled,
“Axis Colors”,
{ /* array: 8 elements */
/* [1] */
“Black”, noIcon, noKey, noMark, plain, 11001;
/* [2] */
“White”, noIcon, noKey, noMark, plain, 11002;
/* [3] */
“Red”, noIcon, noKey, noMark, plain, 11003;
/* [4] */
“Green”, noIcon, noKey, noMark, plain, 11004;
/* [5] */
“Blue”, noIcon, noKey, noMark, plain, 11005;
/* [6] */
“Cyan”, noIcon, noKey, noMark, plain, 11006;
/* [7] */
“Magenta”, noIcon, noKey, noMark, plain,
11007;
/* [8] */
“Yellow”, noIcon, noKey, noMark, plain, 11008
}
};
resource ‘cmnu’ (12) {
12,
textMenuProc,
allEnabled,
enabled,
“Background Colors”,
{ /* array: 8 elements */
/* [1] */
“Black”, noIcon, noKey, noMark, plain, 12001;
/* [2] */
“White”, noIcon, noKey, noMark, plain, 12002;
/* [3] */
“Red”, noIcon, noKey, noMark, plain, 12003;
/* [4] */
“Green”, noIcon, noKey, noMark, plain, 12004;
/* [5] */
“Blue”, noIcon, noKey, noMark, plain, 12005;
/* [6] */
“Cyan”, noIcon, noKey, noMark, plain, 12006;
/* [7] */
“Magenta”, noIcon, noKey, noMark, plain,
12007;
/* [8] */
“Yellow”, noIcon, noKey, noMark, plain, 12008
}
};
resource ‘cmnu’ (128) {
128,
textMenuProc,
allEnabled,
enabled,
“Buzzwords”,
{ /* array: 1 elements */
/* [1] */
“Page Setup Change”, noIcon, noKey, noMark,
plain, cChangePrinterStyle
}
};
resource ‘MBAR’ (128) {
{1; 2; 3; 4; 5}
};
resource ‘MBAR’ (130) {
{10; 11; 12}
};
resource ‘mctb’ (0) {
{0, 0,
{ /* array: 4 elements */
0, 0, 0,
65535, 65535, 65535,
65535, 0, 65535,
65535, 65535, 65535
}
}
};
resource ‘mctb’ (1) {
{1, 0,
/* [1] */
{ /* array: 4 elements */
0, 65535, 65535,
65535, 65535, 65535,
65535, 0, 0,
65535, 65535, 65535
},
/* [2] */
1, 1,
{ /* array: 4 elements */
0, 0, 65535,
0, 0, 65535,
0, 0, 65535,
65535, 65535, 65535
},
/* [3] */
1, 2,
{ /* array: 4 elements */
0, 0, 65535,
0, 0, 65535,
0, 0, 65535,
65535, 65535, 65535
}
}
};
resource ‘mctb’ (10) {
{10, 1,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [2] */
10, 2,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [3] */
10, 3,
{ /* array: 4 elements */
65535, 0, 0,
65535, 0, 0,
65535, 0, 0,
65535, 65535, 65535
},
/* [4] */
10, 4,
{ /* array: 4 elements */
0, 65535, 0,
0, 65535, 0,
0, 65535, 0,
65535, 65535, 65535
},
/* [5] */
10, 5,
{ /* array: 4 elements */
0, 0, 65535,
0, 0, 65535,
0, 0, 65535,
65535, 65535, 65535
},
/* [6] */
10, 6,
{ /* array: 4 elements */
0, 65535, 65535,
0, 65535, 65535,
0, 65535, 65535,
65535, 65535, 65535
},
/* [7] */
10, 7,
{ /* array: 4 elements */
65535, 0, 65535,
65535, 0, 65535,
65535, 0, 65535,
65535, 65535, 65535
},
/* [8] */
10, 8,
{ /* array: 4 elements */
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 65535
}
}
};
resource ‘mctb’ (11) {
{ /* array MCTBArray: 8 elements */
/* [1] */
11, 1,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [2] */
11, 2,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [3] */
11, 3,
{ /* array: 4 elements */
65535, 0, 0,
65535, 0, 0,
65535, 0, 0,
65535, 65535, 65535
},
/* [4] */
11, 4,
{ /* array: 4 elements */
0, 65535, 0,
0, 65535, 0,
0, 65535, 0,
65535, 65535, 65535
},
/* [5] */
11, 5,
{ /* array: 4 elements */
0, 0, 65535,
0, 0, 65535,
0, 0, 65535,
65535, 65535, 65535
},
/* [6] */
11, 6,
{ /* array: 4 elements */
0, 65535, 65535,
0, 65535, 65535,
0, 65535, 65535,
65535, 65535, 65535
},
/* [7] */
11, 7,
{ /* array: 4 elements */
65535, 0, 65535,
65535, 0, 65535,
65535, 0, 65535,
65535, 65535, 65535
},
/* [8] */
11, 8,
{ /* array: 4 elements */
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 65535
}
}
};
resource ‘mctb’ (12) {
{ /* array MCTBArray: 8 elements */
/* [1] */
12, 1,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [2] */
12, 2,
{ /* array: 4 elements */
0, 0, 0,
0, 0, 0,
0, 0, 0,
65535, 65535, 65535
},
/* [3] */
12, 3,
{ /* array: 4 elements */
65535, 0, 0,
65535, 0, 0,
65535, 0, 0,
65535, 65535, 65535
},
/* [4] */
12, 4,
{ /* array: 4 elements */
0, 65535, 0,
0, 65535, 0,
0, 65535, 0,
65535, 65535, 65535
},
/* [5] */
12, 5,
{ /* array: 4 elements */
0, 0, 65535,
0, 0, 65535,
0, 0, 65535,
65535, 65535, 65535
},
/* [6] */
12, 6,
{ /* array: 4 elements */
0, 65535, 65535,
0, 65535, 65535,
0, 65535, 65535,
65535, 65535, 65535
},
/* [7] */
12, 7,
{ /* array: 4 elements */
65535, 0, 65535,
65535, 0, 65535,
65535, 0, 65535,
65535, 65535, 65535
},
/* [8] */
12, 8,
{ /* array: 4 elements */
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 0,
65535, 65535, 65535
}
}
};
resource ‘PICT’ (128) {
891,
{195, 254, 281, 325},
$”1101 A000 82A0 008E 0100 0A00 0000 0002
$”D002 4098 000A 00C3 00F8 00FF 0148 00C3
$”00FE 00FF 0145 00C3 00FE 00FF 0145 0000
$”02F7 0002 F700 02F7 0002 F700 02F7 0002
$”F700 02F7 0002 F700 02F7 0002 F700 02F7
$”0006 FD00 000E FC00 07FD 0001 1F80 FD00
$”07FD 0001 7FC0 FD00 07FD 0001 FFF0 FD00
$”08FE 0002 03FF FCFD 0008 FE00 0207 FFFE”
$”FD00 09FE 0003 1FFF FF80 FE00 09FE 0003
$”3FFF FFE0 FE00 09FE 0003 7FFF FFF8 FE00
$”0A02 0000 01FE FF00 FCFE 0008 0200 0003
$”FDFF FE00 0A02 0000 0FFD FF00 C0FF 000B”
$”0700 001F FFFF 3FFF E0FF 000B 0700 007F”
$”FFFE 1FFF F8FF 000B 0700 00FF FFFE 1FFF”
$”FCFF 000B 0100 01FE FF02 27FF FCFF 000B”
$”0100 01FE FF02 F9FF F8FF 000B 0100 00FE”
$”FF02 FE7F F0FF 000B 0200 003F FEFF 019F”
$”E0FF 000B 0200 001F FEFF 01E7 C0FF 000B”
$”0200 003F FEFF 01F9 80FF 000B 0200 0033
$”FEFF 01FE 80FF 000A 0200 0060 FDFF 00C0
$”FF00 0B07 0000 607F FFFF FCC0 FF00 0B07
$”0000 601F FFFF F870 FF00 0B07 0000 6007
$”FFFF F0F8 FF00 0B07 0000 6001 FFFF F0F8
$”FF00 0B07 0000 6000 FFFF F0F8 FF00 0B07
$”0000 6038 3FFF B050 FF00 0A06 0000 607C”
$”0FFF 30FE 000B 0700 0060 F603 FE30 A8FF”
$”000B 0700 0060 E301 FC30 50FF 000B 0700
$”0060 C000 7830 20FF 000B 0700 0060 0000
$”1030 88FF 000B 0200 0060 FE00 0130 50FF”
$”000A 0200 0060 FE00 0030 FE00 0B02 0000
$”60FE 0001 30A8 FF00 0B07 0000 6807 0700
$”B050 FF00 0A06 0000 681F 8FC0 B0FE 000B”
$”0700 006C 7FDF F1B0 A8FF 000A 0200 0067
$”FEFF 0030 FE00 0B09 0000 63FF FFFE 31F4
$”1000 0B09 0000 307F DFF0 6046 3000 0B09
$”0000 381F 8FC0 E045 5000 0B09 0000 1C00
$”0001 C044 9000 0B09 0000 0E00 0003 8044
$”1000 0802 0000 07FE FFFD 0009 0500 0001
$”FFFF FCFD 0008 FE00 0280 0004 FD00 9800
$”0A00 FF00 F801 1901 4800 FF00 FE01 1901
$”4500 FF00 FE01 1901 4500 0008 FE00 0280
$”0004 FD00 08FE 0002 FFFF FCFD 0008 0200
$”0001 FEAA FD00 0802 0000 03FE 55FD 000A”
$”0600 0006 FEAF EA80 FE00 0A06 0000 0D83
$”5835 40FE 000A 0600 001B 01B0 1AA0 FE00
$”0A06 0000 3501 5015 50FE 000A 0600 006A”
$”82A8 2AA8 FE00 0A06 0000 D57D 57D7 F4FE”
$”000A 0600 01AF AAFA AC1A FE00 0A06 0003
$”5055 0558 0DFE 000B 0700 06A0 2A02 A80A”
$”80FF 000B 0700 0D60 3603 5415 40FF 000B”
$”0700 0AB0 6B06 ABEA C0FF 000B 0700 0D5F”
$”D5FD 5555 40FF 0009 0100 0AFC AA00 C0FF”
$”0009 0100 0DFC 5500 40FF 0009 0100 0FFC”
$”FF00 C0FF 0002 F700 02F7 0002 F700 02F7
$”0002 F700 02F7 0002 F700 A000 8FA0 0083
$”FF”
};
resource ‘ICN#’ (128) {
{ /* array: 2 elements */
/* [1] */
$”0001 0000 0002 8000 0004 4000 0008 2000
$”0010 1000 0020 0800 0050 0400 0088 0200
$”0100 0100 0284 0080 0440 0240 0822 0420
$”1410 0810 220A 1008 4084 3F04 802A 4082
$”4001 8041 2003 3022 1005 C814 080E 7F8F”
$”0412 3005 0221 0007 0140 8005 0080 6007
$”0040 1FE5 0020 021F 0010 0407 0008 0800
$”0004 1000 0002 2000 0001 4000 0000 80",
/* [2] */
$”0001 0000 0003 8000 0007 C000 000F E000
$”001F F000 003F F800 007F FC00 00FF FE00
$”01FF FF00 03FF FF80 07FF FFC0 0FFF FFE0
$”1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE”
$”7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFFF”
$”07FF FFFF 03FF FFFF 01FF FFFF 00FF FFFF”
$”007F FFFF 003F FE1F 001F FC07 000F F800
$”0007 F000 0003 E000 0001 C000 0000 80
}
};
resource ‘ICN#’ (129) {
{ /* array: 2 elements */
/* [1] */
$”0FFF FE00 0800 0300 0800 0280 0800 0240
$”0800 0220 0800 0210 0800 03F8 0801 0008
$”0880 0008 0801 0208 0840 0008 0801 0408
$”0820 0008 0801 0808 0810 0008 0801 1008
$”0AAB AAA8 0809 2008 0804 4008 0803 8008
$”0800 0008 0801 0008 0800 0008 0801 0008
$”0800 0008 0801 0008 0800 0008 0801 0008
$”0800 0008 0800 0008 0800 0008 0FFF FFF8",
/* [2] */
$”0FFF FE00 0FFF FF00 0FFF FF80 0FFF FFC0
$”0FFF FFE0 0FFF FFF0 0FFF FFF8 0FFE FFF8
$”0F7F FFF8 0FFE FDF8 0FBF FFF8 0FFF FBF8
$”0FDD 7FF8 0FFA B7F8 0FE7 DFF8 0FEF FFF8
$”0D74 5D58 0FB7 DBF8 0F7B BDF8 0EFD 7EF8
$”0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
$”0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
$”0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
}
};