home *** CD-ROM | disk | FTP | other *** search
- (* ------------------------------------------------------ *)
- (* SWDEMO.PAS *)
- (* Demoprogramm zur Unit SimWin. Es werden ein paar *)
- (* zufällige Fensterchen geöffnet. *)
- (* (c) 1990 R.Reichert & TOOLBOX *)
- (* ------------------------------------------------------ *)
- PROGRAM SimpleWindowDemo;
-
- USES Crt, SimWin;
-
- VAR
- i : BYTE;
- Window : SimpleWindow;
-
- PROCEDURE PressMsg;
- CONST
- M : STRING = 'Press any key';
- VAR
- ch : CHAR;
- BEGIN
- GotoXY(40 - Length(m) DIV 2, 25);
- DelLine;
- TextAttr := 15 + 7*16;
- Write(m);
- Ch := ReadKey;
- TextAttr := $7;
- DelLine;
- END;
-
- BEGIN
- CheckBreak := FALSE;
- Randomize;
- TextAttr := 7;
- ClrScr;
- FOR i := 1 TO 80 DO Write ('toolbox ');
- GotoXY(1,1);
- Window.Init(SimpleWinData);
-
- FOR i := 1 TO 30 DO BEGIN { so besser nicht! }
- Window.Close;
- WITH Window DO BEGIN
- x1 := 40 - i; x2 := 40 + i;
- y1 := 10; y2 := 13;
- FrameArt := 2;
- END;
- Window.Open;
- Delay (20);
- END;
- ReadLn;
-
- FOR i := 1 TO 50 DO BEGIN { schon besser! }
- WITH SimpleWinData DO BEGIN
- x1 := 1 + Random (20);
- y1 := 1 + Random (10);
- x2 := 21 + Random (59);
- y2 := 11 + Random (14);
- FrameArt := 1 + Random (4);
- END;
- Window.ReOpen(SimpleWinData);
- Delay(200);
- END;
- PressMsg;
-
- FOR i := 1 TO 5 DO BEGIN
- Window.ChangeFrame (i);
- PressMsg;
- END;
- Window.Done;
- PressMsg;
- ClrScr;
- END.
- (* ------------------------------------------------------ *)
- (* Ende von SWDEMO.PAS *)