home *** CD-ROM | disk | FTP | other *** search
- /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
- | Copyright (c) 1987-1991, Innovative Data Concepts, Inc.
- | All Rights Reserved.
- |
- | This Library is part of IDC's TesSeRact Development Tools product
- | line. For information about other IDC products, call 1-215-443-9705.
- *-V--------------------------------------------------------------------*
- | $Header: tcxlent.h 552.5 15 Apr 1991 15:20:10 $
- |
- | $Log: tcxlent.h $
- *-D--------------------------------------------------------------------*
- | <TCXLent.h> : Definitions and prototypes for the TCXL Data-entry
- | system (User level).
- *-N-----------------------[ Notes and Caveats ]------------------------*
- | 1) All Data-entry system functions set TcxlErr and return negative
- | ERR_??? values on errors. Check return values before proceeding
- | with processing a form!
- | 2) The Ebld and Fbld Form-build and Field-build data-objects are used
- | to specify a complete entry form and its component fields to be
- | built by EntBuild(). A call to EntBuild() with the requisite set of
- | objects replaces the sequence of calls normally needed to define an
- | entry form and it fields, as given in 4), which normally consists
- | of: EntDef(), EntKey(), EntOpt(), EntDis(), EntWrp(), EntFld(),
- | FldKey(), and FldFun(). This is a first step toward pre-compiled,
- | tokenized forms. Notes about function arguments give the equivalent
- | Ebld or Fbld element access macros in [].
- | 3) The <nf> field-count argument to EntDef() [EbldCnt] is the number
- | of fields in the current form. Its value is used to allocate space
- | and to verify the definition of the form.
- | 4) A complete form definition and display cycle consists of the
- | following sequence of calls:
- | a) Wopen() to define and open the form window.
- | a) EntDef() to define the form.
- | b) EntKey() to assign a user getkey() function and/or terminating
- | key buffer (optional).
- | c) EntSep() to assign a user word-separator string (optional).
- | d) EntOpt() to enable global insert-mode and/or [Up]/[Down] arrow
- | keys (optional).
- | e) EntDis() to define an input-disabled field attribute (optional).
- | f) EntWrp() to cause wrapping from last to first field instead of
- | the default exit from form on [Enter] in last field (optional).
- | g) EntFld() <nf> times to define all fields in form.
- | i) FldKey() to assign a user hot-key to the field (optional).
- | ii) FldFun() to assign user "before"\"after" functions to the
- | field (optional).
- | h) EntSav() to preserve the form for reuse (optional).
- | i) EntGet() to display, process and dispose of (unless EntSav()
- | has been called) the form.
- | j) EntFree() to dispose of the form (if EntSav() was called).
- | k) Wclose() to close the form window.
- | 5) To simply display a form without input processing or child forms,
- | use the following alternate sequence of calls:
- | a) Wopen() to define and open the form window.
- | b) EntBuild() or EntDef() and EntFld(), etc. to define the form
- | and its fields.
- | c) EntDsp() to format and display the form.
- | d) Perform any user processing while form is displayed, such as
- | "browsing" through a database to select a record to update.
- | e) EntSav() to preserve the form for reuse (optional).
- | f) EntGet() to update the record and dispose the form -OR-
- | EntFree() to dispose of the form.
- | g) EntFree() to dispose of the form (if EntSav() was called).
- | h) Wclose() to close the form window.
- | 6) Multiple records with identical layouts may be "browsed", once
- | EntBuild() or the EntDef(), EntFld() sequence and EntDsp() have
- | been initially called by updating the contents of the FdfStr(),
- | etc., elements of the Fdf Field-definition objects and again
- | calling EntDsp() for each new record. However, either EntFree()
- | or EntGet() MUST be called to dispose of the form. If EntSav() is
- | called BEFORE calling EntGet() for an entry form, the form will
- | be preserved (not disposed of) and can then be serially reused for
- | multiple records. EntFree() MUST then be called to dispose of the
- | form after EntGet() returns.
- | 7) The <fm> feature-mask argument to EntFld() [FbldMsk] is an ORed
- | combination of the FLD_NUL ... FLD_DIS constants. These special
- | cases apply:
- | a) If FLD_DIS (input disabled) is set, at least ONE field must be
- | enabled. Obviously both FLD_DIS and FLD_REQ cannot be set for a
- | field. FLD_REQ takes precedence and will override FLD_DIS as
- | an initial setting. If a disabled field is made required by
- | calling FldReq(), it will also be enabled.
- | b) If FLD_REQ (input reqired) is set, the user will not be able to
- | exit the form until the field has contents, either inserted by
- | the caller or entered by the user and validated. If a required
- | field is disabled by calling FldDis(), it will also no longer be
- | a required field (see above).
- | c) If FLD_SUB (nested child form) is set, a user "before" function
- | for the child form MUST be defined via a call to FldFun()
- | following the EntFld() call for the parent field. Up to ENT_MAX
- | (currently 8) levels of child forms can be nested.
- | 8) To define, display and process a child form, define a user "before"
- | function for the parent field with FldFun(), that, at a minimum,
- | performs the following sequence of calls before returning to
- | EntGet() to resume processing of the parent field and form:
- | a) EntPush() to preserve the parent form. ALWAYS check for
- | error-returns from EntPush()!!!
- | b) Wopen() to define and open the child's window.
- | c) EntBuild() or EntDef() and EntFld(), etc., to define the child
- | form and its component fields and make it current.
- | d) EntGet() to display, process and dispose of the child form -OR-
- | EntDsp() to display and EntFree() to dispose of the child form
- | without processing.
- | e) Wclose() to close the child's window.
- | f) EntPop() to restore the parent form and make it current.
- | After EntPop() returns, the parent field can be filled in or other
- | appropriate action taken before returning to EntGet(). If the
- | parent field is changed, FldChg() MUST be called to signal the
- | change to EntGet().
- | 9) If a user "before", "valid" or "after" field function modifies the
- | contents of the current field in ANY way, the FldInp() or FldPnd()
- | macro MUST be called to signal the change. FldInp() signals valid
- | input and FldPnd() signals input pending validation.
- | 10) The global EctlCur pointer and EntCur() are valid and the data
- | objects exist ONLY when a current entry-form is defined (i.e.,
- | after EntDef() is called and before EntGet() or EntFree() returns).
- | Between EntPsh() and EntDef() calls for a child form, NO current
- | form is defined and EctlCur is NULL!
- | 11) EntGet() disposes of the current form and frees all of its data
- | objects before returning (unless EntSav() has been called) so there
- | is NO current entry-form defined and EctlCur is NULL!
- | 12) A user getkey() and last-key buffer, as assigned by EntKey(), can
- | be used to filter input keystrokes. The getkey() is called for all
- | input and returns a K_C_Ent (Ctl[Enter]) to signal an exit from the
- | form. EntGet() will put the exiting keycode seen (K_Ctl_Ent) in
- | the assigned last-key buffer ONLY if the buffer contains 0u. To
- | place another keycode in the last-key buffer for EntGet()'s caller,
- | do the following:
- | a) Write a user getkey() function that calls KeyGetc() to get input
- | and test for user-defined exit keycodes. When a user-defined
- | exit key is detected, call EntTrm() to put it in the last-key
- | buffer and the return K_C_Ent to signal an exit from the form.
- | b) Declare a KeyT as a last-key buffer and initialize it to 0u
- | before each call to EntGet().
- | c) Assign your getkey() function and last-key buffer when the form
- | is defined by EntBuild() or EntDef().
- | 13) The field-movement bits in FdfFlg(f) are ONLY valid within a user
- | "before", "valid" or "after" function called by EntGet(). NO bits
- | are set if a field is selected by the mouse in other than MOU_KEYS
- | mode.
- | 14) The EdfXxx access macros defined below REQUIRE a local pointer to
- | the current entry-form definition object declared and initialized
- | as: EdfP e = EctlCur;
- | 15) To change the number of entry-form nesting levels, EntDef.C, which
- | contains the declaration of the global _EntCtl object, MUST be
- | re-compiled after modifying ENT_MAX here.
- | 16) The fields and defines labeled internal or transient are not for
- | access or use by user code!
- | 17) The data-entry system relies heavily on the internal TCXL format
- | string field-input/output subsystem.
- | 18) The FMT_??? constants are defined by <TCXLfmt.h>.
- *======================================================================*/
- #ifndef _TCXLent_
- # define _TCXLent_ 1 /* only once! */
- # ifndef _TCXLfmt_
- # include <TCXLfmt.h> /* Format-string definitions */
- # endif
- # ifndef _TCXLwin_
- # include <TCXLwin.h> /* Window definitions */
- # endif
- #define ENT_MAX 8 /*- Maximum child form nesting level -----*/
-
- /*- EbldOpt option flag bits -------------*/
- #define ENT_WRP 0x01 /* Wrap last to first field on [Enter] */
- #define ENT_SAV 0x02 /* Preserve current form (no dispose) */
- #define ENT_DIR 0x04 /* [Up]/[Down] keys ON */
- #define ENT_GLB 0x08 /* Global insert mode ON */
- /*- Field feature-mask bits --------------*/
- #define FLD_NUL 0x0000 /* No special features defined */
- #define FLD_LWR 0x0001 /* Convert input to lowercase */
- #define FLD_MIX 0x0002 /* Convert input to mixed case */
- #define FLD_UPR 0x0004 /* Convert input to uppercase */
- #define FLD_PAS 0x0008 /* Password - masked display */
- #define FLD_DEC 0x0010 /* Decimal field */
- #define FLD_NUM FLD_DEC /* ... compatibility alias for 5.51 */
- #define FLD_CUR 0x0020 /* Currency field */
- #define FLD_NWR 0x0100 /* No auto-wrap to next field */
- #define FLD_LJS 0x0200 /* Left justify result */
- #define FLD_RJS 0x0400 /* Right justify result */
- #define FLD_TRM 0x0800 /* Trim end spaces from result */
- #define FLD_SUB 0x1000 /* Nested child form */
- #define FLD_REQ 0x2000 /* Input required */
- #define FLD_DIS 0x4000 /* Input disabled */
- /*- Field edit-modes ---------------------*/
- #define FLD_INI 0x00 /* Initial - clear field for input */
- #define FLD_CHG 0x01 /* Change - display field for edit */
- #define FLD_CND 0x02 /* Conditional-update */
- /*- Internal EdfCtl form-control flags ---*/
- #define EDF_WRP 0x01 /* Wrap last to first field on [Enter] */
- #define EDF_SAV 0x02 /* Preserve current form (no dispose) */
- #define EDF_HIL 0x08 /* Highlight current field */
- #define EDF_DSP 0x10 /* Form has beew displayed once */
- #define EDF_DIR 0x20 /* [Up]/[Down] keys ON */
- #define EDF_GLB 0x40 /* Global insert mode ON */
- #define EDF_KEY 0x80 /* Field hot-keys assigned */
- /*- Internal FdfCtl field-control bits ---*/
- #define FDF_NWR 0x01 /* No auto-wrap to next field */
- #define FDF_LJS 0x02 /* Left justify result */
- #define FDF_RJS 0x04 /* Right justify result */
- #define FDF_TRM 0x08 /* Trim end spaces from result */
- #define FDF_SUB 0x10 /* Nested child form */
- #define FDF_REQ 0x20 /* Input required */
- #define FDF_DIS 0x40 /* Input disabled */
- #define FDF_OPT 0x0F /*- FdfOpt valid bit mask ----------------*/
- /*- Transient FdfFlg flags ---------------*/
- #define FDF_MOV 0x70 /* Movement mask */
- #define FDF_BEG 0x10 /* To first field */
- #define FDF_END 0x20 /* To last field */
- #define FDF_PRV 0x30 /* To previous field */
- #define FDF_NXT 0x40 /* To next field */
- #define FDF_UP 0x50 /* Upward [if EdfDir ON] */
- #define FDF_DWN 0x60 /* Downward [if EdfDir ON] */
- #define FDF_MOD 0x03 /* Display-mode bits */
- #define FDF_DSP 0x04 /* Re-display field */
-
- /*------------------[ Data objects and access macros ]------------------*/
-
- TYP struct _Ebld EbldT, *EbldP, **EbldI;
- TYP struct _Ectl EctlT, *EctlP; /* object, pointer types */
- TYP struct _Edf EdfT, *EdfP;
- TYP struct _Fbld FbldT, *FbldP, **FbldI;
- TYP struct _Fdf FdfT, *FdfP;
-
- struct _Ebld /*-[ Entry form-build object ]------------*/
- { FbldP efld; /* 00|00 : EbldFld : Field-build list */
- IntT ecnt; /* 02|04 : EbldCnt : Field-count */
- KfvCP eget; /* 04|06 : EbldGet : User getkey() func */
- KeyP etrm; /* 06|0A : EbldTrm : User last-key buffer */
- WrdT eusr; /* 08|0E : EbldUsr : User form-descriptor */
- BytT eopt; /* 0A|10 : EbldOpt : Form option flags */
- AtrT epat; /* 0B|11 : EbldPat : Prompt attribute */
- AtrT efat; /* 0C|12 : EbldFat : Field attribute */
- AtrT ehat; /* 0D|13 : EbldHat : Highlight attribute */
- AtrT edat; /* 0E|14 : EbldDat : Disabled attribute */
- BytT efut; /* 0F|15 : EbldFut : Reserved for future */
- }; /* 10|16 ]--------------------------------*/
- #define EbldFld(e) ((e)->efld) /* Field-build list */
- #define EbldCnt(e) ((e)->ecnt) /* Field-count */
- #define EbldGet(e) ((e)->eget) /* User getkey() */
- #define EbldTrm(e) ((e)->etrm) /* User last-key buffer */
- #define EbldUsr(e) ((e)->eusr) /* User descriptor */
- #define EbldOpt(e) ((e)->eopt) /* Option flags */
- #define EbldGlb(e) (0 != ((e)->eopt & ENT_GLB)) /* Global-insert */
- #define EbldDir(e) (0 != ((e)->eopt & ENT_DIR)) /* [Up]/[Down] */
- #define EbldSav(e) (0 != ((e)->eopt & ENT_SAV)) /* Preserve form */
- #define EbldWrp(e) (0 != ((e)->eopt & ENT_WRP)) /* Wrap last field */
- #define EbldPat(e) ((e)->epat) /* Prompt attribute */
- #define EbldFat(e) ((e)->efat) /* Field attribute */
- #define EbldHat(e) ((e)->ehat) /* Highlight attribute */
- #define EbldDat(e) ((e)->edat) /* Disabled attribute */
-
- struct _Fbld /*-[ Entry field-build object ]-----------*/
- { ChrP fpmt; /* 00|00 : FbldPmt : Prompt string */
- BytT fpmr; /* 02|04 : FbldPmr : Prompt window row */
- BytT fpmc; /* 03|05 : FbldPmc : Prompt window col */
- ChrP fstr; /* 04|06 : FbldStr : Field input string */
- BytT frow; /* 06|0A : FbldRow : Field window row */
- BytT fcol; /* 07|0B : FbldCol : Field window col */
- ChrP ffmt; /* 08|0C : FbldFmt : Format string */
- VfvCP fbef; /* 0A|10 : FbldBef : "Before" function */
- IfcpCP fval; /* 0C|14 : FbldVal : "Valid" function */
- VfvCP faft; /* 0E|18 : FbldAft : "After" function */
- KeyT fkey; /* 10|1C : FbldKey : Hot-key */
- TagT ftag; /* 12|1E : FbldTag : Field TagId */
- TagT fhlp; /* 14|20 : FbldHlp : Help TagId */
- WrdT fmsk; /* 16|22 : FbldMsk : Feature mask */
- WrdT fusr; /* 18|24 : FbldUsr : User descriptor */
- BytT fmod; /* 1A|26 : FbldMod : Input mode */
- BytT ffut; /* 1B|27 : FbldFut : Reserved for future */
- }; /* 1C|28 ]--------------------------------*/
- #define FbldPmt(f) ((f)->fpmt) /* Prompt string */
- #define FbldPmr(f) ((f)->fpmr) /* Prompt window row */
- #define FbldPmc(f) ((f)->fpmc) /* Prompt window col */
- #define FbldStr(f) ((f)->fstr) /* Field input string */
- #define FbldRow(f) ((f)->frow) /* Field window row */
- #define FbldCol(f) ((f)->fcol) /* Field window col */
- #define FbldFmt(f) ((f)->ffmt) /* Field format string */
- #define FbldVal(f) ((f)->fval) /* "Valid" function */
- #define FbldBef(f) ((f)->fbef) /* "Before" function */
- #define FbldAft(f) ((f)->faft) /* "After" function */
- #define FbldKey(f) ((f)->fkey) /* Field hotkey */
- #define FbldTag(f) ((f)->ftag) /* Field TagId */
- #define FbldHlp(f) ((f)->fhlp) /* Help TagId */
- #define FbldMsk(f) ((f)->fmsk) /* Feature mask */
- #define FbldUsr(f) ((f)->fusr) /* User descriptor */
- #define FbldMod(f) ((f)->fmod) /* Input mode */
-
- struct _Ectl /*- Entry-control object -----------------*/
- { EdfP ecur; /* 00|00 : EctlCur : Current entry-form */
- EdfP estk[ENT_MAX]; /* 02|04 : EctlStk : Entry-form stack */
- FmtP efmt[ENT_MAX]; /* 12|24 : EctlFmt : Format-control stack */
- IntT elvl; /* 22|44 : EctlLvl : Entry-form level */
- TagT etag; /* 24|46 : EctlTag : Current field TagId */
- }; /* 26|48 }--------------------------------*/
-
- GBL EctlT CDC _EntCtl; /*- Global entry-control object ----------*/
- #define EctlCur (_EntCtl.ecur) /* Current entry-form */
- #define EctlStk(i) (_EntCtl.estk[i]) /* Entry-form stack */
- #define EctlFmt(i) (_EntCtl.efmt[i]) /* Format-control stack */
- #define EctlLvl (_EntCtl.elvl) /* Entry-form level */
- #define EctlTag (_EntCtl.etag) /* Current field TagId */
-
- struct _Edf /*-[ Entry-form definition object ]-------*/
- { FdfP etop; /* 00|00 : EdfTop : Field-list head */
- FdfP ebot; /* 02|04 : EdfBot : Field-list tail */
- FdfP ecur; /* 04|08 : EdfCur : Current field */
- KfvCP eget; /* 06|0C : EdfGet : User getkey() func */
- KeyP etrm; /* 08|10 : EdfTrm : User last-key buffer */
- ChrP ebfr; /* 0A|14 : EdfBfr : Input buffer-pool */
- VposP epos; /* 0C|18 : EdfPos : Field-position list */
- BytP elen; /* 0E|1C : EdfLen : Field-length list */
- IntT ecnt; /* 10|20 : EdfCnt : Field-count */
- VposT eorg; /* 12|22 : EdfOrg : Window image-origin */
- BytT ectl; /* 14|24 : EdfCtl : Control flags */
- AtrT efat; /* 15|25 : EdfFat : Field attribute */
- AtrT ehat; /* 16|26 : EdfTat : Highlight attribute */
- BytT edat; /* 17|27 : EdfDat : Disabled attribute */
- WrdT eusr; /* 18|28 : EdfUsr : User descriptor */
- }; /* 1A|2A ]--------------------------------*/
- #define EdfTop ((e)->etop) /* Field-list head */
- #define EdfFld(i) ((e->etop + (i))) /* Field-list element */
- #define EdfBot ((e)->ebot) /* Field-list tail */
- #define EdfCur ((e)->ecur) /* Current field */
- #define EdfGet ((e)->eget) /* User getkey() */
- #define EdfTrm ((e)->etrm) /* User last-key buffer */
- #define EdfBfr ((e)->ebfr) /* Buffer-pool */
- #define EdfPos ((e)->epos) /* Field-position list */
- #define EdfLen ((e)->elen) /* Field-length list */
- #define EdfCnt ((e)->ecnt) /* Field-count */
- #define EdfOrg ((e)->eorg) /* Window image origin */
- #define EdfOrgW (VposW(EdfOrg)) /* Word */
- #define EdfCol (VposC(EdfOrg)) /* Col */
- #define EdfRow (VposR(EdfOrg)) /* Row */
- #define EdfCtl ((e)->ectl) /* Control flags */
- #define EdfWrp (0 != (EdfCtl & EDF_WRP)) /* Last-field wrap */
- #define EdfSav (0 != (EdfCtl & EDF_SAV)) /* Preserve form */
- #define EdfHil (0 != (EdfCtl & EDF_HIL)) /* Highlight current */
- #define EdfDsp (0 != (EdfCtl & EDF_DSP)) /* Form displayed */
- #define EdfDir (0 != (EdfCtl & EDF_DIR)) /* [Up]/[Down] keys */
- #define EdfGlb (0 != (EdfCtl & EDF_GLB)) /* Global insert */
- #define EdfKey (0 != (EdfCtl & EDF_KEY)) /* Hot-keys defined */
- #define EdfFat ((e)->efat) /* Field attribute */
- #define EdfHat ((e)->ehat) /* Highlight attribute */
- #define EdfDat ((e)->edat) /* Disabled attribute */
- #define EdfUsr ((e)->eusr) /* User descriptor */
-
- struct _Fdf /*-[ Entry-field-definition object ]------*/
- { ChrP fstr; /* 00|00 : FdfStr : Input string */
- ChrP fbfr; /* 02|04 : FdfBfr : Buffer string */
- ChrP ffmt; /* 04|08 : FdfFmt : Format string */
- IfcpCP fval; /* 06|0C : FdfVal : "Valid" function */
- VfvCP fbef; /* 08|10 : FdfBef : "Before" function */
- VfvCP faft; /* 0A|14 : FdfAft : "After" function */
- KeyT fkey; /* 0C|18 : FdfKey : Hot-key */
- TagT ftag; /* 0E|1A : FdfTag : Field TagId */
- TagT fhlp; /* 10|1C : FdfHlp : Help TagId */
- VposT fpos; /* 12|1E : FdfPos : Window position */
- BytT fopt; /* 14|20 : FdfOpt : Format options */
- BytT fuse; /* 15|21 : FdfUse : Format usage */
- BytT fctl; /* 16|22 : FdfCtl : Field-control flags */
- BytT fflg; /* 17|23 : FdfFlg : Transient flags */
- BytT flen; /* 18|24 : FdfLen : Field length */
- BytT fext; /* 19|25 : FdfExt : Input extent */
- BytT fdot; /* 1A|26 : FdfDot : Decimal offset */
- BytT ffut; /* 1B|27 : FdfFut : Reserved for future */
- WrdT fusr; /* 1C|28 : FdfUsr : User descriptor */
- }; /* 1E|2A ]--------------------------------*/
- #define FdfStr(f) ((f)->fstr) /* Input string */
- #define FdfBfr(f) ((f)->fbfr) /* Buffer pointer */
- #define FdfFmt(f) ((f)->ffmt) /* Format string */
- #define FdfVal(f) ((f)->fval) /* "Valid" function */
- #define FdfBef(f) ((f)->fbef) /* "Before" function */
- #define FdfAft(f) ((f)->faft) /* "After" function */
- #define FdfKey(f) ((f)->fkey) /* Hotkey */
- #define FdfTag(f) ((f)->ftag) /* Field TagId */
- #define FdfHlp(f) ((f)->fhlp) /* Help TagId */
- #define FdfPos(f) ((f)->fpos) /* Window position */
- #define FdfPosW(f) (VposW(FdfPos(f))) /* Word */
- #define FdfCol(f) (VposC(FdfPos(f))) /* Col */
- #define FdfRow(f) (VposR(FdfPos(f))) /* Row */
- #define FdfOpt(f) ((f)->fopt) /* Format option bits */
- #define FdfUse(f) ((f)->fuse) /* Format usage bits */
- #define FdfDec(f) (0 != (FdfUse(f) & FMT_DEC)) /* Decimal field */
- #define FdfCur(f) (0 != (FdfUse(f) & FMT_CUR)) /* Currency field */
- #define FdfInp(f) (0 != (FdfUse(f) & FMT_INP)) /* Input to field */
- #define FdfChk(f) (0 != (FdfUse(f) & FMT_CHK)) /* Validation pending*/
- #define FdfPnd(f) (0 != (FdfUse(f) & FMT_PND)) /* Input pending */
- #define FdfCtl(f) ((f)->fctl) /* Field-control flags */
- #define FdfNwr(f) (0 != (FdfCtl(f) & FDF_NWR)) /* No-wrap */
- #define FdfLjs(f) (0 != (FdfCtl(f) & FDF_LJS)) /* Left-justify */
- #define FdfRjs(f) (0 != (FdfCtl(f) & FDF_RJS)) /* Right-justify */
- #define FdfTrm(f) (0 != (FdfCtl(f) & FDF_TRM)) /* Trim blanks */
- #define FdfSub(f) (0 != (FdfCtl(f) & FDF_SUB)) /* Child form */
- #define FdfReq(f) (0 != (FdfCtl(f) & FDF_REQ)) /* Input required */
- #define FdfDis(f) (0 != (FdfCtl(f) & FDF_DIS)) /* Input disabled */
- #define FdfFlg(f) ((f)->fflg) /* Transient flags */
- #define FdfMov(f) (FdfFlg(f) & FDF_MOV) /* Movement flags */
- #define FdfBeg(f) (FDF_BEG == FdfMov(f)) /* To first */
- #define FdfEnd(f) (FDF_END == FdfMov(f)) /* To last */
- #define FdfPrv(f) (FDF_PRV == FdfMov(f)) /* To previous */
- #define FdfNxt(f) (FDF_NXT == FdfMov(f)) /* To next */
- #define FdfUp(f) (FDF_UP == FdfMov(f)) /* Upwards */
- #define FdfDwn(f) (FDF_DWN == FdfMov(f)) /* Downwards */
- #define FdfMod(f) (FdfFlg(f) & FMT_MOD) /* Display mode */
- #define FdfIni(f) (FMT_INI == FdfMod(f)) /* Initial */
- #define FdfChg(f) (FMT_CHG == FdfMod(f)) /* Change */
- #define FdfCnd(f) (FMT_CND == FdfMod(f)) /* Conditional */
- #define FdfDsp(f) (0 != (FdfFlg(f) & FMT_DSP)) /* Re-display */
- #define FdfLen(f) ((f)->flen) /* Field length */
- #define FdfExt(f) ((f)->fext) /* Input extent */
- #define FdfDot(f) ((f)->fdot) /* Decimal offset */
- #define FdfUsr(f) ((f)->fusr) /* User descriptor */
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* no mangling, please */
- extern "C" {
- #endif
- /*- Build complete entry form ------------*/
- IntT CTYP EntBuild(EbldP e); /* Build current entry form */
- /*- Entry-form/field definition ----------*/
- IntT CTYP EntDef(AtrT fa, AtrT ha, /* Define current entry form */
- IntT nf);
- IntT CTYP EntDis(AtrT da); /* Assign disabled attribute */
- IntT CTYP EntKey(KfvCP gk, /* Assign user getkey() function */
- KeyP tk); /* and last-key buffer */
- IntT CTYP EntOpt(FlgT gi, FlgT ud); /* Assign user entry options */
- VOID EntSav(NOARG); /* Preserve current form */
- VOID EntSep(ChrP ws); /* Assign word-separator string */
- VOID EntWrp(NOARG); /* Wrap last-to-first field */
- IntT CTYP EntFld(BytT wr, BytT wc, /* Define field in current form */
- ChrP ps, ChrP fs, WrdT fm, TagT id,
- BytT md, IfcpCP vf, TagT ht);
- IntT CTYP FldFun(VfvCP bf, /* Assign "before" and "after" */
- VfvCP af); /* user functions for field */
- IntT CTYP FldKey(KeyT hk); /* Assign field hot-key */
- /*- Entry-form processing ----------------*/
- EdfP EntCur(NOARG); /* Return current form pointer */
- IntT CTYP EntDsp(NOARG); /* Display current form/fields */
- VOID CTYP EntFree(NOARG); /* Dispose of current form */
- TagT CTYP EntGet(TagT id); /* Process current form */
- IntT CTYP EntPop(NOARG); /* Restore previous form */
- IntT CTYP EntPush(NOARG); /* Preserve current form */
- VOID EntTrm(KeyT kc); /* Put keycode in last-key buffer*/
- /*- Entry-field processing ---------------*/
- VOID CTYP FldChg(NOARG); /* Signal changed parent field */
- FdfP FldCur(NOARG); /* Return current field pointer */
- VOID CTYP FldDis(FdfP fp, FlgT df); /* Disable/enable field input */
- VOID FldInp(NOARG); /* Signal valid field input */
- FdfP CTYP FldLoc(TagT id); /* Find entry-field by tag <id> */
- VOID FldPnd(NOARG); /* Signal pending field input */
- VOID CTYP FldReq(FdfP fp, FlgT rf); /* Field input required/optional */
- /*- Internals ----------------------------*/
- VOID CTYP _FldPut(FdfP f, FlgT h);
- VOID CTYP _FldSet(FdfP f);
- /*- Implementation macros ----------------*/
- #define EntCur() (EctlCur)
- #define EntSav() (EctlCur->ectl |= EDF_SAV)
- #define EntSep(ws) (_FmtSeps(ws))
- #define EntTrm(kc) (*(EctlCur->etrm) = (kc))
- #define EntWrp() (EctlCur->ectl |= EDF_WRP)
- #define FldCur() (EctlCur->ecur)
- #define FldInp() (FdfUse(EctlCur->ecur) |= FMT_INP)
- #define FldPnd() (FdfUse(EctlCur->ecur) |= FMT_PND)
- #define EntShow() (EntGet(0))
- #ifdef __cplusplus
- }
- #endif
- #endif /*- _TCXLent_ : End of TCXLent.h ------------------------------*/