Unit MacPascal

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Routines from the Mac Classic ToolBox used by all Watchmaker programs, with documentation from the 1985 edition of Inside Macintosh.

Overview

Classes, Interfaces, Objects and Records

Name Description
record GenericPtr  
record Size  
record ResType  
record WindowPtr  
record WindowRecord  
record ControlHandle  
record WindowPeek  
record GrafPtr  
record Rect  
record BitMap  
record Bits16  
record RgnHandle  
record Point Inside Macintosh I-202
record Cursor Inside Macintosh I-202 Summary of QuickDraw
record MenuHandle  
record EventRecord  
record Pic  
record PicHandle  
record QElem  
record Proc  
record SignedByte  
record FInfo Inside Macintosh II-84
record ParamBlockRec basic File Manager parameter block.
record FXInfo Macintosh Toolbox Essentials 7-49
record DXInfo Macintosh Toolbox Essentials 7-50
record DInfo Macintosh Toolbox Essentials 7-50
record CInfoPBRec catalog information parameter block File Manager 2-247

Functions and Procedures

FUNCTION GetCursor(cursorlD: INTEGER ): CursHandle;
PROCEDURE NumToString(theNum: LONGINT; var theString: Str255);
PROCEDURE DrawChar(ch: CHAR);
FUNCTION GetResource (theType: ResType; thelD: INTEGER) : Handle;
FUNCTION ResError : INTEGER;
FUNCTION GetMenuBar: Handle;
PROCEDURE SetMenuBar (menuList: Handle);
FUNCTION GetMBarHeight: Integer;
FUNCTION PBGetCatInfo (paramBlock: CInfoPBPtr; async: Boolean): OSErr;
FUNCTION PBRead (paramBlock: ParmBlkPtr; async: Boolean): OSErr;
FUNCTION PBReadSync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION PBReadAsync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION PBWrite (paramBlock: ParmBlkPtr; async: Boolean): OSErr;
FUNCTION PBWriteSync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION PBWriteAsync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION PBClose (paramBlock: ParmBlkPtr; async: Boolean): OSErr;
FUNCTION PBCloseSync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION PBCloseAsync (paramBlock: ParmBlkPtr): OSErr;
FUNCTION HCreate (vRefNum: Integer; dirID: LongInt; fileName: Str255; creator: OSType; fileType: OSType): OSErr;
FUNCTION DirCreate (vRefNum: Integer; parentDirID: LongInt; directoryName: Str255; VAR createdDirID: LongInt): OSErr;
FUNCTION HDelete (vRefNum: Integer; dirID: LongInt; fileName: Str255): OSErr;
FUNCTION GetFPos (refNum: Integer; VAR filePos: LongInt): OSErr;
FUNCTION SetFPos (refNum: Integer; posMode: Integer; posOff: LongInt): OSErr;
FUNCTION GetEOF (refNum: Integer; VAR logEOF: LongInt): OSErr;
FUNCTION SetEOF (refNum: Integer; logEOF: LongInt): OSErr;

Types

Ptr = ˆGenericPtr;
Handle = ˆPtr;
Str255 = String;
Str63 = String;
RectPtr = ˆRect;
VHSelect = (...);
CursPtr = ˆCursor;
CursHandle = ˆCursPtr;
OSErr = INTEGER;
QElemPtr = ˆQElem;
ProcPtr = ˆProc;
StringPtr = ˆString;
OSType = PACKED ARRAY[1..4] OF CHAR;
ParamBlkType = (...);
ParmBlkPtr = ˆParamBlockRec;
CInfoType = (...);
CInfoPBPtr = ˆCInfoPBRec;

Constants

NoErr = 0;
iBeamCursor = 1;
crossCursor = 2;
plusCursor = 3;
watchCursor = 4;

Variables

screenBits: BitMap;

Description

Functions and Procedures

FUNCTION GetCursor(cursorlD: INTEGER ): CursHandle;

Inside Macintosh, I-474:

GetCursor returns a handle to the cursor having the given resource ID, reading
it from the resource file if necessary. It calls the Resource Manager function
GetResource('CURS',cursorID). If the resource can't be read, GetCursor returns NIL.

PROCEDURE NumToString(theNum: LONGINT; var theString: Str255);

Write a string representation of an integer to a string variable, without using a + sign for positive values. Defined in Inside Macintosh Chapter 18, THE BINARY-DECIMAL CONVERSION PACKAGE, I-489: "NumToString converts theNum to a string that represents its decimal value, and returns the result in theString. If the value is negative, the string begins with a minus sign; otherwise, the sign is omitted. Leading zeroes are suppressed, except that the value 0 produces '0'. For example:

