home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-08-09 | 5.9 KB | 75 lines | [TEXT/PJMM] |
- unit prefsUnit;
- interface
- uses
- PrintTraps, Quickdraw, Picker, Palettes, Globs, DlogStuff;
-
-
- procedure DoPrefs; {handle the Preferences dialog}
-
- const
- prefsDLOGID = 3141; {Resource ID of our dialog}
-
- okayBtn = 1; {DITL numbers}
- cancelBtn = 2;
- InvertCBx = 3;
- ArcsRB = 4;
- LinesRB = 5;
- BoxSizeET = 7;
- boundTilesCBx = 9;
- randScrl = 10;
-
- var
- PrefsDLOGPtr: DialogPtr;
- tempGlobals: GlobalDataRec; {storage for temporary values}
-
- implementation
-
- {==================================== fsDLOGPtr, BoxSizeET, anInt, aHdl, aRect);
- GetIText(aHdl, aStr);
- anInt := String2Int(aStr);
- if (anInt > 4) and (anInt < 101) then
- begin
- tempGlobals.TileSize := anInt;
- gdh^^ := tempGlobals;
- finished := TRUE;
- end
- else
- begin
- SysBeep(1);
- DoMessage('**Sorry, the side of a tile must be', 'between 5 and 100.', '', '');
- SelIText(PrefsDLOGPtr, BoxSizeET, 0, 32767); {pre-doubleclick the item}
- end;
- end;
- cancelBtn:
- begin
- finished := TRUE;
- end;
- InvertCBx:
- begin
- tempGlobals.InvertRendering := not tempGlobals.InvertRendering;
- CheckABox(PrefsDLOGPtr, InvertCBx, tempGlobals.InvertRendering);
- end;
- ArcsRB:
- begin
- tempGlobals.tileStyle := Arcs;
- PushRadioButton(PrefsDLOGPtr, ArcsRB, ArcsRB, LinesRB);
- end;
- LinesRB:
- begin
- tempGlobals.tileStyle := Lines;
- PushRadioButton(PrefsDLOGPtr, LinesRB, ArcsRB, LinesRB);
- end;
- boundTilesCBx:
- begin
- tempGlobals.showTileBounds := not tempGlobals.showTileBounds;
- CheckABox(PrefsDLOGPtr, boundTilesCBx, tempGlobals.showTileBounds);
- end;
- otherwise
- ;
- end;{case itemHit}
- end;{while not finished}
- DisposDialog(PrefsDLOGPtr);
- SetPort(oldPort);
- end;{DoPrefs}
-
- end.{prefsUnit unit}