{ MAXONPascal3-Anpassung / Test:  Falk Zühlsdorff (PackMAN) 1994 }

PROGRAM Grafik1;
USES GRAPHICS,INTUITION;

VAR
  Win: ^Window;
  Rp: ^RastPort; { dieser Typ wird in "graphics/rastport.h" definiert }
  err: long;
  Msg: Ptr;
  i: integer;

BEGIN
  Win:= Open_Window(0, 0, 640, 200, 1, _CLOSEWINDOW,
        GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH,
        'Grafikdemo', Nil, 640, 200, 640, 200);
  Rp:= Win^.RPort;

  Move(Rp, 5, 40);
  SetAPen(Rp, 1);    { Ausgabe: weiß ... }
  SetBPen(Rp, 3);    { ...auf rot }
  SetDrMd(Rp, 1);    { damit Hintergrundfarbe auch ausgegeben wird }
  err:=_Text(Rp, ' Dies ist eine Grafik-Demo. ######', 28);

  SetAPen(Rp, 3);    { rote Linien }
  For i:=0 to 20 Do
    BEGIN
      Move(Rp, 220+20*i, 5);
      Draw(Rp, 620, 5+9*i)
    END;

  For i:=1 to 10 do
    BEGIN
      SetAPen(Rp, 1 + i mod 3);    { wechselnde Farben }
      RectFill(Rp, 5*i, 75+2*i, 320-25*i, 180-8*i)
    END;

  Msg:= Wait_Port(Win^.UserPort);  { aufs Schließen warten }
  Msg:= Get_Msg(Win^.Userport);
  Reply_Msg(Msg);

  Close_Window(Win);
  CloseLib(Intuitionbase);
  CloseLib(GfxBase);
END.
