home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Pascal / TVDMX.ZIP / CHANGES.DOC next >
Encoding:
Text File  |  1993-04-02  |  8.9 KB  |  261 lines

  1.  
  2.     tvDMX has had several important changes from version 1.x.
  3.     This document covers many of them, although not all.
  4.  
  5.  
  6. UNIT tvDMXBUF RECORD NUMBERS
  7. ============================
  8.  
  9.   Function SeekRec() in unit tvDMXBUF uses a LONGINT value as a parameter,
  10.   where it had previously used an INTEGER.  This still needs more work
  11.   before it can be extended to long databases.  Look for updates in a
  12.   future version.
  13.  
  14.  
  15. REAL NUMBER FORMATS
  16. ===================
  17.  
  18.   tvDMX real numbers were originally displayed with trailing zeroes, eg:
  19.   'rrr,rrr.rrr' could format 10000 as ' 10,000.000'.  This has been changed
  20.   to make trailing zeroes optional, eg: ' 10,000    '.
  21.  
  22.   You can still display trailing zeroes using the 'Z' template codes, eg:
  23.   'rrr,rrr.zzz'.
  24.  
  25.  
  26. FORM-STYLE DATA ENTRY
  27. =====================
  28.  
  29.   The new TDmxForm object uses templates to create forms, just like its
  30.   parent, but it gets the templates in a list of strings, like this:
  31.  
  32.     Templates :=
  33.     NewSItem ('~    Data Entry Form~',
  34.     NewSItem ('',
  35.     NewSItem ('~Name: ~\ SSSSSSSSSSSSSSSSSS\~Age:~\WWW',
  36.     NewSItem ('~Balance:~\($rrr,rrr.zz)\~    APR:~\WZW%',
  37.     NewSItem ('',
  38.     NewSItem ('~     SSN:~\###-##-####',
  39.         nil))))));
  40.  
  41.   And this is the record type defined by those templates:
  42.  
  43.     TRecordType      =  RECORD
  44.     Name    :  string [18];
  45.     Age    :  word;
  46.     Balance    :  real;
  47.     APR    :  word;
  48.     SSN    :  string [9];
  49.     end;
  50.  
  51.   Tilde symbols ('~') mark off string-literals;  backslashes ('\') are
  52.   separate fields;  and everything else defines the field.  Naturally, you
  53.   need to be careful about marking these properly, but it's fairly easy.
  54.  
  55.   If your view had scrollbars, you can create huge scrollable data windows.
  56.   See README.DOC for more information.
  57.  
  58. CREATING EXTRA-LONG TEMPLATES
  59. =============================
  60.  
  61.     Before now, record templates wider than 255 characters could only
  62.     be created by overriding the InitStruct() method.  This effort was
  63.     always complicated, and usually application-specific.
  64.  
  65.     Two new functions (in unit DMXGIZMA) provide two easy ways to extend
  66.     a template string:
  67.  
  68.  
  69.   function InitAppendFields (ATemplate : pstring) : DmxIDstr;
  70.     (*type DmxIDstr is a seven-character string)
  71.  
  72.     Example:
  73.  
  74.       const
  75.       TT : string [xx] = ' ssssssssssssss|wwww|wwww|';
  76.       T2 : string [xx] = ' wwww|wwww|sssssssssssssss|[x]|';
  77.  
  78.       begin
  79.     TT := TT + InitAppendFields (@T2);
  80.     ...
  81.  
  82.     InitAppendFields() creates a seven-byte string that contains a
  83.     control code which indicates to tvDMX that a pointer to another
  84.     template string is following.  Very long template codes can be
  85.     created by concatenating these strings, eg:
  86.  
  87.     TT := TT + InitAppendFields (@T2) + InitAppendFields (@T3);
  88.  
  89.     Extremely long template codes can be created by nesting.
  90.  
  91.     T3 := T3 + InitAppendFields (@T4);
  92.     T2 := T2 + InitAppendFields (@T3);
  93.     TT := TT + InitAppendFields (@T2);
  94.  
  95.     TT can then be used as your tvDMX template string.
  96.  
  97.  
  98.   function InitTSItemFields (ATemplates : PSItem) : DmxIDstr;
  99.  
  100.     This function initializes a chain of TSItem templates, which will be
  101.     interpreted as one long tvDMX template chain.
  102.  
  103.     Example:
  104.  
  105.     TT := ' sssssssssssssss|WW,WWW |'
  106.         + InitTSItemFields (NewSItem (' sssssssssss`sssssssss|',
  107.                     NewSItem ('($rrr,rrr.rr)|',
  108.                     NewSItem (' CCCCC|WWW,WWW |',
  109.                     nil))))
  110.  
  111.     TT can then be used as your tvDMX template string.  It is much easier
  112.     to use function InitTSItemFields() than InitAppendFields().
  113.  
  114. ENUMERATED FIELDS
  115. =================
  116.  
  117.     Enum fields are byte fields that restricts the user to several
  118.     choices.  They use the NewSItem() function from the OBJECTS unit
  119.     to construct the list which is passed to tvDMX in the form of a
  120.     DmxIDstr (which is a seven character string) that is created by
  121.     this function (in unit DMXGIZMA):
  122.  
  123.       function  InitEnumField (ShowZ : boolean; AccMode,Default : byte;
  124.                    AItems : PSItem) : DmxIDstr;
  125.  
  126.     ShowZ specifies whether ShowZeroes should be set for this field;
  127.     AccMode is the field's access mode (accSkip, accReadOnly, etc.);
  128.     Default is the field's default value (normally zero).
  129.  
  130.     Example:
  131.  
  132.     TT := T1 + InitEnumField (FALSE, 0,0,
  133.             NewSItem (' Zero',
  134.             NewSItem (' One',
  135.             NewSItem (' Two',
  136.             NewSItem (' Three',
  137.             NewSItem (' Four',
  138.                  nil)))))
  139.                 );
  140.  
  141.     Important:  The TSItem list is disposed by tvDMX when the view is
  142.     disposed.  You should call InitEnumField() to create the list each
  143.     time that the view is created.  And please note that enum fields
  144.     are still in the experimental stage.
  145.  
  146.     The following procedures and functions (in DMXGIZMA) were written to
  147.     work with TSItem lists:
  148.  
  149.  
  150.       procedure DisposeSItems (AItems : PSItem);
  151.       dispose a chain of TSItems
  152.  
  153.       function  ReadSItems (var S : TStream) : PSItem;
  154.       reads strings from a pick list
  155.  
  156.       procedure WriteSItems (var S : TStream; Items : PSItem);
  157.       writes strings to a pick list
  158.  
  159.       function  MaxItemStrLen (AItems : PSItem) : integer;
  160.       returns the maximum length of the strings in a pick list
  161.  
  162.       function  SItemsLen (S : PSItem) : integer;
  163.       returns the cumulative length of the strings in a pick list
  164.  
  165.  
  166. ABBREVIATING STRING FIELDS
  167. ==========================
  168.  
  169.     String fields can now be abbreviated with the '`' character (the
  170.     backward apostrophe) so that long strings don't take up so much
  171.     space on the screen.  While editing, users can scroll within the
  172.     field.  Example:
  173.  
  174.       ' ssssssssssssssssssss`ssssssssssssssssssss| ww,www '
  175.  
  176.     This will be displayed like this:
  177.  
  178.       ' International Busin>|  1,024 '
  179.  
  180.     (The '>' would actually be an arrow character.)
  181.  
  182.  
  183.  
  184.  
  185. tvDMX AUXILIARY VIEWS
  186. =====================
  187.  
  188.     tvDMX versions prior to 2.0 came with only one view to display the
  189.     titles or field names above the scroller.  Since version 2.0 made
  190.     wide data editors easier to produce, the same needed to be done for
  191.     TDmxLabel objects --so several derivations were created.
  192.  
  193.                                ┌─────────────┐
  194.                                │   TObject   │
  195.                                └──────┬──────┘
  196.                                ┌──────┴──────┐
  197.                                │    TView    │
  198.                                └──────┬──────┘
  199.                                       │
  200.                             ┌─────────┴─────────┐
  201.                             │     TDmxLink      │
  202.                             │   (unit tvDMX)    │
  203.                             └─────────┬─────────┘
  204.                                       │
  205.                          ┌────────────┴────────────┐
  206.                ┌─────────┴─────────┐     ┌─────────┴─────────┐
  207.                │   TDmxExpLabels   │     │    TDmxRecInd     │
  208.                │   (unit tvDMX)    │     │   (unit tvDMX)    │
  209.                └─────────┬─────────┘     └─────────┬─────────┘
  210.                          │               ┌─────────┴─────────┐
  211.                          │               │   TDmxExpRecInd   │
  212.                          │               │  (unit tvDMXBUF)  │
  213.                          │               └───────────────────┘
  214.             ┌────────────┴──────────┬───────────────────────┐
  215.             │                       │                       │
  216.   ┌─────────┴─────────┐   ┌─────────┴─────────┐   ┌─────────┴─────────┐
  217.   │    TDmxLabels     │   │    TDmxFLabels    │   │    TDmxMLabels    │
  218.   │   (unit tvDMX)    │   │   (unit tvDMX)    │   │   (unit tvDMX)    │
  219.   └───────────────────┘   └───────────────────┘   └───────────────────┘
  220.  
  221.  
  222.     Note:  Examples of New(P) would be used as functions, not as procedures.
  223.  
  224.   TDmxExtLabels    =  OBJECT (TDmxLink)
  225.     Descendant of TDmxLink, and parent to TDmxLabels that displays the
  226.     labels line on the first line of the window.  Its constructor is given
  227.     a pointer to the text of the labels line.
  228.  
  229.     Example:  New (PDmxExtLabels, Init (sizeof(LblArr), @LblArr, Bounds));
  230.  
  231.  
  232.   TDmxLabels    =  OBJECT (TDmxExtLabels)
  233.     Default tvDMX labels object.  Its constructor is given a pointer to
  234.     the string for the field labels.
  235.  
  236.     Example:  New (PDmxLabels, Init (@LabelStr, Bounds));
  237.  
  238.  
  239.   TDmxFLabels    =  OBJECT (TDmxExtLabels)
  240.     Alternative to TDmxLabels with a constructor that is given the actual
  241.     string itself for the text of the labels line.  
  242.  
  243.     Example:  New (PDmxFLabels, Init (' Name    ID  SSN  ', Bounds));
  244.  
  245.  
  246.   TDmxMLabels    =  OBJECT (TDmxExtLabels)
  247.     Can be used to display DMX labels that must be longer than 255
  248.     characters, but is more convenient to set up than TDmxExtLabels.
  249.  
  250.     Example:  New (PDmxMLabels, Init (
  251.                          NewSItem ('Name            ',
  252.                          NewSItem ('ID      SSN          ',
  253.                          NewSItem ('Balance       ',
  254.                          nil))),
  255.                        Bounds));
  256.  
  257.     A working example of TDmxMLabels is demonstrated in WIDESHOP.PAS.
  258.  
  259.  
  260.  
  261.