home *** CD-ROM | disk | FTP | other *** search
- Program ListTTT5_Demo_3;
-
- {
- This an example is extension of the programs listdem1.pas and
- listdem2.pas. In this third example, a user hook has been added.
- }
-
- Uses CRT, DOS, FastTTT5, WinTTT5, ListTTT5;
-
- const
- ListWidth = 60;
- type
- StrList = string[ListWidth];
-
- var
- MyList : array[1..30] of StrList;
-
- Procedure Fill_MyList;
- {}
- begin
- MyList[1] := 'Erica';
- MyList[2] := 'Alison';
- MyList[3] := 'Barbara';
- MyList[4] := 'Sarah';
- MyList[5] := 'Katy';
- MyList[6] := 'Janice';
- MyList[7] := 'Susan';
- MyList[8] := 'Serita';
- MyList[9] := 'Anne';
- MyList[10] := 'Michelle';
- MyList[11] := 'Theresa';
- MyList[12] := 'Shirley';
- MyList[13] := 'Sue';
- MyList[14] := 'Marianne';
- MyList[15] := 'Wilma';
- MyList[16] := 'Beatrice';
- MyList[17] := 'Regina';
- MyList[18] := 'Sudofed';
- MyList[19] := 'Trojan';
- MyList[20] := 'Whip';
- end; {of proc Fill_MyList}
-
-
-
- {$F+}
- Procedure Commentary(var Ch:char; HiPick:byte);
- {}
- begin
- If Ch = #188 then {F2}
- Case HiPick of
- 1 : TempMessageBoxCh(2,10,white,blue,1,'Good fun but married',Ch);
- 2 : TempMessageBoxCh(2,10,white,blue,1,'Good looking but boring',Ch);
- 3 : TempMessageBoxCh(2,10,white,blue,1,'Nice but too shy',Ch);
- 4 : TempMessageBoxCh(2,10,white,blue,1,'Gross but rude',Ch);
- 5 : TempMessageBoxCh(2,10,white,blue,1,' 10 ',Ch);
- 6 : TempMessageBoxCh(2,10,white,blue,1,'Drinks like a horse (!!) ',Ch);
- 18: TempMessageBoxCh(2,10,white,blue,1,'For the morning after',Ch);
- 19: TempMessageBoxCh(2,10,white,blue,1,'Never leave home without ''em',Ch);
- 20: TempMessageBoxCh(2,10,white,blue,1,'You never know',Ch);
- else
- TempMessageBoxCh(2,10,white,blue,1,'No specific knowledge (yet!)',Ch);
- end;
- end; {of proc Commentary}
- {$F-}
-
- begin
- Fill_MyList;
- ClrScr;
- with LTTT do
- begin
- Lines := 15;
- Y := 2;
- LeftChar := chr(026);
- RightChar := ' ';
- AllowToggle := false;
- Hook := Commentary;
- end;
- WriteCenter(25,lightred,black,'Press F2 for a commentary');
- Show_List(MyList,ListWidth,20);
- ClearText(1,1,80,25,white,black);
- WriteAT(1,1,white,black,'Run DemoTTT.exe for the main demo program');
- WriteAT(1,2,white,black,'TechnoJock''s Turbo Toolkit v5.0');
- GotoXY(1,5);
- end.
-
-