home *** CD-ROM | disk | FTP | other *** search
- Program WinTTT5_Demo_3;
- {
- This program is designed to illustrate the power of the FastTTT and
- WinTTT units. The demo code has been designed to illustrate the ways in
- which the Toolkit procedure and functions can be included in your programs.
- The program itself has no real prurpose other than to flash various info
- onto the screen.
- }
-
- Uses DOS,CRT,FastTTT5,WinTTT5,KeyTTT5; { As a habit, I always USE the DOS }
- { and CRT units as well as the Tool- }
- { kit units. KeyTTT is also included }
- { because I will be including the }
- { GetKey function. }
-
- Procedure Welcome;
- { paints an introduction screen }
- begin
- CreateScreen(3,25);
- Activate_Virtual_Screen(3); {all subsequent writes will be to screen 3}
- ClearText(1,1,80,25,white,blue); { Clear the screen with a blue background }
- WriteCenter(1,white,blue,'FASTTTT and WINTTT Demonstration'); { write in middle of line 1}
- FBox(20,5,61,15,white,red,1); { draw a single line filled box }
- WriteAT(22,7,white,red,'This demo is designed to illustrate');
- WriteAT(22,8,white,red,'the features of the FastTTT and WinTTT');
- WriteAT(22,9,white,red,'units.');
- WriteAT(22,11,white,red,'While you have been reading this, two');
- WriteAT(22,12,white,red,'other screens have been written on the');
- WriteAT(22,13,white,red,'heap.');
- Activate_Visible_Screen;
- end; {proc Welcome}
-
- Procedure Prepare_Virtual_Screen_1;
- { allocates a new screen on the heap and writes text to it }
- begin
- CreateScreen(1,25); {create a new screen - referred to as screen 1}
- Activate_Virtual_Screen(1); {all subsequent writes will be to screen 1}
- ClearText(1,1,80,25,yellow,Green); {clear the screen on the heap}
- WriteCenter(1,white,green,'Virtual Screens'); {write a heading in the center of line 1}
- HorizLine(15,65,2,white,green,2); {draw a double line}
- PlainWrite(10,4,'Virtual screens have all the characteristics of the visible');
- PlainWrite(10,5,'screen. The main advantage of virtual screens is that they can');
- PlainWrite(10,6,'be prepared while the user is viewing a different image.');
- PlainWrite(10,8,'They are very useful for preparing help screens that may, or');
- PlainWrite(10,9,'may not, be displayed. This screen was prepared while you');
- PlainWrite(10,10,'were viewing the welcome screen.');
- GotoXY(43,10); {GotoXY works on virtual screens as well}
- Activate_Visible_Screen; {set subsequent writes to the visble screen}
- end; { Prepare_Virtual_Screen_1}
-
- Procedure Prepare_Virtual_Screen_2;
- { allocates a new screen on the heap and writes text to it }
- begin
- CreateScreen(2,25); {create a new screen - referred to as screen 2}
- Activate_Virtual_Screen(2); {all subsequent writes will be to screen 2}
- ClearText(1,1,40,25,white,red); {clear the screen on the heap}
- ClearText(41,1,80,25,black,lightgray); {clear the screen on the heap}
- PlainWrite(28,1,'This was written with Plainwrite'); {use default display colors}
- Fillscreen(10,5,25,10,white,red,'*');
- CopyScreenBlock(10,5,25,10,50,15); {the copy and move operations work on the virtual screen}
- CopyScreenBlock(10,5,25,10,10,15); {the copy and move operations work on the virtual screen}
- MoveScreenBlock(10,15,25,20,30,18);
- Activate_Visible_Screen; {set subsequent writes to the visble screen}
- end; { Prepare_Virtual_Screen_1}
-
- Procedure Press_A_Key;
- {display a message in a single lined box}
- begin
- DelayKey(2000);
- TempMessageBox(54,23,black,cyan,1,'Press any key to continue');
- end;
-
- begin {main program}
- W_fatal := true; {the program will halt if WinTTT has serious error}
- ClrScr;
- Welcome;
- SlideRestoreScreen(3,Up);
- Prepare_Virtual_Screen_1;
- Prepare_Virtual_Screen_2;
- Press_A_key;
- RestoreScreen(1); {Display screen 1 that was created on the heap}
- Press_A_key;
- RestoreScreen(2);
- Press_A_Key;
- DisposeScreen(1); {release the heap space taken by the screens}
- DisposeScreen(2);
- DisposeScreen(3);
- Reset_StartUp_Mode;
- end.