home *** CD-ROM | disk | FTP | other *** search
-
- tvDMX has had several important changes from version 1.x.
- This document covers many of them, although not all.
-
-
- UNIT tvDMXBUF RECORD NUMBERS
- ============================
-
- Function SeekRec() in unit tvDMXBUF uses a LONGINT value as a parameter,
- where it had previously used an INTEGER. This still needs more work
- before it can be extended to long databases. Look for updates in a
- future version.
-
-
- REAL NUMBER FORMATS
- ===================
-
- tvDMX real numbers were originally displayed with trailing zeroes, eg:
- 'rrr,rrr.rrr' could format 10000 as ' 10,000.000'. This has been changed
- to make trailing zeroes optional, eg: ' 10,000 '.
-
- You can still display trailing zeroes using the 'Z' template codes, eg:
- 'rrr,rrr.zzz'.
-
-
- FORM-STYLE DATA ENTRY
- =====================
-
- The new TDmxForm object uses templates to create forms, just like its
- parent, but it gets the templates in a list of strings, like this:
-
- Templates :=
- NewSItem ('~ Data Entry Form~',
- NewSItem ('',
- NewSItem ('~Name: ~\ SSSSSSSSSSSSSSSSSS\~Age:~\WWW',
- NewSItem ('~Balance:~\($rrr,rrr.zz)\~ APR:~\WZW%',
- NewSItem ('',
- NewSItem ('~ SSN:~\###-##-####',
- nil))))));
-
- And this is the record type defined by those templates:
-
- TRecordType = RECORD
- Name : string [18];
- Age : word;
- Balance : real;
- APR : word;
- SSN : string [9];
- end;
-
- Tilde symbols ('~') mark off string-literals; backslashes ('\') are
- separate fields; and everything else defines the field. Naturally, you
- need to be careful about marking these properly, but it's fairly easy.
-
- If your view had scrollbars, you can create huge scrollable data windows.
- See README.DOC for more information.
-
- CREATING EXTRA-LONG TEMPLATES
- =============================
-
- Before now, record templates wider than 255 characters could only
- be created by overriding the InitStruct() method. This effort was
- always complicated, and usually application-specific.
-
- Two new functions (in unit DMXGIZMA) provide two easy ways to extend
- a template string:
-
-
- function InitAppendFields (ATemplate : pstring) : DmxIDstr;
- (*type DmxIDstr is a seven-character string)
-
- Example:
-
- const
- TT : string [xx] = ' ssssssssssssss|wwww|wwww|';
- T2 : string [xx] = ' wwww|wwww|sssssssssssssss|[x]|';
-
- begin
- TT := TT + InitAppendFields (@T2);
- ...
-
- InitAppendFields() creates a seven-byte string that contains a
- control code which indicates to tvDMX that a pointer to another
- template string is following. Very long template codes can be
- created by concatenating these strings, eg:
-
- TT := TT + InitAppendFields (@T2) + InitAppendFields (@T3);
-
- Extremely long template codes can be created by nesting.
-
- T3 := T3 + InitAppendFields (@T4);
- T2 := T2 + InitAppendFields (@T3);
- TT := TT + InitAppendFields (@T2);
-
- TT can then be used as your tvDMX template string.
-
-
- function InitTSItemFields (ATemplates : PSItem) : DmxIDstr;
-
- This function initializes a chain of TSItem templates, which will be
- interpreted as one long tvDMX template chain.
-
- Example:
-
- TT := ' sssssssssssssss|WW,WWW |'
- + InitTSItemFields (NewSItem (' sssssssssss`sssssssss|',
- NewSItem ('($rrr,rrr.rr)|',
- NewSItem (' CCCCC|WWW,WWW |',
- nil))))
-
- TT can then be used as your tvDMX template string. It is much easier
- to use function InitTSItemFields() than InitAppendFields().
-
- ENUMERATED FIELDS
- =================
-
- Enum fields are byte fields that restricts the user to several
- choices. They use the NewSItem() function from the OBJECTS unit
- to construct the list which is passed to tvDMX in the form of a
- DmxIDstr (which is a seven character string) that is created by
- this function (in unit DMXGIZMA):
-
- function InitEnumField (ShowZ : boolean; AccMode,Default : byte;
- AItems : PSItem) : DmxIDstr;
-
- ShowZ specifies whether ShowZeroes should be set for this field;
- AccMode is the field's access mode (accSkip, accReadOnly, etc.);
- Default is the field's default value (normally zero).
-
- Example:
-
- TT := T1 + InitEnumField (FALSE, 0,0,
- NewSItem (' Zero',
- NewSItem (' One',
- NewSItem (' Two',
- NewSItem (' Three',
- NewSItem (' Four',
- nil)))))
- );
-
- Important: The TSItem list is disposed by tvDMX when the view is
- disposed. You should call InitEnumField() to create the list each
- time that the view is created. And please note that enum fields
- are still in the experimental stage.
-
- The following procedures and functions (in DMXGIZMA) were written to
- work with TSItem lists:
-
-
- procedure DisposeSItems (AItems : PSItem);
- dispose a chain of TSItems
-
- function ReadSItems (var S : TStream) : PSItem;
- reads strings from a pick list
-
- procedure WriteSItems (var S : TStream; Items : PSItem);
- writes strings to a pick list
-
- function MaxItemStrLen (AItems : PSItem) : integer;
- returns the maximum length of the strings in a pick list
-
- function SItemsLen (S : PSItem) : integer;
- returns the cumulative length of the strings in a pick list
-
-
- ABBREVIATING STRING FIELDS
- ==========================
-
- String fields can now be abbreviated with the '`' character (the
- backward apostrophe) so that long strings don't take up so much
- space on the screen. While editing, users can scroll within the
- field. Example:
-
- ' ssssssssssssssssssss`ssssssssssssssssssss| ww,www '
-
- This will be displayed like this:
-
- ' International Busin>| 1,024 '
-
- (The '>' would actually be an arrow character.)
-
-
-
-
- tvDMX AUXILIARY VIEWS
- =====================
-
- tvDMX versions prior to 2.0 came with only one view to display the
- titles or field names above the scroller. Since version 2.0 made
- wide data editors easier to produce, the same needed to be done for
- TDmxLabel objects --so several derivations were created.
-
- ┌─────────────┐
- │ TObject │
- └──────┬──────┘
- ┌──────┴──────┐
- │ TView │
- └──────┬──────┘
- │
- ┌─────────┴─────────┐
- │ TDmxLink │
- │ (unit tvDMX) │
- └─────────┬─────────┘
- │
- ┌────────────┴────────────┐
- ┌─────────┴─────────┐ ┌─────────┴─────────┐
- │ TDmxExpLabels │ │ TDmxRecInd │
- │ (unit tvDMX) │ │ (unit tvDMX) │
- └─────────┬─────────┘ └─────────┬─────────┘
- │ ┌─────────┴─────────┐
- │ │ TDmxExpRecInd │
- │ │ (unit tvDMXBUF) │
- │ └───────────────────┘
- ┌────────────┴──────────┬───────────────────────┐
- │ │ │
- ┌─────────┴─────────┐ ┌─────────┴─────────┐ ┌─────────┴─────────┐
- │ TDmxLabels │ │ TDmxFLabels │ │ TDmxMLabels │
- │ (unit tvDMX) │ │ (unit tvDMX) │ │ (unit tvDMX) │
- └───────────────────┘ └───────────────────┘ └───────────────────┘
-
-
- Note: Examples of New(P) would be used as functions, not as procedures.
-
- TDmxExtLabels = OBJECT (TDmxLink)
- Descendant of TDmxLink, and parent to TDmxLabels that displays the
- labels line on the first line of the window. Its constructor is given
- a pointer to the text of the labels line.
-
- Example: New (PDmxExtLabels, Init (sizeof(LblArr), @LblArr, Bounds));
-
-
- TDmxLabels = OBJECT (TDmxExtLabels)
- Default tvDMX labels object. Its constructor is given a pointer to
- the string for the field labels.
-
- Example: New (PDmxLabels, Init (@LabelStr, Bounds));
-
-
- TDmxFLabels = OBJECT (TDmxExtLabels)
- Alternative to TDmxLabels with a constructor that is given the actual
- string itself for the text of the labels line.
-
- Example: New (PDmxFLabels, Init (' Name ID SSN ', Bounds));
-
-
- TDmxMLabels = OBJECT (TDmxExtLabels)
- Can be used to display DMX labels that must be longer than 255
- characters, but is more convenient to set up than TDmxExtLabels.
-
- Example: New (PDmxMLabels, Init (
- NewSItem ('Name ',
- NewSItem ('ID SSN ',
- NewSItem ('Balance ',
- nil))),
- Bounds));
-
- A working example of TDmxMLabels is demonstrated in WIDESHOP.PAS.
-
-
-
-