home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
SDINCFLD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
2KB
|
75 lines
/*
sdincfld.c
% sed_IncField
C-scape 3.2
Copyright (c) 1986, 1987, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
11/05/86 jmd converted to boolean
11/06/86 jmd removed references to toggled_in_exit
11/07/86 jmd cleaned up the logic
11/08/86 jmd added calls to do_funcs
11/10/86 jmd added protected mode
11/18/87 jmd changed names of some low-level funcs
4/08/88 jmd changed sed->fieldcount to sed_GetFieldCount()
3/24/89 jmd added sed_ macros
5/27/89 jmd removed unnecessary call to goto_field
3/17/90 jmd added Cache/Flush
3/28/90 jmd ansi-fied
*/
#include "sed.h"
int sed_IncField(sed_type sed)
/*
modifies: sed object.
effects: tries to go to the next editing field, without wrapping
around (contingent upon passing the fexit test).
*/
{
register int next_fld;
menu_type menu;
cs_Assert(sed_Ok(sed), CS_SD_IF_SED, 0);
menu = sed_GetMenu(sed);
if (sed_GetFieldNo(sed) + 1 >= menu_GetFieldCount(menu)) {
return(SED_STUCK);
}
/* find next unprotected field */
for (next_fld = sed_GetFieldNo(sed) + 1; next_fld < menu_GetFieldCount(menu); next_fld++) {
if (!menu_IsProtected(menu, next_fld)) {
break;
}
}
if (next_fld >= menu_GetFieldCount(menu)) { /* no unprotected fields found */
sd_goto_field(sed, sed_GetFieldNo(sed)); /* refresh current field */
return(SED_STUCK);
}
if (!sd_exitfield(sed)) {
return(SED_INVALID);
}
disp_Cache();
sd_scroll_adjust(sed, next_fld);
sd_goto_field(sed, next_fld);
if (sed_IsActive(sed)) {
sed_DoFieldFenter(sed, sed_GetFieldNo(sed));
}
disp_Flush();
return(SED_MOVED);
}