home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / BOXMENU.ZIP / BOXMENU.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1985-09-17  |  4.1 KB  |  91 lines

  1. (*$C-,V-,U-*)
  2. Program MenuDemo;
  3.  
  4. {----------------------------------------------------------------------}
  5. {              MenuDemo --- Demonstrate TURBO Menu Routines            }
  6. {----------------------------------------------------------------------}
  7. {                                                                      }
  8. {  Highly Modified:   Randall L. Smith                                 }
  9. {  Original Author:   Philip R. Burns                                  }
  10. {  Date:     September, 1985                                           }
  11. {  Version:  1.0                                                       }
  12. {  Systems:  For MS-DOS on IBM PCs and close compatibles only.         }
  13. {            Note:  I have checked these on IBM-PC/XT and              }
  14. {                   PC-3270 under PCDOS 2.1.                           }
  15. {                                                                      }
  16. {  Overview: This program provides a short demo of the routines in     }
  17. {            BOXMENU.BOX.  A selection menu is created.  After a       }
  18. {            selection is made, a string menu is displayed.            }
  19. {                                                                      }
  20. {            Suggestions for improvements or corrections are welcome.  }
  21. {            Please leave messages on Gene Plantz's BBS (312) 882 4145 }
  22. {            or Ron Fox's BBS (312) 940 6496.                          }
  23. {                                                                      }
  24. {            I hope that you find this program useful -- and,          }
  25. {            if you expand upon it, please upload your extensions so   }
  26. {            that all of us can enjoy them!                            }
  27. {                                                                      }
  28. {----------------------------------------------------------------------}
  29. {$I TURBOWIN.BOX }  { These are necessary for BOXMENU.BOX }
  30. {$I SCRNDEF.BOX }   { These are necessary for BOXMENU.BOX }
  31. {$I SCRNSAVE.BOX }  { These are necessary for BOXMENU.BOX }
  32. {$I KBDCHAR.BOX }   { These are necessary for BOXMENU.BOX }
  33. {$I BOXMENU.BOX }
  34. Var
  35.   Ret         : integer;           { Return code from Box Menu Select  }
  36.   RetStr      : String[80];        { String for string response        }
  37.   TitleStr    : String[80];        { String for menu title             }
  38. {----------------------------------------------------------------------}
  39. {                         Begin Main Program                           }
  40. {----------------------------------------------------------------------}
  41.  
  42. Begin { MenuDemo }
  43.  
  44.                                    { Select color/mono screen }
  45.  
  46.    Set_Screen_Address( Actual_Screen );
  47.  
  48.  
  49.                                    { Display the menu }
  50.  
  51.    Ret := BoxMenu( 10, 4, 25, 5,
  52.                          LightBlue, White,
  53.                          Red, 8, 'File Maintenance Menu',
  54.                          4, 1,
  55.                          ' Load ',
  56.                          ' Save ',
  57.                          ' Directory ',
  58.                          ' Quit ',
  59.                          ' Erase ',
  60.                          '',
  61.                          '',
  62.                          '',
  63.                          '', '' );
  64.    GotoXY( 4, 5 );
  65.    Write( 'The value returned is : ', Ret, '  Hit Return to Continue.' );
  66.    Read;
  67.    Case Ret of 
  68.      1: TitleStr := ' Name for Load ';
  69.      2: TitleStr := ' Name for Save ';
  70.      3: TitleStr := ' Name for Directory ';
  71.      4: TitleStr := ' Name for Quit ';
  72.      5: TitleStr := ' Name for Erase ';
  73.      58..69  : TitleStr := ' Name for Function Key ';
  74.    end;
  75.    RetStr := BoxString( 20, 7, 30,
  76.                         1,
  77.                         White, Blue, Green,
  78.                         TitleStr,
  79.                         'default',
  80.                         'U',
  81.                         8, 1, 8 );
  82.  
  83.    GotoXY( 5, 15 );
  84.    Write( 'The String returned from the Menu is: ' );
  85.    Write( RetStr );
  86.    GotoXY( 20, 17 );
  87.    NormVideo;
  88.    Write( '    Hit return to terminate.' );
  89.    Read;
  90. End.   { MenuDemo }
  91.