'
'Class description:
'
!short:Window class structure:
Class Window:
~~~~~~~~~~~~~~
Window definition with the basic chracteristics; they are switchable from
front to the background, they can be minimized, maximized moved on the
screen they are sizeable and can be arranged to tile or to cascade.

Common use:
~~~~~~~~~~~
It is primitive function of class Task, the sole simple use can be following:
LOCAL OBJECT Wi OF Window
Wi:Init(....)  //or Wi:GoodInit(...)
Wi:Paint()
...            //Wi:Drag(), Wi:Maximize(), Wi:Minimize(),...
Wi:Done()

Source code is in C_Window.prg

!seealso: c_box.ngo:Box c_win.ngo:Win c_frame.ngo:Frame c_task.ngo:Task c_browse.ngo:Browse c_color.ngo:Color ob_class.ngo:"Class hierarchy"

!short:~~~~~~~~~~~~~~~~~~~~~~~~
!short:create class Window from Box
!short:  export:
!short:  var ID       //0
^BWindow:ID^N: read-only: numeric
  Order number of the window in stack of windows ^UWList^N.

!short:  var WRow     //3
^BWindow:WRow^N: private: numeric
  Coordinate ^URow^N is stored if it is minimized or  maximized.

!short:  var WCol     //4
^BWindow:WCol^N: private: numeric
  Coordinate ^UCol^N is stored if it is minimized or  maximized.

!short:  var WRowSize //MaxRow()-7
^BWindow:WRowSize^N: private: numeric
  Coordinate ^URowSize^N is stored if it is minimized or  maximized.

!short:  var WColSize //MaxCol()-9
^BWindow:WColSize^N: private: numeric
  Coordinate ^UColSize^N is stored if it is minimized or  maximized.

!short:  var IsMax    //false
^BWindow:IsMax^N: read-only: logical
  True if window is maximized (to the whole screen)

!short:  var IsMin    //false
^BWindow:IsMin^N: read-only: logical
  True if window is minimized (iconised to the bottom screen border)

!short:  var MaxRows  //MaxRow()-3
^BWindow:MaxRows^N: public: numeric
  Maximal window height as number of rows to fit in the window.

!short:  var MaxCols  //MaxCol()-1
^BWindow:MaxCols^N: public: numeric
  Maximal window width as number of columns to fit in the window.

!short:  var MinRows  //1
^BWindow:MinRows^N: public: numeric
  Minimal window height as number of rows to fit in the window.

!short:  var MinCols  //5
^BWindow:MinCols^N: public: numeric
  Minimal window width as number of columns to fit in the window.

!short:  var UpFlag   //false
^BWindow:UpFlag^N: public: logical
  If true, the window isn't switchable i.e. must stay active.

!short:  var Screen   //""
^BWindow:Screen^N: private: character
  Stores the screen content when painting the window. It is used only for
  speeding up the window switching, to avoid the calling of process
  Window:RePaint() after each window manipulation.

!short:  var UpScreen //""
^BWindow:UpScreen^N: private: character
  As in the Window:Screen, but it stores the window content when it is not
  active in active window colors.

!short:  var BkScreen //""
^BWindow:BkScreen^N: private: character
  As in the Window:Screen, but it stores the window content when it is not
  active in not-active window colors.

!short:  var RCInfo   //""
^BWindow:RCInfo^N: private: character
  Indicates the window size change, if true it must instead of instvar
  variables Window:UpScreen and Window:BkScreen be used the virtual method
  Window:VPaint().

!short:  var InfoMsg  //""
^BWindow:InfoMsg^N: public: character
  Text string with aditional information to be displayed on the bottom
  window border after each redisplaying of the window.

!short:  var Frame    //(object of Frame)
^BWindow:Frame^N: private: objekt
  Class Frame object for moving of the window or for resizing.

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

