'
'Class description:
'
!short:Box class structure:
Class Box:
~~~~~~~~~~~
This class is a predcessor of all classes, which are runing in a window
on the screen. It enables simple blank window to be painted with label
and shadow. The scrolling of text in the window is enabled. Method
Box:GoodInit(...) takes care of inteligent placement of the window on
the screen, nearest possible to the cursor but no required text is
covered.

Common use:
~~~~~~~~~~~~~~~~~
LOCAL OBJECT Box OF Box
Box:Init(...)           //or Box:GoodInit(...)
Box:Paint()
Box:Done()

Source text is C_Box.prg

!short:~~~~~~~~~~~~~~~~~~~~~
!short:create class Box from Loc
!seealso: c_loc.ngo:Loc c_win.ngo:Win c_window.ngo:Window c_color.ngo:Color ob_class.ngo:"Class hierarchy"

!short:  export:
!short:  var Name     //""
^BBox:Name^N: private: string
  It stores window name string.

!short:  var RowSize  //MaxRow()-7
^BBox:RowSize^N: public: numeric
 Number of lines of the window (window height).

!short:  var ColSize  //MaxCol()-9
^BBox:ColSize^N: public: numeric
  Number of rows of the window (window width).

!short:  var Color    //m->Color:Edit
^BBox:Color^N: public: character
  Colors used for painting of the window. Look at chapter Comands  Constants
  for detail description and to Public variable m->Color.

!short:  var Shadow   //true
^BBox:Shadow^N: public: logical
  If true window is shadowed if false it isn't.

!short:  method New=BoxNew           //o:New() --> self
^BBox:New()^N: public: return self
  Object is filled with default initialising values.

!short:  method Init=BoxInit         //o:Init(Name,R,C,Rs,Cs,Clr,Shd) --> true/false
^BBox:Init(Name,R,C,Rs,Cs,Clr,Shadow)^N: public: return true
  Instvar object variables are initialised by recieved parameters.

  Parameter description
  ~~~~~~~~~~~~~~~~~~~~~
  ^UName^N: string: default is "", i.e. no title.
   Window title.

  ^UR^N: numeric: default is 3.
   Upper window border.

  ^UC^N: numeric: default is 4.
   Left window border.

  ^URs^N: numeric: default is MaxRow()-7.
   Window height in number of lines which fit the window.

  ^UCs^N: numeric: default is MaxCol()-9.
   Window width in number of rows which fit the window.

  ^UClr^N: character: default is m->Color:Edit.
   Window colors.

  ^UShadow^N: logical: default is true for color monitor, false for monochrom.
   If true the shadow wil be painted.

!short:  method GoodInit=BoxGoodInit //o:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shd) --> true/false
^BBox:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shadow)^N: public: return true
  Method Box:GoodInit(...)takes care of inteligent placement of the window
  on the screen, nearest possible to the cursor but no required text
  is covered. Certainly the window is placed so to be whole visible.

  Parameter description
  ~~~~~~~~~~~~~~~~~~~~~

  ^UName^N: string: default is "", i.e. no title.
   Window title.

  ^UR^N: numeric: default is Row().
   Text position (row) on the screen which shouldn't be covered
   by window, but the window should be as near as possible.

  ^UC^N: numeric: default is Col().
   Text position (column) on the screen which shouldn't be covered
   by window, but the window should be as near as possible.

  ^URs^N: numeric: default is MaxRow()-7.
   Required height of the window in fitted lines.

  ^UCs^N: numeric: default is MaxCol()-9.
   Required width of the window in fitted columns.

  ^UCurSize^N: numeric: default 1.
   Width of the text which shouldn't be covered by window,
   but the window should be as near as possible.

  ^UClr^N: character: default is m->Color:Edit.
   Window colors.

  ^UShadow^N: logical: default is true for color monitor, false for monochrom.
   If true the shadow will be painted.

!short:  method Paint=BoxPaint       //o:Paint(IsTop,lDouble) --> true
^BBox:Paint(IsTop,lDouble)^N: public: return true
  Window is painted on the screen. Warning! the background is not saved.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~
  ^UIsTop^N: logical: default is true.
   If true, the window title is painted in nTitle color (look at Commands
     Constants); if false the title is painted in inside window character
    colors (nNormal).

  ^UlDouble^N: logical: default is IsTop.
   If true window frame is double lined, if false it's single lined.

!short:  method SayTitle=BoxSayTitle //o:SayTitle(IsTop) --> true
^BBox:SayTitle(IsTop)^N: public: return true
  Window title is painted.

  ^UIsTop^N: logical: default is true.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~
  ^UIsTop^N: logical: default is true.
   If true, the window title is painted in nTitle color (look at
   Commands  Constants); if false, the title is painted in inside window
   character colors (nNormal).

!short:  method Scroll=BoxScroll     //o:Scroll(dRow) --> true
^BBox:Scroll(dRow)^N: public: return true
  Text scrolling of given number (dRow) of lines.

!short:  method Done=BoxDone         //o:Done() --> true
^BBox:Done()^N: public: return true
  Returns true, does nothing.

!short:  endclass

