home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 08 / grdlagen / swdemo.pas < prev   
Pascal/Delphi Source File  |  1990-05-01  |  2KB  |  74 lines

  1. (* ------------------------------------------------------ *)
  2. (*                     SWDEMO.PAS                         *)
  3. (*  Demoprogramm zur Unit SimWin. Es werden ein paar      *)
  4. (*  zufällige Fensterchen geöffnet.                       *)
  5. (*          (c) 1990 R.Reichert & TOOLBOX                 *)
  6. (* ------------------------------------------------------ *)
  7. PROGRAM SimpleWindowDemo;
  8.  
  9. USES Crt, SimWin;
  10.  
  11. VAR
  12.   i      : BYTE;
  13.   Window : SimpleWindow;
  14.  
  15.   PROCEDURE PressMsg;
  16.   CONST
  17.     M  : STRING = 'Press any key';
  18.   VAR
  19.     ch : CHAR;
  20.   BEGIN
  21.     GotoXY(40 - Length(m) DIV 2, 25);
  22.     DelLine;
  23.     TextAttr := 15 + 7*16;
  24.     Write(m);
  25.     Ch := ReadKey;
  26.     TextAttr := $7;
  27.     DelLine;
  28.   END;
  29.  
  30. BEGIN
  31.   CheckBreak := FALSE;
  32.   Randomize;
  33.   TextAttr   := 7;
  34.   ClrScr;
  35.   FOR i := 1 TO 80 DO Write ('toolbox ');
  36.   GotoXY(1,1);
  37.   Window.Init(SimpleWinData);
  38.  
  39.   FOR i := 1 TO 30 DO BEGIN    { so besser nicht! }
  40.     Window.Close;
  41.     WITH Window DO BEGIN
  42.       x1 := 40 - i;   x2 := 40 + i;
  43.       y1 := 10;       y2 := 13;
  44.       FrameArt := 2;
  45.     END;
  46.     Window.Open;
  47.     Delay (20);
  48.   END;
  49.   ReadLn;
  50.  
  51.   FOR i := 1 TO 50 DO BEGIN    { schon besser! }
  52.     WITH SimpleWinData DO BEGIN
  53.       x1 :=  1 + Random (20);
  54.       y1 :=  1 + Random (10);
  55.       x2 := 21 + Random (59);
  56.       y2 := 11 + Random (14);
  57.       FrameArt := 1 + Random (4);
  58.     END;
  59.     Window.ReOpen(SimpleWinData);
  60.     Delay(200);
  61.   END;
  62.   PressMsg;
  63.  
  64.   FOR i := 1 TO 5 DO BEGIN
  65.     Window.ChangeFrame (i);
  66.     PressMsg;
  67.   END;
  68.   Window.Done;
  69.   PressMsg;
  70.   ClrScr;
  71. END.
  72. (* ------------------------------------------------------ *)
  73. (*                Ende von SWDEMO.PAS                     *)
  74.