home *** CD-ROM | disk | FTP | other *** search
- /*
- sledirows.c
-
- % sled_InsertRows
-
- C-scape 3.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 10/14/88 jdc created
- 11/09/88 jdc rewrote for sarrays
-
- 3/29/89 jmd converted seds to 'pure' objects, cleaned up macros
- 4/13/89 jmd added Fenter, Fexit support
- 5/23/89 jdc added check for varsize == 0
- 8/04/89 gam changed #include <sledwin.h> to sled.h
- 8/05/89 gam added protection/marking for rows and columns
-
- 2/22/90 jdc preened
- 3/28/90 jmd ansi-fied
- 7/25/90 jdc changed DoFieldFexit to sd_exitfield
- 8/27/90 jdc added active check for sed_DoSexits
- 10/07/90 jdc fixed GoHome and Fenter
- 10/28/90 jdc fixed boolean/int ret conflict
- */
-
- #include "sed.h"
- #include "sadecl.h"
- #include "sled.h"
-
- boolean sled_InsertRows(sed_type sed, int row, int count)
- {
- int col;
- boolean ret = TRUE;
- sarray_type sa;
-
- /* call fexit cause we are 'leaving' the field */
- if (!sd_exitfield(sed)) {
- return(FALSE);
- }
-
- /* Save current field vars */
- if (sed_IsActive(sed)) {
- sed_DoSexits(sed);
- }
-
- /* Don't forget to do the protection column (notice the "<=") */
- for (col = 0; col <= sled_GetWidth(sed); col++) {
-
- /* set the columns, sa == NULL means varsize == 0 */
- sa = (sarray_type) xa_Get(sled_GetXa(sed), col);
- if (sa != NULL && sa_Blank(sa, (long)row, count, TRUE) == NULL) {
- ret = FALSE;
- }
- }
- if (ret) {
- sled_SetColSize(sed, sled_GetColSize(sed) + count);
- sed_SetMenuVHeight(sed, sled_GetColSize(sed));
-
- sled_remapper(sed, 0);
-
- /* the field should appear to be newly entered */
- sed_GoHome(sed);
- sed_DoFieldFenter(sed, sed_GetFieldNo(sed));
- }
-
- return(ret);
- }
-