'
'Class description:
'
!short:Mask class structure:
Class Mask:
~~~~~~~~~~~
The View class is appended with user defined window content. The window inside
can be filed with screen generator output.

Common use:
~~~~~~~~~~~
The best way is to study the demo program Demo3.prg.

Source code of the class is in C_Mask.prg.

!seealso: c_view.ngo:View c_dbrows.ngo:DBrowse c_task.ngo:Task c_report.ngo:Report c_finfo.ngo:FInfo c_menu.ngo:Menu c_dbf.ngo:Dbf c_color.ngo:Color ob_class.ngo:"Class hierarchy"

!short:~~~~~~~~~~~~~~~~~~~~~
!short:create class Mask from View
!short:  export:
!short:  var Initialized  //false
^BMask:Initialized^N: read-only: logical
  Used for speed optimizing in displaying a object of the class in method
  Mask:VPaint().

!short:  var SayData      //{{Row,Col,Text},...}
^BMask:SayData^N: public: array
  Array of the pieces of the text, it should be displayed to the window
  on the Row,Col position. It is filled mainly by the method
  Mask:AddSay(...).

!short:  var GetData      //{{Row,Col},...}
^BMask:GetData^N: public: array
  Array of positions of the Get objects for the object of class Mask.
  It is filled mainly by methods Mask:AddField(...), Mask:AddMemo(...)
  or Mask:AddBlock(...).

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

!short:  method CreateObj=MaskCreateObj  //o:CreateObj() --> new_object_of_this_class
^BMask:CreateObj^N:public: return new_self_of_this_class
   Returns the new object of this class.

!short:  method Copy=MaskCopy            //o:Copy() --> self
^BMask:Copy()^N:public: return copy_of_self
  Returns the copy of the common object of this class.

!short:  method AddSay=MaskAddSay        //o:AddSay(R,C,Text) --> true
^BMask:AddSay(R,C,Text)^N: public: return true
  This window is appended by next Text for view in the R,C position relative
  to window beginning (i.e. to the left upper window corner).

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~~
  ^UR^N: numeric: no default
   Position of edited data (row) relative to left upper window corner.

  ^UC^N: numeric: no default
   Position of edited data (column) relative to left upper window corner.

  ^UText^N: character: no default
   The displayed text.

!short:  method AddBlock=MaskAddBlock    //o:AddBlock(R,C,cShortNm,cVarNm,bBlock,bDoGet,cPict,bWhen,bValid) --> true
^BMask:AddBlock(R,C,ShortName,VarName,Block,DoGet,Pict,When,Valid)^N:
  public: return true
  This object is appended with the next column (variable) defined by
  the code block.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UR^N: numeric: no default
   Position of edited data (row) relative to left upper window corner.

  ^UC^N: numeric: no default
   Position of edited data (column) relative to left upper window corner.

  ^UShortName^N: character: default is ""
   The column name used in Browse mode.

  ^UVarName^N: character: default je ShortName
   Edited variable name, or the database field name saved as information
   to clipper Get object, created in this method and saved to DoGet array.
   The clipper get object should know the edited variable name.

  ^UBlock^N: code_block:  no default
   The code block of get/set type, can be created by clipper functions
   FieldBlock(), FieldWBlock(), MemVarBlock() or by your own piece
   of code.

  ^UDoGet^N: code_block: default is the virtual_method_Browse:DoGet()
   The code block which by the help of the Get object edits the variable
   (database field), of the respective table column. For properly use,
   you can study source code of method DBrowse:DoGet in file c_DBrowse.prg,
   and static function SetUsers in c_Menu.prg.

  ^UPicture^N: character: default is ""
   The display mask for the column display mode.

  ^UWhen^N: code_block: default is {||true}
   The code block evaluated before the begining of the editation of this
   column, if returns false no editation is processed. It enables to produce
   the computed table columns or the read-only columns.

  ^UValid^N: code_block: default is {||true}
   The code block evaluated after finishing of the current column editation
   for its validation. (if returns true the new value is valid)

!short:  method AddMemo=MaskAddMemo      //o:AddMemo(R,C,cShortNm,cField,bWhen,bValid,nRowSize,nColSize) --> true
^BMask:AddMemo(R,C,cShortName,cField,bWhen,bValid,nRowSize,nColSize)^N:
  public: return true
  This object is appended with the next column, defined as memo field.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UR^N: numeric: no default
   Position of edited data (row) relative to left upper window corner.

  ^UC^N: numeric: no default
   Position of edited data (column) relative to left upper window corner.

  ^UShortName^N: character: default is ""
   The column name used in Browse mode.

  ^UcField^N: character: no default
   The full name of the memo field (field->name), if there is no prefix
   it is accepted from instvar variable View:Alias.

  ^UWhen^N: code_block: default is {||true}
   The code block evaluated before the begining of the editation of this
   column, if returns false no editation is processed. It enables to produce
   the computed table columns or the read-only columns.

  ^UValid^N: code_block: default is {||true}
   The code block evaluated after finishing of the current column editation
   for its validation. (if returns true the new value is valid)

  ^UnRowSize^N: numeric: default is MaxRow()/3
   MemoEdit window height in number of rows.

  ^UnColSize^N: numeric: default is MaxCol()/2
   MemoEdit window width in number of columns.

!short:  method AddField=MaskAddField    //o:AddField(R,C,cShortNm,cField,cPicture,bWhen,bValid) --> true
^BMask:AddField(R,C,ShortName,Field,Picture,When,Valid)^N:
  public: return true
  The object is appended with the column defined as normal database field.

  Parameter description:
  ~~~~~~~~~~~~~~~~~~~~~~
  ^UR^N: numeric: no default
   Position of edited data (row) relative to left upper window corner.

  ^UC^N: numeric: no default
   Position of edited data (column) relative to left upper window corner.

  ^UShortName^N: character: default is ""
   The column name used in Browse mode.

  ^UcField^N: character: no default
   The full name of the memo field (field->name), if there is no prefix
   it is accepted from instvar variable View:Alias.

  ^UcPicture^N: character: default is ""
   The display mask for the column display mode.

  ^UWhen^N: code_block: default is {||true}
   The code block evaluated before the begining of the editation of this
   column, if returns false no editation is processed. It enables to produce
   the computed table columns or the read-only columns.

  ^UValid^N: code_block: default is {||true}
   The code block evaluated after finishing of the current column editation
   for its validation. (if returns true the new value is valid)

  ^UnRowSize^N: numeric: default is MaxRow()/3
   MemoEdit window height in number of rows.

  ^UnColSize^N: numeric: default is MaxCol()/2
   MemoEdit window width in number of columns.

!short:  method PostInit=MaskPostInit    //o:PostInit() --> true
^BMask:PostInit()^N: public: return true
  Modifies the implicitly herited initalisation data, because the Mask window
  can't change its size.

!short:  method MaskPaint=MaskMaskPaint  //o:MaskPaint() --> true
^BMask:MaskPaint()^N: public: return true
  The window content is painted if the variable Mask:FormActive==true.
  Otherwise is the parent method VPaint() used.

!short:  endclass

