home *** CD-ROM | disk | FTP | other *** search
- (*$C-,V-,U-*)
- Program MenuDemo;
-
- {----------------------------------------------------------------------}
- { MenuDemo --- Demonstrate TURBO Menu Routines }
- {----------------------------------------------------------------------}
- { }
- { Highly Modified: Randall L. Smith }
- { Original Author: Philip R. Burns }
- { Date: September, 1985 }
- { Version: 1.0 }
- { Systems: For MS-DOS on IBM PCs and close compatibles only. }
- { Note: I have checked these on IBM-PC/XT and }
- { PC-3270 under PCDOS 2.1. }
- { }
- { Overview: This program provides a short demo of the routines in }
- { BOXMENU.BOX. A selection menu is created. After a }
- { selection is made, a string menu is displayed. }
- { }
- { Suggestions for improvements or corrections are welcome. }
- { Please leave messages on Gene Plantz's BBS (312) 882 4145 }
- { or Ron Fox's BBS (312) 940 6496. }
- { }
- { I hope that you find this program useful -- and, }
- { if you expand upon it, please upload your extensions so }
- { that all of us can enjoy them! }
- { }
- {----------------------------------------------------------------------}
- {$I TURBOWIN.BOX } { These are necessary for BOXMENU.BOX }
- {$I SCRNDEF.BOX } { These are necessary for BOXMENU.BOX }
- {$I SCRNSAVE.BOX } { These are necessary for BOXMENU.BOX }
- {$I KBDCHAR.BOX } { These are necessary for BOXMENU.BOX }
- {$I BOXMENU.BOX }
- Var
- Ret : integer; { Return code from Box Menu Select }
- RetStr : String[80]; { String for string response }
- TitleStr : String[80]; { String for menu title }
- {----------------------------------------------------------------------}
- { Begin Main Program }
- {----------------------------------------------------------------------}
-
- Begin { MenuDemo }
-
- { Select color/mono screen }
-
- Set_Screen_Address( Actual_Screen );
-
-
- { Display the menu }
-
- Ret := BoxMenu( 10, 4, 25, 5,
- LightBlue, White,
- Red, 8, 'File Maintenance Menu',
- 4, 1,
- ' Load ',
- ' Save ',
- ' Directory ',
- ' Quit ',
- ' Erase ',
- '',
- '',
- '',
- '', '' );
- GotoXY( 4, 5 );
- Write( 'The value returned is : ', Ret, ' Hit Return to Continue.' );
- Read;
- Case Ret of
- 1: TitleStr := ' Name for Load ';
- 2: TitleStr := ' Name for Save ';
- 3: TitleStr := ' Name for Directory ';
- 4: TitleStr := ' Name for Quit ';
- 5: TitleStr := ' Name for Erase ';
- 58..69 : TitleStr := ' Name for Function Key ';
- end;
- RetStr := BoxString( 20, 7, 30,
- 1,
- White, Blue, Green,
- TitleStr,
- 'default',
- 'U',
- 8, 1, 8 );
-
- GotoXY( 5, 15 );
- Write( 'The String returned from the Menu is: ' );
- Write( RetStr );
- GotoXY( 20, 17 );
- NormVideo;
- Write( ' Hit return to terminate.' );
- Read;
- End. { MenuDemo }