home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / pstui100.zip / DEMO3.PAS < prev    next >
Pascal/Delphi Source File  |  1993-02-09  |  5KB  |  196 lines

  1. {
  2.  
  3.                                                       ╔══════════════════╗
  4.                                                       ║   PTUI Demo      ║
  5.                                                       ║                  ║
  6.                                                       ║    Rev. 1.00     ║
  7.                                                       ╚══════════════════╝
  8.  
  9. }
  10.  
  11. {$F-} {$O-} {$A+} {$G-}
  12. {$V-} {$B-} {$X-} {$N+} {$E+}
  13.  
  14. {$I FINAL.PAS}
  15.  
  16. {$IFDEF FINAL}
  17.   {$I-} {$R-}
  18.   {$D-} {$L-} {$S-}
  19.   {$M 8192,262144,655360}
  20. {$ELSE}
  21.   {$M 8192,0,655360}
  22. {$ENDIF}
  23.  
  24. Program PTUIDemo;
  25.  
  26. Uses CRT,PTUI,Strings,PTUIVCRT;
  27.  
  28. Const
  29.   DelayTime = 500;
  30.  
  31. Procedure TextDemo;
  32.  
  33. Var
  34.   SlideBar  :SlideBarInfo;
  35.   TWin1     :TextWindow;
  36.   TWin2     :TextWindow;
  37.   Y,
  38.   X         :Byte;
  39.   C         :Char;
  40.   Temp      :String;
  41.  
  42. Begin
  43.   VideoColor(7,0);
  44.   ClrScr;
  45.   Mouse.Init(True);
  46.   Mouse.Show;
  47.   CursorSize($20,$20);
  48.   VideoColor(3,7);
  49.   For X:=1 to 71 do
  50.     WriteStr('Pure Power TUI             ');
  51.   WriteStr('Pur');
  52.  
  53.   TWin1.Open(10,10,50,20,Yellow,Green,Blue,Magenta,NoLine,Solid);
  54.   TWin1.NewSize(10,5,50,20);
  55.   TWin1.NewHeading('Information',CentreText,0,3);
  56.   Repeat
  57.     VideoColor(0,2);
  58.     GotoXY(12,11);
  59.     WriteStr('To demonstarte the "Change Size"');
  60.     GotoXY(12,12);
  61.     WriteStr('feature, this box will change');
  62.     GotoXY(12,13);
  63.     WriteStr('sizes, ranging from small to');
  64.     GotoXY(12,14);
  65.     WriteStr('large.  Press a number from 1 to 3,');
  66.     GotoXY(12,15);
  67.     WriteStr('or press [Esc] to continue.');
  68.     GotoXY(12,17);
  69.     Str(MemAvail,Temp);
  70.     WriteStr('Free Memory: '+Temp+' bytes.');
  71.     C:=ReadKey;
  72.     Case C Of
  73.         '1':TWin1.NewSize(10,8,50,20);
  74.         '2':TWin1.NewSize( 9,5,60,20);
  75.         '3':TWin1.NewSize( 6,3,70,22);
  76.     End;
  77.   Until C=#27;
  78.   X:=50;
  79.   Y:=20;
  80.   TWin1.NewHeading('',LeftText,0,3);
  81.   Repeat
  82.     TWin1.NewSize(4,4,X,Y);
  83.     Dec(Y,2);
  84.     Dec(X,4);
  85.   Until Y<7;
  86.   TWin1.Close;
  87.   TWin1.Open(20,8,60,20,Green,Black,Red,Blue,DoubleLine,Solid);
  88.   TWin1.NewHeading('Box Styles',CentreText,0,2);
  89.   Repeat
  90.     VideoColor(2,0);
  91.     GotoXY(22,11);
  92.     WriteStr('To demonstarte the "Box Styles"');
  93.     GotoXY(22,12);
  94.     WriteStr('feature, this box will change');
  95.     GotoXY(22,13);
  96.     WriteStr('styles.  Select the different');
  97.     GotoXY(22,14);
  98.     WriteStr('styles by selecting a letter range A');
  99.     GotoXY(22,15);
  100.     WriteStr('to L or pressing [Esc] to continue.');
  101.     GotoXY(22,17);
  102.     Str(MemAvail,Temp);
  103.     WriteStr('Free Memory: '+Temp+' bytes.');
  104.     C:=UpCase(ReadKey);
  105.     Case C Of
  106.         'A':TWin1.NewStyle( 2,0,6,0,SingleLine,Solid);
  107.         'B':TWin1.NewStyle( 2,0,6,0,DoubleLine,Solid);
  108.         'C':TWin1.NewStyle( 2,0,6,0,    NoLine,Solid);
  109.         'D':TWin1.NewStyle( 4,0,6,0,SingleLine,LightHash);
  110.         'E':TWin1.NewStyle( 4,0,6,0,DoubleLine,LightHash);
  111.         'F':TWin1.NewStyle( 4,0,6,0,    NoLine,LightHash);
  112.         'G':TWin1.NewStyle(14,0,6,0,SingleLine,MediumHash);
  113.         'H':TWin1.NewStyle(14,0,6,0,DoubleLine,MediumHash);
  114.         'I':TWin1.NewStyle(14,0,6,0,    NoLine,MediumHash);
  115.         'J':TWin1.NewStyle(10,0,2,0,SingleLine,DarkHash);
  116.         'K':TWin1.NewStyle(12,0,2,0,DoubleLine,DarkHash);
  117.         'L':TWin1.NewStyle(10,0,2,0,    NoLine,DarkHash);
  118.     End;
  119.   Until C=#27;
  120.  
  121.   TWin1.NewSize(30,10,50,17);
  122.   TWin1.NewStyle(2,0,6,4,NoLine,Solid);
  123.   TWin1.NewHeading('Window 1',CentreText,0,2);
  124.   VideoColor(2,0);
  125.   GotoXY(32,13);
  126.   WriteStr('Windows can also');
  127.   GotoXY(32,14);
  128.   WriteStr('lie in the back.');
  129.  
  130.   TWin2.Open(10,5,35,15,0,2,4,5,SingleLine,Solid);
  131.   TWin2.NewHeading('Window 2',CentreText,0,4);
  132.   VideoColor(0,2);
  133.   GotoXY(12,9);
  134.   WriteStr('Windows can be moved');
  135.   GotoXY(12,10);
  136.   WriteStr('around the screen so');
  137.   GotoXY(12,11);
  138.   WriteStr('easily!');
  139.   Delay(DelayTime);
  140.   TWin2.NewPosition(15,10);
  141.   Delay(DelayTime);
  142.   TWin2.NewPosition(20,5);
  143.   Delay(DelayTime);
  144.   TWin2.NewPosition(10,3);
  145.   Delay(DelayTime);
  146.   TWin2.NewPosition(40,12);
  147.   Delay(DelayTime);
  148.   TWin2.NewPosition(25,9);
  149.   Delay(DelayTime);
  150.   TWin2.NewPosition(50,2);
  151.   Delay(DelayTime);
  152.   TWin2.NewPosition(52,12);
  153.   TWin2.Close;
  154.  
  155.   VideoColor(2,0);
  156.   GotoXY(32,13);
  157.   WriteStr('    Bye  Bye    ');
  158.   GotoXY(32,14);
  159.   WriteStr(' See you later. ');
  160.   C:=ReadKey;
  161.   TWin1.Close;
  162. End;
  163.  
  164. Procedure EndTextDemo;
  165.  
  166. Var
  167.   Y,
  168.   X:Byte;
  169.  
  170. Begin
  171.   VideoColor(7,0);
  172.   Y:=1;
  173.   Repeat
  174.     X:=0;
  175.     Repeat
  176.       GotoXY(1+X,Y);
  177.       WriteStr(' ');
  178.       GotoXY(80-X,Y);
  179.       WriteStr(' ');
  180.       GotoXY(1+X,25-Y);
  181.       WriteStr(' ');
  182.       GotoXY(80-X,25-Y);
  183.       WriteStr(' ');
  184.       Inc(X);
  185.     Until X=41;
  186.     Inc(Y);
  187.   Until Y=13;
  188. End;
  189.  
  190. Begin
  191.   PushCursorSize;
  192.   TextDemo;
  193.   EndTextDemo;
  194.   PopCursorSize;
  195. End.
  196.