home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
SDPUSHRT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
1KB
|
55 lines
/*
sdpushrt.c
% sed_PushRight
C-scape 3.2
Copyright (c) 1986, 1987, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
11/06/86 jmd Now returns the edge character. This will have to be
changed when "string too short" is fixed.
11/12/86 sng Now handles variable-length fields.
11/18/87 jmd changed names of some low-level funcs
5/11/88 jmd moved work to field_PushRight
3/24/89 jmd added sed_ macros
3/28/90 jmd ansi-fied
*/
#include "sed.h"
#include "fldpriv.h"
char sed_PushRight(sed_type sed, int scancode)
/*
modifies: the sed.
effects: inserts the scancode at the current position, pushes the
characters to the right:
|hllo mom x|
^ sed_PushRight(sed, 'e');
|hello mom | ----> return('x');
^
returns: the character that falls off the edge. If the cursor is over
empty space, return '\0'.
*/
{
char edge_char;
cs_Assert(sed_Ok(sed), CS_SD_PSHR_SED, 0);
edge_char = menu_PushRight(sed_GetMenu(sed), sed_GetFieldNo(sed), sed_GetRecordPos(sed), (char) scancode);
/* If the cursor is past the last character just paint it */
if (sed_GetRecordPos(sed) >= strlen(menu_GetFieldRecord(sed_GetMenu(sed), sed_GetFieldNo(sed)))) {
sd_overwrite(sed);
}
else {
sd_refresh_field(sed, sed_GetFieldNo(sed));
}
return(edge_char);
}