home *** CD-ROM | disk | FTP | other *** search
- /* ==( memo/field.h )== */
-
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1989 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written JPK 1-May-89 */
- /* Modified Geo 12-Dec-89 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 12-Dec-89 Geo - V2 version
- *
- */
-
- /* mask characters used for field input */
- # define MASK_I 'I' /* anything goes, international stuff */
- # define MASK_C 'C' /* alphabetic, convert to lower case */
- # define MASK_c 'c' /* alphanumeric, convert to lower case */
- # define MASK_P 'P' /* alphanumeric & space, convert to upper case */
- # define MASK_Q 'Q' /* alphanumeric & space, convert to lower case */
- # define MASK_p 'p' /* alphanumeric & space */
- # define MASK_x 'x' /* any character */
- # define MASK_X 'X' /* any character, convert to upper case */
- # define MASK_Y 'V' /* any character, convert to lower case */
- # define MASK_a 'a' /* alphabetic character */
- # define MASK_A 'A' /* alphabetic character, convert to upper case */
- # define MASK_B 'B' /* alphabetic character, convert to lower case */
- # define MASK_8 '8' /* numeric, l to r, floating decimal */
- # define MASK_MONEY '$' /* numeric, l to r, fill dollar sign */
- # define MASK_9 '9' /* numeric input, left to right, fill zeros */
- # define MASK_Z 'Z' /* numeric input, left to right */
- # define MASK_z 'z' /* numeric input, left to right */
- # define MASK_AT '@' /* set NUMLOCK on for this numeric field */
- # define MASK_PSWD '!' /* password input, input is echoed with '*' */
- # define MASK_SPECIAL '^' /* delimits special characters */
-
- /* mask characters used specically for date field input */
- # define MASK_YEAR 'Y'
- # define MASK_MONTH 'M'
- # define MASK_DAY 'D'
- # define MASK_HOUR 'H'
- # define MASK_MINUTE 'N'
- # define MASK_SECOND 'S'
- # define MASK_WEEKDAY 'W'
- # define MASK_DAY_SUFFIX 'T'
-
- /* character to display in place of password text */
- # define PASSWORD_CHAR '*'
-
- /* field types */
- # define F_NULL (short *)0
- # define F_TEXT 0
- # define F_NUMERIC 1
- # define F_CALCULATOR 2
- # define F_DATE 3
- # define F_TIME 4
- # define F_FTEXT 5
-
- /* classes of mask characters */
- # define SPECIAL 0
- # define TEMPLATE 1
- # define FILL 2
- # define PASSWORD 3
-
- /* field control bits; combine them with an OR '|' */
- # define CONFIRM_NEEDED 1 /* control bit for field confirmation */
- # define BLANK_FIELD 2 /* control bit for blanking field on first key */
- # define NUMLOCK_FIELD 4 /* set numlock when on field, restore when done */
- # define OVERFLOW_RETURN 8 /* return if field overflows */
- # define NO_OVERFLOW 16 /* field is not allowed to overflow (inserting) */
- # define NO_HOME_END 32 /* Home and End keys cause return on field level*/
- # define NO_BLANK 64 /* IP_BLANK & IP_RESTORE keys are disabled */
-
- # define HARDSPACE ' ' /* this is the display of a true space */
- # define ASTERISK_FILL '*'
- # define DOLLAR_SIGN '$'
-
- /* macro definitions for formatting dates and numeric fields */
- #define fmt_numeric fmt_text
- #define date_input text_input
-
- /* these typedefs should be in bench.c - JPK */
- typedef int ATTR;
- typedef int KEY;
- typedef unsigned short USHORT;
-
- /* data entry field description */
- typedef struct field {
- USHORT frow; /* row to display field on */
- USHORT fcol; /* column to start field on */
- int fx; /* runnning column, starts at 0 */
- char *fbuff; /* field buffer */
- char *fmask; /* field data entry mask */
- USHORT fhelp; /* field help number */
- USHORT fieldlen; /* field length */
- USHORT ftype; /* field data type */
- ATTR fattrib_on; /* attribute when editing field */
- ATTR fattrib_off; /* attribute when not editing field */
- short fcontrol; /* control word for field */
-
- PROTO (int (*f_pre), (struct field *)); /* points to pre input function */
- PROTO (int (*f_input), (struct field *)); /* points to input routine */
- PROTO (int (*f_val), (struct field *)); /* points to validation function */
- PROTO (int (*f_post), (struct field *)); /* points to post input function */
-
- } FIELD;
-
- # define INSERTING TRUE /* initial Insert mode */
- # define MAX_MASK 256
-
- /* prototyping */
- PROTO (char *fmt_text, (struct field *));
- PROTO (int input_wx, (struct field *, int, ...));
- PROTO (int text_input, (struct field *));
- PROTO (void disp_text, (struct field *, int));
- PROTO (int length_mask, (FIELD *));
- PROTO (char *home_field, (FIELD *, char *));
- PROTO (void memo_input, (int, int, int, int, int, char *));
- PROTO (void move_text, (char *, char *, int));
- PROTO (void clean_buffer, (FIELD *));
-
-