home *** CD-ROM | disk | FTP | other *** search
- Program PullTTT5_Demo_3;
-
- {This program is very similar to Pulldem1.pas and Pulldem2.pas. The main
- difference is that a User Hook has been added}
-
- Uses CRT, DOS, FastTTT5, WinTTT5, KeyTTT5, PullTTT5;
-
- var
- TheMenu : Pull_Array; {Array holding the menu definitions}
- Major,Minor : byte;
-
-
- {$F+}
- Procedure Menu_Help(Var ChM:Char;PickM,PickS : byte);
- {an example of how to hook other procedures into the menu system}
- var Ch : char;
- begin
- If ChM = #187 then
- begin
- MkWin(20,7,60,15,white,red,1);
- WriteAT(22,9,white,red,'This could be context sensitive');
- WriteAT(22,10,white,red,'about the highlighted pick:');
- GotoXY(25,12);Write('Main Pick ',PickM);
- GotoXY(25,13);Write('Sub Pick ',PickS);
- Ch := GetKey;
- RmWin;
- end;
- end;
- {$F-}
-
- Procedure Define_Demo_Menu;
- begin
- Fillchar(TheMenu,sizeof(TheMenu),#0); {Empty the array}
- TheMenu[1] := '\File'; {menu definition for pull down menu}
- TheMenu[2] := 'Load ';
- TheMenu[2] := 'Pick ';
-
- TheMenu[3] := 'New ';
- TheMenu[4] := 'Save ';
- TheMenu[5] := 'Write to ';
- TheMenu[6] := 'Directory ';
- TheMenu[7] := 'Change dir ';
- TheMenu[8] := 'OS shell ';
- TheMenu[9] := 'Quit ';
-
- TheMenu[10] := '\Edit ';
-
- TheMenu[11] := '\Run ';
- TheMenu[12] := 'Program reset ';
- TheMenu[13] := 'Go to cursor ';
- TheMenu[14] := 'Trace into ';
- TheMenu[15] := ' Step Over ';
- TheMenu[16] := 'User Screen ';
-
- TheMenu[17] := '\Compile';
- TheMenu[18] := 'Compile ';
- TheMenu[19] := 'Make ';
- TheMenu[20] := 'Build ';
- TheMenu[21] := 'Destination ';
- TheMenu[22] := 'Find Error ';
- TheMenu[23] := 'Primary file ';
- TheMenu[24] := 'Get Info ';
-
- TheMenu[25] := '\Options';
- TheMenu[26] := 'Compiler ';
- TheMenu[27] := 'Linker ';
- TheMenu[28] := 'Environment ';
- TheMenu[29] := 'Directories ';
- TheMenu[30] := 'Parameters ';
- TheMenu[31] := 'Save Options ';
- TheMenu[32] := 'Retrieve Options';
-
- TheMenu[22] := '\Debug';
- TheMenu[23] := 'Evaluate ';
- TheMenu[23] := 'Call stack ';
- TheMenu[24] := 'Find procedure ';
- TheMenu[25] := 'Integrated debugging ';
- TheMenu[26] := 'Stand-alone debugging ';
- TheMenu[27] := 'Display Swapping ';
- TheMenu[28] := 'Refresh display ';
-
- TheMenu[29] := '\Break/Watch';
- TheMenu[30] := 'Add Watch ';
- TheMenu[31] := 'Delete Watch ';
- TheMenu[32] := 'Edit Watch ';
- TheMenu[33] := 'Remove all watches ';
- TheMenu[34] := 'Toggle breakpoint ';
- TheMenu[35] := 'Clear all breakpoints ';
- TheMenu[36] := 'View next breakpoint ';
-
- TheMenu[37] := '\\';
- end; {Proc Define demo menu}
-
-
- begin {main demo program}
- Define_Demo_Menu;
- Major := 1;
- Minor := 4;
- FillScreen(1,1,80,25,white,blue,chr(177));
- WriteAt(25,9,yellow,blue,'Press F1 for Help');
- {$IFDEF VER50}
- PTTT.Hook := Menu_Help;
- {$ELSE}
- PM_UserHook := @Menu_Help;
- {$ENDIF}
- With PTTT do {modify the display characteristics}
- begin
- Style := 0; {0 no border, 1 single border, 2 double border}
- TopX := 1;
- TopY := 2;
- Gap := 5;
- AlwaysDown := true;
- end; {With}
- Pull_Menu(TheMenu,Major,Minor);
- Clrscr;
- If Major = 0 then
- Write('You escaped')
- else
- Write('You selected main menu ',Major,' and sub-topic ',Minor);
- WriteAT(1,4,white,black,'Run DemoTTT.exe for the main demo program');
- WriteAT(1,5,white,black,'TechnoJock''s Turbo Toolkit v5.0');
- GotoXY(1,7);
- end.
-