!short:  method Init=WindowInit          //o:Init(Name,R,C,Rs,Cs,Clr,Shd) --> true
^BWindow:Init(Name,R,C,Rs,Cs,Clr,Shadow)^N: public: return true
  New window is created, added on the top of the stack of windows,
  but not painted! Same parameters as in Box:Init(...).

!short:  method GoodInit=WindowGoodInit  //o:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shd) --> true
^BWindow:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shadow)^N: public: return true
  New window is created, added on the top of the stack of windows,
  but not painted! Same parameters as in Box:GoodInit(...), which is
  the parent class and is used for window positioning.

!short:  method VPaint=WindowVPaint      //o:VPaint() --> true
^BWindow:VPaint()^N: public: return true
  It is dummy method of class Window. In derived classes is used for
  repainting of window content. The derived classes should define their
  own virtual method VPaint().

!short:  method SaveIn=WindowSaveIn      //o:SaveIn() --> true
^BWindow:SaveIn()^N: public: return true
  This method stores to private variables Window:UpScreen and
  Window:BkScreen the window content. It is due of optimising the speed to
  avoid of runing the method Window:RePaint().

!short:  method DoInfo=WindowDoInfo      //o:DoInfo() --> true
^BWindow:DoInfo()^N: public: return true
  The content of instvar variable Window:InfoMsg is written to bottom
  window border. This method can be  activated separately but is used
  to be activated from the nethod Window:Paint().

!short:  method Paint=WindowPaint        //o:Paint(IsTop) --> true
^BWindow:Paint(IsTop)^N: public: return true
  The window is painted to the screen.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~
  ^UIsTop^N: logical: default is true if the window is on the top of the stack.
   If true window is painted in active colors, otherwise in m->Color:Desk
   (i.e. as not-active).

!short:  method Top=WindowTop            //o:Top(lRePaint) --> true
^BWindow:Top(lRePaint)^N: public: return true
  The window is swapped to the top of the stack and is repainted.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UlRePaint^N: logical: default is true
   If lRePaint is true, the screen is cleaned and all windows from the stack
   are repainted, otherwise are only repainted the windows from the stack.

!short:  method RePaint=WindowRePaint    //o:RePaint(lClearDesk) --> true
^BWindow:RePaint(lClearDesk)^N: public: return true
  All windows from the stack (static ^UWList^N) are repainted.

  Parameter description:
  ~~~~~~~~~~~~~~~~~
  ^UlClearDesk^N: logical: default is true
   If lClearDesk is true
   If is lClearDesk true, the screen is cleaned and all windows from the
   stack are repainted, otherwise are only repainted the windows from the
   stack.

!short:  method Drag=WindowDrag          //o:Drag(lCanSize) --> true
^BWindow:Drag(lCanSize)^N: public: return true
  It enables the interactive window moving and resizing. With use of the
  cursor arrows is the window moved, with the cursor arrows on the numeric
  keypad with NUM-LOCK on is the window resized.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UlCanSize^N: logical: default is not Window:Minimize.
   If the lCanSize is true, the window can be resized, otherwise it can be
   only moved. (minimized window can be only moved)

!short:  method Maximize=WindowMaximize  //o:Maximize() --> true
^BWindow:Maximize()^N: public: return true
  The window is repainted to the whole screen exept of the top menu line
  and bottom dialog line.

!short:  method Minimize=WindowMinimize  //o:Minimize(lShow) --> true
^BWindow:Minimize(lShow)^N: public: return true
  The window is minimized (it is written only it's title to the bottom
  screen border).

!short:  method Restore=WindowRestore    //o:Restore() --> true
^BWindow:Restore()^N: public: return true
  The window size is restored with screen repainting, it can be used after
  the method Window:Maximize() or after the method Window:Minimize().

!short:  method Done=WindowDone          //o:Done(lRePaint) --> true
^BWindow:Done(lRePaint)^N: public: return true
  The window is erased from the stack of the windows.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UlRePaint^N: logical: default is false
   If lRepaint is true, after the erasing of the window from the window
   stack, all remaining windows are repainted.

!short:  endclass

