NBPrg40. SIMPLE.PAS. MiniOS. OpenSource.

NBPrg40. SIMPLE.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013  }

{ NBPRG23 -> ... -> NBPRG40 }

{ Nikita Beloshenko (GNU) 2012 }

Unit Simple;

(*************************************************
 *                                               *
 *   SIMPLE.PAS                                  *
 *                                               *
 *   Simple.                                     *
 *                                               *
 *************************************************)

Interface

Uses Graph, Crt;

Procedure DoSimple;

Implementation

Procedure DrawRectangle(Var x1,y1,x2,y2:Integer);
Begin
  Line(x1,y1,x2,y1);
  Line(x2,y1,x2,y2);
  Line(x2,y2,x1,y2);
  Line(x1,y2,x1,y1);
End;


Procedure DoSimple;
Var
  x1,y1,x2,y2 : Integer;
  ch1 : Char;
Begin
  x1 := 200; x2 := 300;
  y1 := 200; y2 := 300;

  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);

  While Ord(ch1)<>27 Do
  Begin
    SetColor(2);
    DrawRectangle(x1,y1,x2,y2);
    SetTextStyle(2, HorizDir, 5);
    OutTextXY(x1 + (x2-x1) Div 4,
              y1 + (y2-y1) Div 4,'Simple');

    ch1 := ReadKey;
  End;
  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);
End;

End.