home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / menu / overdriv / menubox.dem < prev    next >
Encoding:
Text File  |  1980-01-01  |  2.3 KB  |  67 lines

  1. USES IOSTUFF,MENUBOX,CRT;
  2. VAR
  3.    ExitNow,ExitSub : boolean;
  4.    Menu1,Menu2 : String[255];
  5.    Ch : Char;
  6. {============================================================================}
  7. BEGIN
  8. ClrScr;
  9.  
  10. Menu1 :=('Menu Info./'+    { Initialize the menu strings. }
  11.          'Crawl Submenu/'+
  12.          'Walk/'+
  13.          'Run/'+
  14.          'Fly/'+
  15.          'Screen Clear /'+
  16.          'Exit/');
  17.  
  18. Menu2 :=('Baby crawl/'+
  19.          'Slow crawl/'+
  20.          'Fast crawl/'+
  21.          'Exit/');            { Don't forget the last / }
  22.  
  23. ExitNow := false;
  24. SetMenuBox(5,5,Menu1);  { Setup Menu1 }
  25. SaveScreen(1); { Save screen image after Menu1 setup so it can be restored }
  26.  
  27. Repeat Case PickMenuBox of    { Play with Menu1 }
  28. 'M' : Begin    { Menu Info Picked}
  29.        WriteSt('These pop up menus are created and accessed by two ',5,15);
  30.        WriteSt('easy to use routines: SetMenuBox and PickMenuBox.  ',5,16);
  31.        WriteSt('SetMenuBox sets the location of the menu and the menu',5,17);
  32.        WriteSt('picks.  Function PickMenuBox allows the user to play',5,18);
  33.        WriteSt('with the menus and returns a character based on the ',5,19);
  34.        WriteSt('users pick.  PickMenuBox is intended to be used in a  ',5,20);
  35.        WriteSt('case statement where logic for each pick is executed.',5,21);
  36.       End;
  37. 'C' :  Begin    { Crawl submenu Picked}
  38.       SetMenuBox(25,5,Menu2);     { Get ready to play with Menu2 }
  39.       ExitSub := false;
  40.  
  41.       Repeat Case PickMenuBox of  { Play with Menu2 }
  42.        'B' : WriteSt('Baby crawl',1,24);
  43.        'S' : WriteSt('Slow crawl',1,24);
  44.        'F' : WriteSt('Fast crawl',1,24);
  45.        'E',#0  : ExitSub := true; { This is a good way to exit menus }
  46.                                   { #0 returned when esc key hit     }
  47.       End; { Case PickMenuBox for Menu2 }
  48.       Until ExitSub;
  49.  
  50.       ResetBox;                   { This clears the reverse video on Menu2 }
  51.       SetMenuBox(5,5,Menu1);      { Get ready to play with main menu }
  52.      End;
  53.  
  54. 'W' :  Begin
  55.         FillScr('W');
  56.         WriteSt('Walk      ',1,24);   { Back to main menu picks }
  57.         ResetBox;                     { Rewrite the main menu }
  58.        End;
  59. 'R' :  WriteSt('Run       ',1,24);
  60. 'F' :  WriteSt('Fly       ',1,24);
  61. 'S' :  RestoreScreen(1);
  62. 'E',#0 :  ExitNow := true;
  63. End;{ case PickMenuBox for Menu1 }
  64. Until ExitNow;
  65.  
  66. End.
  67.