home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / ROWEDITO.DEF < prev    next >
Text File  |  1991-05-16  |  4KB  |  112 lines

  1. DEFINITION MODULE RowEditor;
  2.  
  3.     (********************************************************)
  4.     (*                            *)
  5.     (*      Screen data capture, for a single row        *)
  6.     (*                            *)
  7.     (*  Programmer:        P. Moylan            *)
  8.     (*  Last edited:    6 October 1990            *)
  9.     (*  Status:                        *)
  10.     (*    Basic features working.  Known faults are:    *)
  11.     (*      1.    (fixed)                    *)
  12.     (*      2.    The criterion for deciding in which    *)
  13.     (*        field to start editing could be better.    *)
  14.     (*                            *)
  15.     (********************************************************)
  16.  
  17. FROM SYSTEM IMPORT
  18.     (* type *)    ADDRESS;
  19.  
  20. FROM Windows IMPORT
  21.     (* type *)    Window;
  22.  
  23. FROM FieldEditor IMPORT
  24.     (* type *)    FieldType;
  25.  
  26. FROM ListEditor IMPORT
  27.     (* type *)    List, ListFormat;
  28.  
  29. FROM Menus IMPORT
  30.     (* type *)    Menu;
  31.  
  32. (************************************************************************)
  33.  
  34. TYPE
  35.     StructureRow;        (* is private *)
  36.  
  37. (************************************************************************)
  38. (*                  SCREEN OUTPUT                *)
  39. (************************************************************************)
  40.  
  41. PROCEDURE WriteRow (w: Window;  R: StructureRow;  line: CARDINAL);
  42.  
  43.     (* Writes R on row "line" of window w.    *)
  44.  
  45. PROCEDURE StartColumn (R: StructureRow): CARDINAL;
  46.  
  47.     (* Returns the screen column of the first field in R.    *)
  48.  
  49. PROCEDURE DumpRow (w: Window;  R: StructureRow);
  50.  
  51.     (* For debugging: writes a representation of R to the screen.    *)
  52.  
  53. (************************************************************************)
  54. (*        CREATING MULTI-FIELD EDITING STRUCTURES            *)
  55. (************************************************************************)
  56.  
  57. PROCEDURE NewRow (VariableAddress: ADDRESS;  ftype: FieldType;
  58.             screencolumn, width: CARDINAL): StructureRow;
  59.  
  60.     (* Creates a new row containing a single field.    *)
  61.  
  62. PROCEDURE NewMenu (VAR (*IN*) variable: CARDINAL;  M: Menu;
  63.             screencolumn, rows, columns: CARDINAL): StructureRow;
  64.  
  65.     (* Creates a new row containing a menu field.  The screencolumn    *)
  66.     (* field specifies the leftmost column within the screen window,    *)
  67.     (* the rows and columns fields give the size on the screen.        *)
  68.  
  69. PROCEDURE NewList (VAR (*IN*) variable: List;  f: ListFormat;
  70.                 screencolumn: CARDINAL): StructureRow;
  71.  
  72.     (* Creates a new row containing a list field.    *)
  73.  
  74. PROCEDURE CombineRows (VAR (*INOUT*) A: StructureRow;  B: StructureRow);
  75.  
  76.     (* Strips all of the fields from B and adds them to the existing    *)
  77.     (* fields of A.  Note that B is destroyed in the process.        *)
  78.  
  79. (************************************************************************)
  80. (*    The next few procedures are to support array operations.    *)
  81. (************************************************************************)
  82.  
  83. PROCEDURE CopyOfRow (R: StructureRow): StructureRow;
  84.  
  85.     (* Returns a duplicate copy of R.  Note that the variables to be    *)
  86.     (* edited are not duplicated - only the editor structure which    *)
  87.     (* keeps track of what is being edited.                *)
  88.  
  89. PROCEDURE AdjustRow (R: StructureRow;  addroffset, columnoffset: CARDINAL);
  90.  
  91.     (* Modifies every entry in R by adding addroffset to the variable    *)
  92.     (* address and columnoffset to the screen column.            *)
  93.  
  94. PROCEDURE DeleteRow (R: StructureRow);
  95.  
  96.     (* Deallocates the storage which was used in setting up row R.    *)
  97.     (* Note that this has nothing to do with the space used by        *)
  98.     (* variables to which R gives access; we delete only the overhead    *)
  99.     (* space which was originally allocated by this module.        *)
  100.  
  101. (************************************************************************)
  102. (*                EDITING                    *)
  103. (************************************************************************)
  104.  
  105. PROCEDURE EditRow (w: Window;  R: StructureRow;  screenrow: CARDINAL);
  106.  
  107.     (* Displays structure R in window w, and allows the keyboard user    *)
  108.     (* to edit the components of R.  It is assumed that w is already    *)
  109.     (* open and that R has already been fully defined.            *)
  110.  
  111. END RowEditor.
  112.