home *** CD-ROM | disk | FTP | other *** search
- /*
- fnstd.c 8/25/88
-
- % std_funcs
-
- Standard fenter and fexit routines.
-
- C-scape 3.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- By using these routines duplicate code is eliminated, shrinking code
- size.
-
- The following flavors are supplied:
- -----------------------------------
-
- std_fenter Uses field first data pointer as a prompt message.
- Sets baton to SED_FIRST
- Moves cursor to start of field
-
- std_fexit Formats record according to third data pointer
- Clears the prompt message.
-
- stdNoCur_fenter Uses field first data pointer as a prompt message.
- Turns off cursor for field
-
- stdBigCur_fenter Uses field first data pointer as a prompt message.
- Makes cursor big in Insert mode
-
- std_senter Formats record according to third data pointer
-
- Revision History:
- -----------------
- 10/09/88 jmd added SED_ABORT support
- 11/15/88 jmd removed test for NULL prompt
- 11/18/88 jmd added sed_GoHome to std_fenter
- 3/14/90 jmd added std_format, moved formatting out of std_fexit
- 3/16/90 jmd removed prompt reset in std_fexit (sed_Go clears the
- border prompt when it's done)
- 3/16/90 jmd added support for KEY_INVALID
- 3/28/90 jmd ansi-fied
- 11/31/90 ted added oak_notused call in std_fexit().
- */
-
- #include <stdio.h>
-
- #include "cscape.h"
-
- void std_fenter(sed_type sed)
- /*
- Sets border prompt,
- Sets baton to SED_FIRST
- Moves cursor to start of field
- */
- {
- sed_BorderPrompt(sed, (char *) sed_GetCurrFieldData(sed, 0));
-
- sed_SetBaton(sed, SED_FIRST);
- sed_GoHome(sed);
- }
-
- boolean std_fexit(sed_type sed)
- /*
- Turns off border prompt
- */
- {
- oak_notused(sed);
-
- return(TRUE);
- }
-
- void std_format(sed_type sed)
- /*
- Formats the field's record using the field's third data pointer
- Update the field if the record changes
- */
- {
- if (valid_Format(sed, sed_GetFieldNo(sed), (char *) sed_GetCurrFieldData(sed, 2))) {
- sed_UpdateField(sed, sed_GetFieldNo(sed));
- }
- }
-
- void stdNoCur_fenter(sed_type sed)
- /*
- calls std_fenter,
- Turns off cursor
- */
- {
- std_fenter(sed);
-
- sed_SetCursorType(sed, CURSOR_NONE);
- }
-
- void stdBigCur_fenter(sed_type sed)
- /*
- calls std_fenter,
- Makes cursor big if in insert mode
- */
- {
- std_fenter(sed);
-
- /* make cursor big if INSERT mode */
- if (kb_Insert()) {
- sed_SetCursorType(sed, CURSOR_HALF);
- }
- else {
- sed_SetCursorType(sed, CURSOR_NORMAL);
- }
- }
-
- void std_senter(sed_type sed, int fieldno)
- /*
- Formats field record
- */
- {
- valid_Format(sed, fieldno, (char *) sed_GetFieldData(sed, fieldno, 2));
- }
-