home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMVI1.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  5KB  |  145 lines

  1. Program DemoVirtualOne;
  2.  
  3. Uses CRT, totFast;
  4.  
  5. Var
  6.   Screen1,
  7.   Screen2,
  8.   Screen3 : ScreenObj;   {screen objects}
  9.   HeadCol,
  10.   MsgCol,
  11.   NormCol : byte;
  12.  
  13. procedure Pause;
  14. {}
  15. var Ch : char;
  16. begin
  17.    Ch := ReadKey;
  18. end; {of proc pause}
  19.  
  20. procedure Initialize;
  21. {}
  22. begin
  23.    Screen1.Init;
  24.    Screen2.Init;
  25.    Screen3.Init;
  26.    HeadCol := CAttr(yellow,blue);
  27.    MsgCol  := CAttr(yellow,red);
  28.    NormCol := CAttr(white,blue);
  29. end; {proc Initialize}
  30.  
  31. procedure IntroScreen;
  32. {}
  33. const 
  34.     Tab = 8;
  35. begin
  36.    HeadCol := CAttr(yellow,blue);
  37.    MsgCol  := CAttr(yellow,red);
  38.    NormCol := CAttr(white,blue);
  39.    with Screen do {manipulate the visible screen}
  40.    begin
  41.       Clear(NormCol,' ');
  42.       WriteCenter(1,HeadCol,'TechnoJock''s Object Toolkit');
  43.       WriteCenter(2,HeadCol,'Copyright 1991 TechnoJock Software, Inc.');
  44.       WritePlain(Tab,5,'The totFAST unit includes the object ScreenOBJ. The interface');
  45.       WritePlain(Tab,6,'section of the unit includes an instance of ScreenOBJ called');
  46.       WritePlain(Tab,7,'SCREEN. You can create other instances of ScreenOBJ and these');
  47.       WritePlain(Tab,8,'are effectively virtual screens created on the heap. At any');
  48.       WritePlain(Tab,9,'time, the visible screen can be saved to a ScreenOBJ instance,');
  49.       WritePlain(Tab,10,'or a ScreenOBJ instance can be displayed on the visible screen.');
  50.       WritePlain(Tab,12,'You can write to the visible screen with SCREEN methods, or');
  51.       WritePlain(Tab,13,'write to a virtual screen by calling the methods of any other');
  52.       WritePlain(Tab,14,'instance.');
  53.       WritePlain(Tab,16,'While you have been reading this screen, 3 other screens have');
  54.       WritePlain(Tab,17,'been created. Press any key to see these screens slide onto');
  55.       WritePlain(Tab,18,'the display.');
  56.       WriteRight(80,25,MsgCol,'Press any key to continue ....');
  57.    end;
  58. end; {of proc IntroScreen}
  59.  
  60. procedure BuildScreen2;
  61. {}
  62. const 
  63.    Tab = 8; Tab1 = 10;
  64. begin
  65.    HeadCol := CAttr(yellow,red);
  66.    MsgCol  := CAttr(yellow,red);
  67.    NormCol := CAttr(white,red);
  68.    with Screen2 do
  69.    begin
  70.       Create(80,25,NormCol);
  71.       WriteCenter(1,HeadCol,'Screen Writing');
  72.       WritePlain(Tab,5,'The ScreenOBJ object boasts a large number of screen writing');
  73.       WritePlain(Tab,6,'methods, including the following:');
  74.       WriteHi(Tab1,8,MsgCol,NormCol,'~Write~ writes at cursor position in default color');
  75.       WriteHi(Tab1,9,MsgCol,NormCol,'~WriteHi~ writes at X,Y using highlights');
  76.       WriteHi(Tab1,10,MsgCol,NormCol,'~WritePlain~ writes at X,Y using existing attribute');
  77.       WriteHi(Tab1,11,MsgCol,NormCol,'~WriteAt~ writes at X,Y using a specified color');
  78.       WriteHi(Tab1,12,MsgCol,NormCol,'~WriteCap~ writes highlighting first capital letter');
  79.       WriteHi(Tab1,13,MsgCol,NormCol,'~WriteClick~ writes with a tactile click!');
  80.       WriteHi(Tab1,14,MsgCol,NormCol,'~WriteCenter~ writes text centered on screen');
  81.       WriteHi(Tab1,15,MsgCol,NormCol,'~WriteBetween~ writes centered between two X coords');
  82.       WriteHi(Tab1,16,MsgCol,NormCol,'~WriteRight~ writes right justified');
  83.       WriteHi(Tab1,17,MsgCol,NormCol,'~WriteVert~ writes in a vertical column ');
  84.       WritePlain(Tab,19,'Other methods provide full control of the cursor, the');
  85.       WritePlain(Tab,20,'ability to read characters from any location on a screen');
  86.       WritePlain(Tab,21,'and objects for controlling the physical display');
  87.       WritePlain(Tab,22,'attributes, e.g. set into condensed display. Press any');
  88.       WritePlain(Tab,23,'key to see the box and line drawing capabilities.');
  89.       GotoXY(57,23);
  90.    end;
  91. end; {of proc BuildScreen2}
  92.  
  93. procedure BuildScreen3;
  94. {}
  95. const 
  96.    Tab = 8;
  97. begin
  98.    HeadCol := CAttr(yellow,blue);
  99.    MsgCol  := CAttr(yellow,red);
  100.    NormCol := CAttr(white,blue);
  101.    with Screen3 do
  102.    begin
  103.       Create(80,25,NormCol);
  104.       TitledBox(1,1,80,25,NormCol,HeadCol,NormCol,4,'|Box drawing');
  105.       WritePlain(Tab,4,'The ScreenOBJ objects includes some very easy-to-use box drawing');
  106.       WritePlain(Tab,5,'methods. Boxes can be draw as a frame or filled, and optionally');
  107.       WritePlain(Tab,6,'draw titles at the top, in a drop box, or at the bottom of the box.');
  108.       TitledBox(Tab,8,39,15,MsgCol,MsgCol,MsgCol,3,' Centered ');
  109.       TitledBox(Tab+5,10,44,17,MsgCol,MsgCol,MsgCol,1,'< Left ');
  110.       TitledBox(Tab+10,12,49,19,MsgCol,MsgCol,MsgCol,2,'> Right ');
  111.       TitledBox(53,8,75,19,MsgCol,MsgCol,MsgCol,1,'| In a Drop Box ');
  112.       WritePlain(Tab,21,'There are also methods for drawing single and double lines');
  113.       WritePlain(Tab,22,'that automatically draw "junctions" when another line is ');
  114.       WritePlain(Tab,23,'met or crossed. Press any key to see the smart line facility.');
  115.       CursOff;
  116.    end;
  117. end; {of proc BuildScreen3}
  118.  
  119.  
  120. begin
  121.    Initialize;
  122.    IntroScreen;
  123.    BuildScreen2;
  124.    BuildScreen3;
  125.    Pause;
  126.    Screen1.Save;
  127.    Screen2.SlideDisplay(horiz);
  128.    Pause;
  129.    Screen3.SlideDisplay(vert);
  130.    Pause;
  131.    with Screen do
  132.    begin
  133.       SmartHorizLine(1,80,14,white,1);
  134.       SmartVertLine(35,8,19,white,2);
  135.       SmartVertLine(64,10,19,white,2);
  136.       WriteCenter(25,Cattr(black,white),'That''s all Folks!');
  137.    end;
  138.    Pause;
  139.    Screen1.Done;
  140.    Screen2.Done;
  141.    Screen3.Done;
  142.    ClrScr;
  143.    Screen.CursOn;
  144. end.
  145.