home *** CD-ROM | disk | FTP | other *** search
- USES IOSTUFF,MENUBOX,CRT;
- VAR
- ExitNow,ExitSub : boolean;
- Menu1,Menu2 : String[255];
- Ch : Char;
- {============================================================================}
- BEGIN
- ClrScr;
-
- Menu1 :=('Menu Info./'+ { Initialize the menu strings. }
- 'Crawl Submenu/'+
- 'Walk/'+
- 'Run/'+
- 'Fly/'+
- 'Screen Clear /'+
- 'Exit/');
-
- Menu2 :=('Baby crawl/'+
- 'Slow crawl/'+
- 'Fast crawl/'+
- 'Exit/'); { Don't forget the last / }
-
- ExitNow := false;
- SetMenuBox(5,5,Menu1); { Setup Menu1 }
- SaveScreen(1); { Save screen image after Menu1 setup so it can be restored }
-
- Repeat Case PickMenuBox of { Play with Menu1 }
- 'M' : Begin { Menu Info Picked}
- WriteSt('These pop up menus are created and accessed by two ',5,15);
- WriteSt('easy to use routines: SetMenuBox and PickMenuBox. ',5,16);
- WriteSt('SetMenuBox sets the location of the menu and the menu',5,17);
- WriteSt('picks. Function PickMenuBox allows the user to play',5,18);
- WriteSt('with the menus and returns a character based on the ',5,19);
- WriteSt('users pick. PickMenuBox is intended to be used in a ',5,20);
- WriteSt('case statement where logic for each pick is executed.',5,21);
- End;
- 'C' : Begin { Crawl submenu Picked}
- SetMenuBox(25,5,Menu2); { Get ready to play with Menu2 }
- ExitSub := false;
-
- Repeat Case PickMenuBox of { Play with Menu2 }
- 'B' : WriteSt('Baby crawl',1,24);
- 'S' : WriteSt('Slow crawl',1,24);
- 'F' : WriteSt('Fast crawl',1,24);
- 'E',#0 : ExitSub := true; { This is a good way to exit menus }
- { #0 returned when esc key hit }
- End; { Case PickMenuBox for Menu2 }
- Until ExitSub;
-
- ResetBox; { This clears the reverse video on Menu2 }
- SetMenuBox(5,5,Menu1); { Get ready to play with main menu }
- End;
-
- 'W' : Begin
- FillScr('W');
- WriteSt('Walk ',1,24); { Back to main menu picks }
- ResetBox; { Rewrite the main menu }
- End;
- 'R' : WriteSt('Run ',1,24);
- 'F' : WriteSt('Fly ',1,24);
- 'S' : RestoreScreen(1);
- 'E',#0 : ExitNow := true;
- End;{ case PickMenuBox for Menu1 }
- Until ExitNow;
-
- End.