home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_01
/
2n01044b
< prev
next >
Wrap
Text File
|
1990-06-26
|
2KB
|
77 lines
(*
Test Driver for Graphical Radio-Button Panel
Turbo Pascal 4 Program
**************************************************
NOTE: All compilations should have the boolean
evaluation option set to "short-circuit"
**************************************************
June 26, 1990 -- Michael Kelly -- Version 1.01 *)
Program TryMenu;
Uses GuiMenu, Panel, Graph, Int16, Crt;
Var
ThisMenu : PanelMenu;
Procedure SetUp; { Load the PanelMenu with option strings }
Begin
ThisMenu[1] := 'Turbo Pascal 4 GUI';
ThisMenu[2] := '';
ThisMenu[3] := 'A Graphical Radio-Button';
ThisMenu[4] := '';
ThisMenu[5] := 'Panel Prototype';
ThisMenu[6] := '';
ThisMenu[7] := 'Click on a Button';
ThisMenu[8] := 'or Press the Enter Key';
ThisMenu[9] := '';
ThisMenu[MaxButton] := 'Quit';
End;
(* SetUp *)
Procedure Dispatch; { Process user selection returned by MainMenu }
Var
k : Integer;
ascii, scan : Byte;
str : ButtonTag;
Begin
Repeat
k := MainMenu(ThisMenu);
If k = -1 then { -1 indicates an error has occurred }
Begin
CloseMenu;
WriteLn;
WriteLn('Error Initializing Graphics Menu');
WriteLn;
WriteLn('Program Requires Ega or Vga Graphics Adaptor');
Halt;
End;
If k in[1..9] then
Begin
str := #39;
str := str + ThisMenu[k];
str := str + #39;
OutTextXY(10, 310,'You Pressed ...');
OutTextXY(10, 320, str);
OutTextXY(10, 330, '( Press Any Key ... )');
get_key(ascii, scan);
End;
Until k = MaxButton; { In this example, bottom selection is 'Quit' option }
delay(500);
CloseMenu; { Restore video state }
End;
(* Dispatch *)
{ Main }
Begin
SetUp;
Dispatch;
End.