home *** CD-ROM | disk | FTP | other *** search
- {
- ═══════════════════════════════════════════════════════════════════════════
-
- Visionix Win/User Interface "Forms" Unit (VFORM)
- Copyright 1991,92,93 Visionix
- ALL RIGHTS RESERVED
-
- Form Tool Library. It makes it possible to automatically create and use
- a Form for Data Input.
-
- ───────────────────────────────────────────────────────────────────────────
-
- Revision history in reverse chronological order:
-
- Initials Date Comment
- -------- -------- -------------------------------------------------------
-
- lpg 03/06/93 Fixed bug with WTextMask Node. Needed GotoXY()
-
- mep 02/11/93 Cleaned up code for beta release
-
- jrt 02/08/93 Sync with beta 0.12 release
-
- jrt 12/07/92 Sync with beta 0.11 release
-
- jrt 11/21/92 Sync with beta 0.08
-
-
- lpg 10/05/92 Added Support for Float, TxtMask, & NumMask nodes.
- Increased Node Info Size to 16 Bytes
-
- jrt 09/01/92 First logged revision.
-
- jrt ??/??/91 Fixed FNT_RadioB fields so they are no longer
- hardcoded to white on blue
-
- jrt ??/??/91 Fixed FNT_Opt fields handling of <ESC>
-
- ═══════════════════════════════════════════════════════════════════════════
- }
-
-
- Unit VForm;
-
-
- Uses
-
- VTypes,
- VIn,
- VWinlow,
- VWinhigh,
- VGen,
- VCrt,
- DOS;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Const
- {Form Node Types: }
- FNT_Master= 1; { Master Node }
- FNT_Text = 2; { read text node }
- FNT_Num = 3; { read num node }
- FNT_XBox = 4; { check box node }
- FNT_Opt = 5; { readopt field node }
- FNT_Proc = 6; { vendor procedure node }
- FNT_Header= 7; { text header node }
- FNT_Button= 8; { push button node }
- FNT_RadioB= 9; { radio button node }
- FNT_Hex = 10; { hex node }
-
- FNT_Float = 11; { read float node }
- FNT_TMask = 12; { read TxtMask node }
- FNT_NMask = 13; { read NumMask node }
-
- {------------------}
- { FNT_Proc Actions }
- {------------------}
-
- FPA_Draw = 1;
- FPA_Read = 2;
-
- Type
-
- FNI_Master = RECORD
- NumNodes : WORD; {number of form nodes}
- HF : BYTE; {highlight fore color}
- HB : BYTE; {highlight back color}
- F1 : BYTE; {fore color 1 }
- F2 : BYTE; {fore color 2 }
- B1 : BYTE; {back color 1 }
- B2 : BYTE; {back color 2 }
- {8 bytes to here}
- Resd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Text = RECORD
- Ptr : POINTER;
- Length : BYTE;
- Reserved : Array[1..3] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Header = RECORD
- Ptr : POINTER;
- Reserved : Array[1..4] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Num = RECORD
- Num : LONGINT;
- Length : BYTE;
- Reserved : Array[1..3] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_XBox = RECORD
- Setting : BOOLEAN;
- Reserved : Array[1..7] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Button = RECORD
- Ptr : POINTER;
- BType : BYTE;
- Key : BYTE;
- ExtKey : BYTE;
- Reserved : Array[1..1] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_RadioB = RECORD
- Setting : BOOLEAN;
- SetPrev : BYTE;
- SetNext : BYTE;
- Reserved : Array[1..5] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Opt = RECORD
- Ptr : Pointer;
- NumOpt : BYTE;
- CurChoice: INTEGER;
- Reserved : BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Hex = RECORD
- Num : LONGINT;
- Length : BYTE;
- Reserved : Array[1..3] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Proc = RECORD
- Ptr : Pointer;
- Action : BYTE;
- Length : BYTE;
- Reserved : Array[1..2] of BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_Float = RECORD {8 bytes}
- Float : REAL; {6 bytes}
- Width : BYTE;
- Decimal : BYTE;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
- FNI_TMask = RECORD {13 bytes - 5 too many!}
- Mask : POINTER;
- Keys : POINTER;
- Fill : CHAR;
- LJust : BOOLEAN;
- Txt : POINTER;
- Rsvd2 : Array[1..2] of BYTE; {just need 3 bytes here}
- END;
-
- FNI_NMask = RECORD {8 bytes}
- Mask : POINTER;
- Num : LONGINT;
- Rsvd2 : Array[1..8] of BYTE;
- END;
-
-
- TFormNodeSpecInfo = RECORD
-
- Case INTEGER Of
-
- 1 : ( Master : FNI_Master );
- 2 : ( Text : FNI_Text );
- 3 : ( Num : FNI_Num );
- 4 : ( XBox : FNI_XBox );
- 5 : ( Opt : FNI_Opt );
- 6 : ( Proc : FNI_Proc );
- 7 : ( Header : FNI_Header );
- 8 : ( Button : FNI_Button );
- 9 : ( RadioB : FNI_RadioB );
- 10 : ( Hex : FNI_Hex );
- 11 : ( Float : FNI_Float );
- 12 : ( TMask : FNI_TMask );
- 13 : ( NMask : FNI_NMask );
-
- END;
-
- TFormNode = RECORD
-
- T : WORD; { type }
- X : BYTE; { x location }
- Y : BYTE; { Y locatio }
- F : INTEGER; { fore }
- B : INTEGER; { back }
-
- HF : INTEGER;
- HB : INTEGER;
-
- I : TFormNodeSpecInfo; { info }
-
- PrevMajor : BYTE;
- NextMajor : BYTE; { next major (for pgup/pgdn) }
-
- GroupAwake : BOOLEAN; { if groupmaster, is group up? }
-
- GroupMaster : BYTE; { group master for this node }
-
- END;
-
- PFormNode = ^TFormNode;
-
- TFormMax = Array[0..255] of TFormNode;
-
- PFormMax = ^TFormMax;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure WMakeFNode( Var FN : TFormNode;
- T : BYTE;
- X : BYTE;
- Y : BYTE;
- F : INTEGER;
- B : INTEGER;
- HF : INTEGER;
- HB : INTEGER;
- PrevMajor : BYTE;
- NextMajor : BYTE;
- GroupAwake : BOOLEAN;
- GroupMaster : BYTE );
-
- Procedure WDrawFormNode( F : PFormMax;
- NodeNum : BYTE;
- UseHigh : BOOLEAN );
-
- Procedure WDrawForm( F : PFormMax );
-
-
- Procedure WReadForm( F : PFormMax;
- Var Cur : BYTE;
- Var ReturnCode : INTEGER );
-
- {────────────────────────────────────────────────────────────────────────────}
-
-