home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / screened.def < prev    next >
Text File  |  1997-11-03  |  7KB  |  138 lines

  1. DEFINITION MODULE ScreenEditor;
  2.  
  3.         (********************************************************)
  4.         (*                                                      *)
  5.         (*              Screen data capture                     *)
  6.         (*                                                      *)
  7.         (*  Programmer:         P. Moylan                       *)
  8.         (*  Last edited:        3 November 1997                 *)
  9.         (*  Status:                                             *)
  10.         (*      Basic features working, but see faults in       *)
  11.         (*      module RowEditor.                               *)
  12.         (*                                                      *)
  13.         (********************************************************)
  14.  
  15. FROM SYSTEM IMPORT
  16.     (* type *)  BYTE, ADDRESS;
  17.  
  18. FROM Windows IMPORT
  19.     (* type *)  Window;
  20.  
  21. FROM ListEditor IMPORT
  22.     (* type *)  List, ListFormat;
  23.  
  24. FROM Menus IMPORT
  25.     (* type *)  Menu;
  26.  
  27. FROM FieldEditor IMPORT
  28.     (* type *)  FieldType;
  29.  
  30. (************************************************************************)
  31.  
  32. TYPE
  33.     Structure;          (* is private *)
  34.  
  35. (************************************************************************)
  36. (*                 INTRODUCING A NEW FIELD TO THE SYSTEM                *)
  37. (************************************************************************)
  38.  
  39. PROCEDURE ByteField (VAR (*IN*) variable: BYTE;
  40.                         screenrow, screencolumn, width: CARDINAL): Structure;
  41.  
  42.     (* Creates a one-field structure for editing a BYTE variable.       *)
  43.  
  44. PROCEDURE CardinalField (VAR (*IN*) variable: CARDINAL;
  45.                         screenrow, screencolumn, width: CARDINAL): Structure;
  46.  
  47.     (* Creates a one-field structure for editing the given CARDINAL     *)
  48.     (* variable.                                                        *)
  49.  
  50. PROCEDURE RealField (VAR (*IN*) variable: REAL;
  51.                         screenrow, screencolumn, width: CARDINAL): Structure;
  52.  
  53.     (* Creates a one-field structure for editing a REAL variable.       *)
  54.  
  55. PROCEDURE StringField (VAR (*IN*) variable: ARRAY OF CHAR;
  56.                         screenrow, screencolumn, width: CARDINAL): Structure;
  57.  
  58.     (* Creates a one-field structure for editing a character string.    *)
  59.  
  60. (************************************************************************)
  61. (*                         FOR ADVANCED USERS                           *)
  62. (************************************************************************)
  63.  
  64. PROCEDURE MenuField (VAR (*IN*) variable: CARDINAL;
  65.                 screenrow, screencolumn, lines, width: CARDINAL;
  66.                 M: Menu): Structure;
  67.  
  68.     (* Creates a one-field structure for editing a cardinal variable    *)
  69.     (* via menu selection.  The caller must ensure that M has already   *)
  70.     (* been defined by a call to Menus.                                 *)
  71.  
  72. PROCEDURE ListField (VAR (*IN*) variable: List;
  73.                                 screenrow, screencolumn: CARDINAL;
  74.                                         f: ListFormat): Structure;
  75.  
  76.     (* Creates a structure for editing a linear list.  The caller must  *)
  77.     (* ensure that f has been defined by a call to module ListEditor.   *)
  78.     (* This procedure does not add any features beyond what ListEditor  *)
  79.     (* provides, but by returning a result of type Structure it allows  *)
  80.     (* lists and scalars to be mixed in the same editing window.        *)
  81.  
  82. PROCEDURE CreateField (VariableAddress: ADDRESS;  ftype: FieldType;
  83.                         screenrow, screencolumn, width: CARDINAL): Structure;
  84.  
  85.     (* Creates a new structure consisting of a single field.  Before    *)
  86.     (* calling this procedure, the caller should make sure, by calling  *)
  87.     (* FieldEditor.DefineFieldType if necessary, that ftype is a type   *)
  88.     (* already known to module FieldEditor.                             *)
  89.  
  90. (************************************************************************)
  91. (*              CREATING MULTI-FIELD EDITING STRUCTURES                 *)
  92. (************************************************************************)
  93.  
  94. PROCEDURE Combine (VAR (*INOUT*) A: Structure;  B: Structure);
  95.  
  96.     (* Strips all of the fields from B and adds them to the existing    *)
  97.     (* fields of A.  Note that B is destroyed in the process.           *)
  98.  
  99. PROCEDURE MakeArray (VAR (*INOUT*) S: Structure;  count: CARDINAL;
  100.                 addroffset, rowoffset, coloffset: CARDINAL);
  101.  
  102.     (* Creates a structure for an array of count elements, where on     *)
  103.     (* entry S is a structure already created for the first array       *)
  104.     (* element.  Parameter addroffset is the difference between         *)
  105.     (* adjacent array elements.  The remaining two parameters give the  *)
  106.     (* offset on the screen between the starting positions of adjacent  *)
  107.     (* array elements.                                                  *)
  108.  
  109. (************************************************************************)
  110. (*                              EDITING                                 *)
  111. (************************************************************************)
  112.  
  113. PROCEDURE ScreenEdit (w: Window;  S: Structure;  VAR (*OUT*) abort: BOOLEAN);
  114.  
  115.     (* Displays structure S in window w, and allows the keyboard user   *)
  116.     (* to edit the components of S.  It is assumed that w is already    *)
  117.     (* open and that S has already been fully defined.  Returns         *)
  118.     (* abort=TRUE if user aborted the editing with the Esc key.         *)
  119.  
  120. (************************************************************************)
  121. (*                        CLOSING A STRUCTURE                           *)
  122. (************************************************************************)
  123.  
  124. PROCEDURE DeleteStructure (VAR (*INOUT*) S: Structure);
  125.  
  126.     (* Deletes structure S.  Calling this procedure is optional, but is *)
  127.     (* recommended in order to reclaim memory space when S is no longer *)
  128.     (* needed (and it makes it clearer in the program listing that S    *)
  129.     (* will no longer be used).  Note that this procedure does NOT      *)
  130.     (* delete the variables to which S gives access; if, for example,   *)
  131.     (* you were working with lists and menus then those lists and menus *)
  132.     (* continue to exist.  DeleteStructure simply deletes the overhead  *)
  133.     (* data which was originally allocated by this module for its own   *)
  134.     (* purposes.                                                        *)
  135.  
  136. END ScreenEditor.
  137. 
  138.