home *** CD-ROM | disk | FTP | other *** search
- /*
- tedcurs.c
-
- % ted_GetCursor, ted_GotoCursor
-
- C-scape 3.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 3/24/89 jmd added sed_ macros
- 5/23/89 jdc made tb_setcursor menu_setcursor
- 8/04/89 jdc played with tb->set_cursor
-
- 3/28/90 jmd ansi-fied
- 10/28/90 jdc fixed boolean/int ret conflict
- */
-
- #include "ted.h"
-
- long ted_GetCursor(sed_type sed)
- {
- return((sed_GetTextbuf(sed))->cursor);
- }
-
- boolean ted_GotoCursor(sed_type sed, long cursor)
- /*
- moves the cursor through the text
- */
- {
- tb_type tb;
- int row, col;
- boolean ret = TRUE;
-
- tb = sed_GetTextbuf(sed);
-
- tb->cursor = cursor;
- if (menu_setcursor(sed_GetMenu(sed)) == TRUE) {
- row = tb_GetRow(tb);
- col = tb_GetCol(tb);
- }
- else {
- ret = FALSE;
- row = tb_GetRow(tb) + 1;
- col = 0;
- }
-
- tb->xcol = sed_GetTcol(sed);
- ted_GotoPosition(sed, row, col);
-
- return(ret);
- }
-