home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
sound
/
chaneler.sit
/
Channelizer.ƒ
/
WindowLayout.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-09-08
|
4KB
|
180 lines
unit WindowLayout;
{ Copyright ⌐ 1989 Chris Muir, Entropy Engineering. }
{ Internet: (hplabs,pacbell,ucbvax,apple) !well!cbm }
{ Pan: ZMS }
{ US Mail: 360 Elizabeth St. San Francisco, CA 94114 }
{+++++++++++++++++++++++ History +++++++++++++++++++++++}
{ 0.0c ╩July 30, 1989 cbm}
{ started the tedious task of changing all the globals' names to start with g }
{ 0.0b ╩July 25, 1989 cbm}
{ added some more globals }
{ 0.0a ╩July 19, 1989 cbm}
{ Started keeping history }
interface
uses
QuickDraw, ToolIntf;
procedure InitMessyVar;
function PopUpMenuSelect (menu: MenuHandle; top, left, popUpItem: INTEGER): LONGINT;
inline
$A80B;
var { Main global variables }
gTheFont: integer; { Main Font }
gMonoFont: integer;
gTitleFont: integer; { Font for section Titles }
gGraphicMenu: MenuHandle;
gFlipFlag: boolean;
gTheWorld: SysEnvRec;
gInColor: boolean; { true if >= 4 bits / pixel }
gOnlyGreys: boolean; { true if >= 4 bits / pixel AND not in color }
gNumPix: integer;
gInBackground: boolean;
gMyWindow: WindowPtr;
gMyPt: Point;
gMyEvent: EventRecord;
gXferFlag: boolean; { Transfer to new program flag }
gDoneFlag: boolean; { Exit program flag }
gMidiOutChanRect: rect;
gMidiOutLabelRect: rect;
gInUserNumericals: RgnHandle;
gTheBackground: integer;
gMyPixPat: PixPatHandle;
gMyGreyRgn: RgnHandle;
gAppleMenu: MenuHandle; { Used for DAs }
gOptionMenu: MenuHandle; { Used to handle Options }
gFSOops: OsErr;
const
on = true;
off = false;
zero = 0;
NumMin = 0;
NumMax = 128;
ModDistance = 11;
AbsTop = 5;
AbsLeft = 7;
hor_rrect = 16;
ver_rrect = 16;
OscWavePopUpWidth = 80;
ModPopUpWidth = 76;
LFOWavePopUpWidth = 69;
NumericalWidth = 34;
HalfNumerical = 17;
Lhigh = 14; { Patch select junk }
Lwide = 120;
LNumCols = 3;
RawDataWide = 90;
FitsVertPatch = 19;
BlockTitleRight = 7;
BlockTitleDown = 1;
ServerNameHight = 14;
{ +++++++++++++++++++++ }
{ +++++++++++++++++++++ }
implementation
var
ref_left: integer;
ref_top: integer;
PatchTop: integer;
PatchLeft: integer;
const
theDesk = 16;
{_____________________ GetFontNumber _____________________}
function GetFontNumber (fontName: Str255; var fontNum: INTEGER): BOOLEAN;
{GetFontNumber returns in fontNum the number for the font having}
{the given fontName . If there ╒s no such font , it returns FALSE . }
var
systemFontName: Str255;
begin
GetFNum(fontName, fontNum);
if fontNum = 0 then
begin
{either the font was not found, or it is the system font}
{if it was the system font, we got it, otherwise we didn't}
GetFontName(0, systemFontName);
GetFontNumber := EqualString(fontName, systemFontName, FALSE, FALSE);
end
else
{if theNum was not 0, we found the font}
GetFontNumber := TRUE;
end;
{_____________________ InitMyFonts _____________________}
procedure InitMyFonts;
var
FontReq: str255;
FontExists: boolean;
const
MyFontz = 400;
F_Geneva = 2;
F_Monaco = 3;
F_NewYork = 4;
begin { Font Stuff }
GetIndString(FontReq, MyFontz, F_Geneva);
FontExists := GetFontNumber(FontReq, gTheFont);
if FontExists = false then
gTheFont := 1; { Use ApplFont if requested font isn't there}
GetIndString(FontReq, MyFontz, F_Monaco);
FontExists := GetFontNumber(FontReq, gMonoFont);
GetIndString(FontReq, MyFontz, F_NewYork);
FontExists := GetFontNumber(FontReq, gTitleFont);
end;
{_____________________ InitMessyVar _____________________}
procedure InitMessyVar; { initialize things that we'ld like to treat as consts, but╔ }
var
PenSafe: PenState;
temprect: rect;
begin
gTheBackground := theDesk;
InitMyFonts;
end; { InitMessyVar }
end.