[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
DisplayMenu MenuTTT
Purpose To display a highly formatted menu window.
Declaration Displaymenu(MenuDef: menu_record;
Window: boolean;
var Choice,Retcode: integer);
MenuDef - the name of the menu record.
Window - when true indicates the screen prior to menu
display should be restored after menu completion.
Choice is returned with the users menu selection. The
variable should be initialized to the menu pick that should
be highlighted when the menu is first displayed.
Retcode is returned with a value of zero if the execution
was successful, or 1 if the user pressed Esc and AllowEsc
was enabled.
Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, MenuTTT.
Example Program Menu_Demo;
Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, MenuTTT;
var
M : menu_record;
Choice, Retcode : integer;
Ch : char;
Procedure Define_M;
begin
With M do
begin
Heading1 := 'TechnoJocks';
Heading2 := 'Menu';
Topic[1] := ' Help';
Topic[2] := ' Load Database';
Topic[3] := ' Re-index Database ';
Topic[4] := ' Input new Data';
Topic[5] := ' Save Database';
Topic[6] := ' Print Reports';
Topic[7] := ' Quit';
TotalPicks := 7;
PicksPerLine := 1;
AddPrefix := 3;
TopleftXY[1] := 0;
TopLeftXY[2] := 4;
BoxType := 5;
Margins := 5;
Colors[1] := white;
Colors[2] := red;
Colors[3] := lightgray;
Colors[4] := blue;
Colors[5] := lightcyan;
AllowEsc := true;
end;
end;
begin
Fillscreen(1,1,80,25,white,blue,chr(177));
ClearLine(25,white,black);
WriteCenter(25,lightgray,black,'TechnoJocks Turbo Toolkit');
Choice := 1;
Define_M;
DisplayMenu(M,False,Choice,Retcode);
writeln;
GotoXY(1,20);
If Retcode = 0 then
Writeln('You chose option ',Choice)
else
Writeln('You escaped!');
WriteAT(1,22,white,black,'Run DemoTTT.exe for the main demo program');
WriteAT(1,23,white,black,'Technojocks Turbo Toolkit v4.0');
Ch := Readkey;
end.
See Also:
Pull_Menu
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson