home *** CD-ROM | disk | FTP | other *** search
- PROGRAM BigDemo;
-
- USES IOSTUFF,MENUBOX,MENU123,MENUPULL,DIR,GETCOLOR,GETLINE,POPASCII,DRAWBOX,CRT;
-
- CONST
- Abort = #0;
- VAR
- ExitNow : boolean; { Exit switch }
- MainMenu : AnyStr; { Main menu string }
- FilSubMenu : AnyStr; { 1st submenu string }
- ScrSubMenu : AnyStr; { 2nd submenu string }
- BoxSubMenu : AnyStr; { 4th submenu string }
- MenuSubMenu : AnyStr; { 5th submenu string }
- DummyFile : AnyStr; { Dummy to hold pickfile }
- Fore,Back : Integer; { Foreground and background colors }
- ChASCII : Char; { ASCII character returned from ChooseASCII }
- ScreenPick : Char; { Returns menu pick in screen menu }
- Result : Char; { Character returned from menus }
- X,Y : Integer; { Cursor location on screen }
- TempStr : AnyStr; { Used in reading string from screen }
- II : Integer; { Loop index }
- PCh : Char;
- {============================================================================}
- PROCEDURE Pause; { Write a message and wait for a keystroke }
- BEGIN
- WriteSt('Hit any key to proceed',1,25);
- PCh := ReadKey;
- END;
- {============================================================================}
- BEGIN
- Fore := Cyan; { default colors }
- Back := Black;
- SetColor(Fore,Back); { Set colors }
- ClrScr;
- X := 10; { cursor location for drawbox }
- Y := 5;
-
- MainMenu :=('File/'+ { String for main menu }
- 'Screen/'+
- 'GetLine/'+
- 'Menus/'+
- 'Boxes/'+
- 'Info./');
-
- FilSubMenu :=('Directory/'+ { String for file submenu }
- 'Change Dir/'+
- 'Pick File/'+
- 'Quit/');
-
- ScrSubMenu :=('Select Colors/'+ { String for screen submenu }
- 'Clear Screen/'+
- 'ASCII Char./'+
- 'Fill Screen/');
-
- BoxSubMenu :=('Draw w Cursor/'+ { String for screen submenu }
- 'Border demo/');
-
- MenuSubMenu :=('Box Menus/'+ { String for screen submenu }
- '123 Menus/'+
- 'Pulldown Menus/');
-
- ExitNow := false; { turn off exit switch }
-
- FillScr('░');
-
- SetMain(MainMenu); { Setup the main menu }
- SetSub(1,FilSubMenu); { Setup the file submenu under main choice 1 }
- SetSub(2,ScrSubMenu); { Setup the screen submenu under main choice 2 }
- SetSub(5,BoxSubMenu); { Setup the box submenu under main choice 4}
- SetSub(4,MenuSubMenu); { Setup the box submenu under main choice 5}
- Repeat Case PickMain of { Get user's pick from the main menu}
- 'F' : Begin { User picked F (file) from main menu}
- Case PickSub(1) of { now get user's pick from 1st submenu }
- 'D': Begin { User picked D (directory) from submenu }
- ShowDir;
- Pause;
- End;
- 'C': Begin { User picked C from submenu }
- ShowDir;
- ChangePath;
- Pause;
- End;
- 'P': Begin { User picked P from submenu }
- DummyFile := PickFile;
- WriteSt('You picked file: '+DummyFile,1,24);
- GoToXY(1,25);ClrEol;
- Pause;
- End;
- 'Q': Exit; { User picked Q from submenu }
- End; {case}
- End;
-
- 'S' : Begin { User picked S from main menu }
- WriteSt('╒════════════════════════════════════════════╕',33,7);
- WriteSt('│ Note that this submenu behaves differently │',33,8);
- WriteSt('│ than the rest. Control is retained by the │',33,9);
- WriteSt('│ submenu until you hit escape or up arrow. │',33,10);
- WriteSt('╘════════════════════════════════════════════╛',33,11);
- Repeat
- ScreenPick := PickSub(2); { Get user's pick from submenu 2 }
- Case ScreenPick of
- 'S': Begin { User picked S from submenu }
- SetChooseColor(40,12); { Set the location of the color smorgasbord }
- ChooseColor(Fore,Back); { Let user select color }
- SetColor(Fore,Back); { set the color }
- End;
-
- 'C': Begin { User picked C from submenu }
- ClrScr;
- SaveWorkScreen;
- End;
-
- 'A': Begin { User picked A from submenu }
- SetChooseASCII(32,3); { set the location of the ASCII selector }
- ChASCII := ChooseASCII; { Let user choose ASCII character }
- End;
-
- 'F': Begin
- FillScr(ChASCII); { Fill the screen with the character }
- SaveWorkScreen;
- End;
- End; {case}
- Until ScreenPick = Abort; { Remain in menu until user hits esc }
- End;
-
- 'M' : Begin
- Case PickSub(4) of
- 'B' : Begin
- WriteSt('╒════════════════════════════════════════════╕',3,21);
- WriteSt('│ Box menus are little popup menus that are │',3,22);
- WriteSt('│ easy to setup and use. Try this one out. │',3,23);
- WriteSt('╘════════════════════════════════════════════╛',3,24);
- SetMenuBox(10,10,'Crawl like a baby/Walk like a man/Run like the devil/'+
- 'Fly like an eagle/Warp 5/');
- Result := PickMenuBox;
- End;
- '1' : Begin
- WriteSt('╒════════════════════════════════════════════╕',3,21);
- WriteSt('│ 123 menus are bar menus that also are easy │',3,22);
- WriteSt('│ to setup and use. Try this one out. │',3,23);
- WriteSt('╘════════════════════════════════════════════╛',3,24);
- SetMenu123(1,10,'Crawl/Walk/Run/Fly/Warp 5/');
- Result := PickMenu123;
- End;
-
- 'P' : Begin
- WriteSt('╒══════════════════════════════════════════════════════════════════╕',5,10);
- WriteSt('│ Pulldown Menus are sophisticated, two-level menus that work like │',5,11);
- WriteSt('│ the menus in Turbo Pascal 4.O edit. Pulldown menus, because they│',5,12);
- WriteSt('│ are so powerful and flexible, are also more complicated to use. │',5,13);
- WriteSt('│ │',5,14);
- WriteSt('│ For example the programmer must assist the menu routines in │',5,15);
- WriteSt('│ knowing when to rebuild the menus over a new screen or when to │',5,16);
- WriteSt('│ just refresh the old screen. The results are stunning however. │',5,17);
- WriteSt('│ The menus in this demonstration use the Pulldown routines. │',5,18);
- WriteSt('╘══════════════════════════════════════════════════════════════════╛',5,19);
- Pause;
- End;
-
- End; {case}
- End;
-
- 'B' : Begin
- Case PickSub(5) of
- 'D' : Begin
- RestoreWorkScreen;
- WriteSt('Use the arrow keys to draw a box on the screen.',1,23);
- WriteSt('Draw a line over another line to see the intersection',1,24);
- Box(X,Y); { Let user draw box }
- SaveWorkScreen;
- End;
- 'B' : Begin
- RestoreWorkScreen;
- For II := 1 to 4 do Border(10-II,10-II,30+II,15+II,'');
- Border(5,5,35,20,'Double-line');
- For II := 1 to 4 do SBorder(41-II,10-II,61+II,15+II,'');
- SBorder(36,5,66,20,'Single-line');
- SaveWorkScreen;
- End;
- End; {case}
- End;
-
- 'G' : Begin
- WriteSt('╒════════════════════════════════════════════╕',30,3);
- WriteSt('│ GetLine allows the user to edit a field │',30,4);
- WriteSt('│ and then returns the resulting string. │',30,5);
- WriteSt('│ All the usual editing keys work including │',30,6);
- WriteSt('│ insert. If your first key is a letter the │',30,7);
- WriteSt('│ routine assumes you want to start over. │',30,8);
- WriteSt('│ For example: │',30,9);
- WriteSt('╘════════════════════════════════════════════╛',30,10);
- SetColor(Yellow,Magenta); { Reverse colors }
- WriteSt(' ',45,9); { Write a blank area }
- TempStr := 'Some Stuff'; { Set default string }
- TempStr := GetStr(45,9,20,TempStr); { Read string at location }
- { 45,9 length 20 with default }
- { set initially to TempStr }
- WriteSt('You entered ['+TempStr+'] -- Hit any key to proceed',1,24);Clreol;
- SetColor(Fore,Back);
- PCh := Readkey;
- RestoreWorkScreen;
- SaveWorkScreen; { Restore then Save to trigger menu rewrite }
- End;
-
- 'I': Begin
- ClrScr;
- WriteSt('This program demonstrates a few high points from the Turbo Overdrive',3,6);
- WriteSt('routines. Just pick an item from the menu (which is itself an Overdrive',3,7);
- WriteSt('routine) using the reverse video cursor and hit enter. Or simply hit',3,8);
- WriteSt('the first letter of the menu item you want to activate.',3,9);
-
- WriteSt('All Turbo Overdrive routines are written in straightforward Turbo',3,11);
- WriteSt('Pascal 4.0 so that you can understand them and modify them to your',3,12);
- WriteSt('liking. Inline routines have been avoided whenever possible (there''s',3,13);
- WriteSt('just one in the whole package). All of the units are extremely well',3,14);
- WriteSt('thought out and quite simple to use. ',3,15);
-
- WriteSt('The Turbo Overdrive Package is being distributed under the user-supported',3,17);
- WriteSt('concept. You may freely copy the TOP disk for your evaluation and for the',3,18);
- WriteSt('evaluation of others so long as no price or other consideration is charged.',3,19);
- WriteSt('If you find the package useful we ask that you register as a Turbo Overdrive',3,20);
- WriteSt('Package user by sending $20 to:',3,21);
-
- WriteSt(' Nescatunga Software ',55,22);
- WriteSt(' Box 5942 ',55,23);
- WriteSt(' Katy, TX 77450. ',55,24);
- SaveWorkScreen;
- End;
- #0 : ExitNow := true;
- End;{case Pick}
-
- Until ExitNow; { Keep repeating big menu case until user exits }
-
- END.