NBPrg40. EDIT.PAS. MiniOS. OpenSource.

NBPrg40. EDIT.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013  }

{ NBPRG23 -> ... -> NBPRG40 }

{ Nikita Beloshenko (GNU) 2012 }

Unit Edit;

(*******************************************
 *                                         *
 *   EDIT.PAS                              *
 *                                         *
 *   Edit.                                 *
 *   This is graphical unit for NBPrg23    *
 *   subsystem. NBPrg23 - (graphical)part  *
 *   of NBPrg40 (NBPrg27-33,34,35,36,37,   *
 *   38,39). Edit is not editor, just      *
 *   interface for w_text(graphical text   *
 *   editor).                              *
 *                                         *
 *******************************************)

Interface

Uses Graph, Crt;

Procedure DoEdit;

Implementation

Uses w_text, NBPRG_I;


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 DoEdit;
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);

  ch1:=' ';

  {CALL WORK_SYS TEXT EDITOR}
  text_run;

  { RELOADING NBPRG27 (-NBPRG30,31,32, ... ,40) } 
  { GRAPHICAL INTERFACE }
  NBPRG_I_reload_interf;

  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,'Edit');

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

End.