home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
turbopas
/
tp4menu1.arc
/
TP4MENU.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-11-10
|
10KB
|
246 lines
{
Copyright (c) 1988 BittWare Computing, ALL RIGHTS RESERVED
}
program tp4menu;
{$v-}
uses
dos,
crt,
beepkey4,
menuvars,
menucode,
inp_var,
pps_glob,
pps_init,
pps_usr;
{const}
var
NeverEnd :boolean;
RtnByte :byte;
procedure QuitProc;
var
ta :byte;
ts :string[30];
begin
Bad_Beep;
ts := PullDowns[ConfirmMenu]^.title;
PullDowns[ConfirmMenu]^.title := 'Quit?';
if Confirmed(pulldowns[ConfirmMenu],False) then begin
if HelpFileFound then Close(helpfile);
ChDir(HomeDir);
TextAttr := OldTextAttr;
window(1,1,80,25);
clrscr;
halt;
end
else PullDowns[ConfirmMenu]^.title := ts;
end;
procedure LogOnMessage;
var
ta :byte;
ts :string[30];
begin
ta := textattr;
ts := IoList^.title;
IoList^.title := 'Welcome!';
OpenIoWindow(IoList);
writeln;
writeln(' BittWare Computing ');
writeln;
writeln(' presents ');
writeln;
writeln(' The Professional Program Shell');
writeln;
writeln;
writeln(' See readme.doc for general information');
writeln(' See tp4menu.doc for programming information');
writeln;
writeln(' Hit <enter> to use demo Shell');
In_Carr_Rtn;
CloseIoWindow(IoList);
IoList^.title := ts;
textattr := ta;
end;
begin
GetDir(0,HomeDir);
OldTextAttr := TextAttr;
NeverEnd := false;
clrscr;
writeln;
writeln;
writeln;
writeln('Copyright (c) BittWare Computing, ALL RIGHTS RESERVED');
writeln;
writeln('Initial Memory Available = ',memavail);
write('Initializing Globals...');
InitVars;
writeln('Done');
write('Initializing Menus...');
InitMenus;
InitMenuVars;
writeln('Done');
HelpFilePath := InitHelpFilePath;
HelpFileName := InitHelpFileName;
HelpFileFound := LoadHelpFile(HelpFilePath,HelpFileName);
if HelpFileFound then writeln('Help File Found')
else writeln('Help File NOT Found');
writeln('Post Init Memory = ',memavail);
HideCurs;
TextColor(MainFg);
TextBackground(MainBg);
write('Hit <Enter> to begin...');
in_carr_rtn;
clrscr;
LogOnMessage;
gotoxy(1,MaxTextRow);
TextColor(BottomFg);
TextBackground(BottomBg);
write('<Arrows>-Move <Enter>-Select/Change <Esc>-Cancel F1-Help F10-Main Menu');
clreol;
TextColor(MainFg);
TextBackground(MainBg);
repeat
Rtn2Main := False;
HelpNum := MainHeader;
menu1 := PickHeader(1,HdrList);
case menu1 of
1: begin
OpenPullDownMenu(PullDowns[ExeMenu]);
repeat
HelpNum := ExeMainHelp;
menu2 := PullDownMenu(PullDowns[ExeMenu]);
case menu2 of
1: begin
HelpNum := UserProc1Help;
if Confirmed(pulldowns[ConfirmMenu],CommandMode) then user1;
end;
2: begin
HelpNum := UserProc2Help;
if Confirmed(pulldowns[ConfirmMenu],CommandMode) then user2;
end;
3: begin
HelpNum := UserProc3Help;
if Confirmed(pulldowns[ConfirmMenu],CommandMode) then user3;
end;
4: begin
HelpNum := UserProc4Help;
if Confirmed(pulldowns[ConfirmMenu],CommandMode) then user4;
end;
end;
until ((menu2=0) or Rtn2Main);
ClosePullDownMenu(PullDowns[ExeMenu]);
end;
2:begin
OpenPullDownMenu(PullDowns[FileMenu]);
repeat
if ErrorNum <> 0 then ErrorMessage;
HelpNum := FileMenuHelp;
UpdateMenu(PullDowns[FileMenu]);
menu2 := PullDownMenu(PullDowns[FileMenu]);
mvp := PullDowns[FileMenu]^.VarPtr;
Case menu2 of
1 :begin
ts := DirSearchPath;
ts2 := mvp^[menu2].str;
InpVars(PullDowns[FileMenu],x,@DirSearchPath);
{$i-}
ChDir(DirSearchPath);
if IOResult <> 0 then begin
ErrorNum := PathNotFound;
DirSearchPath := ts;
mvp^[menu2].str := ts2;
end;
ChDir(HomeDir);
{$i+}
end;
2 :InpVars(PullDowns[FileMenu],x,@DirSearchMask);
3 :begin
GetFile(flname,DirSearchMask,DirSearchPath,RtnByte);
mvp^[menu2].str := flname;
end;
4 :begin
OpenPickList(ColorList);
Menu3 := PickList(ColorList);
if menu3 <> 0 then begin
PullDowns[FileMenu]^.VarFg := Menu3-1;
mvp^[menu2].str := ColorList^.str[menu3];
end;
ClosePickList(ColorList);
end;
5 :begin
ColorList^.Max := 8;
OpenPickList(ColorList);
Menu3 := PickList(ColorList);
if menu3 <> 0 then begin
PullDowns[FileMenu]^.VarBg := Menu3-1;
mvp^[menu2].str := ColorList^.str[menu3];
end;
ClosePickList(ColorList);
ColorList^.Max := 16;
end;
end;
until ((menu2=0) or Rtn2Main);
ClosePullDownMenu(PullDowns[FileMenu]);
end;
3:begin
OpenPullDownMenu(PullDowns[VarMenu]);
repeat
HelpNum := DataEntryHelp;
UpdateMenu(PullDowns[VarMenu]);
menu2 := PullDownMenu(PullDowns[VarMenu]);
mvp := PullDowns[VarMenu]^.VarPtr;
case menu2 of
1 :begin
HelpNum := MaskListHelp;
OpenPickList(MaskList);
menu3 := PickList(MaskList);
if menu3 <> 0 then begin
mvp^[menu2].str := MaskList^.str[menu3];
PullDowns[VarMenu]^.SelPattern := MaskId[menu3];
end;
ClosePickList(MaskList);
end;
2 :InpVars(PullDowns[VarMenu],x,@StringVar);
3 :InpVars(PullDowns[VarMenu],x,@RealVar1);
4 :InpVars(PullDowns[VarMenu],x,@RealVar2);
5 :InpVars(PullDowns[VarMenu],x,@IntVar);
6 :InpVars(PullDowns[VarMenu],x,@LongIntVar);
7 :begin
HelpNum := ChgVarHelp;
ChgVar(OnOffList,BoolVar);
Mvp^[Menu2].str := OnOffList^.str[BoolVar];
if BoolVar = 1 then CommandMode := true
else CommandMode := false;
end;
8 :begin
HelpNum := MenuNumHelp;
GetMenuNum(MenuNum,SpclNum,Pulldowns[NumPtsMenu]);
str(MenuNum,Mvp^[Menu2].str);
end;
9 :begin
HelpNum := ChgVarHelp;
ChgVar(VarTypeList,FrChgVar);
Mvp^[Menu2].str := VarTypeList^.str[FrChgVar];
end;
end;
until ((menu2=0) or Rtn2Main);
ClosePullDownMenu(PullDowns[VarMenu]);
end;{case menu1 = 3 }
4: begin
QuitProc;
end;
end;{case menu1}
until NeverEnd;
end.