theNum

theString

12

'12'

-23

'-23'

0

'0'

PROCEDURE DrawChar(ch: CHAR);

Defined in Inside Macintosh Chapter 6, QuickDraw, section QuickDraw Routines I-172 "DrawChar places the given character to the right of the pen location, with the left end of its base line at the pen's location, and advaaces the pen accordingly. If the character isn't in the font, the font's missing symbol is drawn. Note: If you're drawing a series of characters, it's faster to make one DrawString or DrawText call rather than a series of DrawChar calls."

FUNCTION GetResource (theType: ResType; thelD: INTEGER) : Handle;
 
FUNCTION ResError : INTEGER;

Inside Macintosh I-133

FUNCTION GetMenuBar: Handle;
 
PROCEDURE SetMenuBar (menuList: Handle);
 
FUNCTION GetMBarHeight: Integer;
 
FUNCTION PBGetCatInfo (paramBlock: CInfoPBPtr; async: Boolean): OSErr;

File Manager Reference 2-190

FUNCTION PBRead (paramBlock: ParmBlkPtr; async: Boolean): OSErr;

File Manager Reference 2-254

FUNCTION PBReadSync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION PBReadAsync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION PBWrite (paramBlock: ParmBlkPtr; async: Boolean): OSErr;

File Manager Reference 2-254

FUNCTION PBWriteSync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION PBWriteAsync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION PBClose (paramBlock: ParmBlkPtr; async: Boolean): OSErr;

File Manager Reference 2-254

FUNCTION PBCloseSync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION PBCloseAsync (paramBlock: ParmBlkPtr): OSErr;

File Manager Reference 2-254

FUNCTION HCreate (vRefNum: Integer; dirID: LongInt; fileName: Str255; creator: OSType; fileType: OSType): OSErr;

File Manager Reference 2-258

FUNCTION DirCreate (vRefNum: Integer; parentDirID: LongInt; directoryName: Str255; VAR createdDirID: LongInt): OSErr;

File Manager Reference 2-258

FUNCTION HDelete (vRefNum: Integer; dirID: LongInt; fileName: Str255): OSErr;

File Manager Reference 2-258

FUNCTION GetFPos (refNum: Integer; VAR filePos: LongInt): OSErr;

File Manager Reference 2-253

FUNCTION SetFPos (refNum: Integer; posMode: Integer; posOff: LongInt): OSErr;

File Manager Reference 2-253

FUNCTION GetEOF (refNum: Integer; VAR logEOF: LongInt): OSErr;

File Manager Reference 2-253

FUNCTION SetEOF (refNum: Integer; logEOF: LongInt): OSErr;

File Manager Reference 2-253

Types

Ptr = ˆGenericPtr;
 
Handle = ˆPtr;
 
Str255 = String;
 
Str63 = String;
 
RectPtr = ˆRect;
 
VHSelect = (...);

Inside Macintosh I-202

Values
  • v:  
  • h:  
CursPtr = ˆCursor;

Inside Macintosh I-474

CursHandle = ˆCursPtr;

Inside Macintosh I-474:

(The CursHandle data type is defined in the Toolbox Utilities as follows:)

OSErr = INTEGER;
 
QElemPtr = ˆQElem;
 
ProcPtr = ˆProc;
 
StringPtr = ˆString;
 
OSType = PACKED ARRAY[1..4] OF CHAR;

Inside Macintosh III-184

ParamBlkType = (...);

File Manager Reference 2-242

Values
  • ioParam:  
  • fileParam:  
  • volumeParam:  
  • cntrlParam:  
  • slotDevParam:  
  • multiDevParam:  
  • accessParam:  
  • objParam:  
  • copyParam:  
  • wdParam:  
  • fidParam:  
  • csParam:  
  • foreignPrivsParam:  
ParmBlkPtr = ˆParamBlockRec;
 
CInfoType = (...);

number of unused allocation blocks

Values
  • hfileInfo:  
  • dirInfo: File Manager 2-247
CInfoPBPtr = ˆCInfoPBRec;

folder's view

Constants

NoErr = 0;
 
iBeamCursor = 1;

to select text Inside Macintosh I-474

crossCursor = 2;

to draw graphics Inside Macintosh I-474

plusCursor = 3;

to select cells in structured documents Inside Macintosh I-474

watchCursor = 4;

to indicate a long wait Inside Macintosh I-474

Variables

screenBits: BitMap;
 

Generated by PasDoc 0.14.0.