home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name wncurmov -- Move the current window's cursor.
- *
- * Synopsis presult = wncurmov(row,column);
- *
- * BWINDOW *presult Pointer to current window structure,
- * or NIL if failure.
- * int row,column Row and column (relative to upper left
- * corner of window) of new cursor
- * position.
- *
- * Description The current window's cursor is moved. No change is
- * visible unless the window has been selected via WNCURSOR
- * to have the active cursor on its display page.
- *
- * An error occurs if the position is beyond the bounds of
- * the window.
- *
- * Returns presult Pointer to current BWINDOW
- * structure, or NIL if failure.
- * b_pcurwin->cur_loc Current BWINDOW cursor position,
- * or unchanged if failure.
- * b_wnerr Possible values:
- * (No change) Success.
- * WN_ILL_DIM Position out of range.
- * WN_BAD_WIN No window designated
- * as current.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- * Version 3.02 March 20, 1987
- * Prevented physical cursor movement if window is delayed.
- *
- **/
-
- #include <bwindow.h>
-
- BWINDOW *wncurmov(row,column)
- int row,column;
- {
- if (wnvalwin(b_pcurwin) == NIL)
- {
- wnerror(WN_BAD_WIN);
- return NIL;
- }
- if ( row < 0
- || row >= b_pcurwin->img.dim.h
- || column < 0
- || column >= b_pcurwin->img.dim.w)
- {
- wnerror(WN_ILL_DIM);
- return NIL;
- }
-
- b_pcurwin->cur_loc.row = row;
- b_pcurwin->cur_loc.col = column;
-
- if (b_pcurwin->where_shown.dev != ABSENT
- && (!b_pcurwin->internals.cur_frozen)
- && (!b_pcurwin->options.delayed))
- sccurset(b_pcurwin->where_shown.corner.row + row,
- b_pcurwin->where_shown.corner.col + column);
-
- return b_pcurwin;
- }