- implemented cursor retreat function (_wcursback) as a core function

- reimplemented cleaner wgetnstr
- fixed wdelch for use with _wcursback
This commit is contained in:
Dan Lynch
2006-06-28 11:48:40 +00:00
parent 6e2c97b0c0
commit c29c868475
4 changed files with 74 additions and 41 deletions
+19
View File
@@ -48,6 +48,25 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) {
}
}
/**
* Retreat the cursor back one position (useful for a whole host of
* ops)
*
* @v *win window in which to retreat
*/
void _wcursback ( WINDOW *win ) {
if ( win->curs_x == 0 ) {
if ( win->curs_y == 0 )
win->curs_y = win->height - 1;
win->curs_x = win->width = 1;
} else {
win->curs_x--;
}
win->scr->movetoyx( win->scr, win->ori_y + win->curs_y,
win->ori_x + win->curs_x );
}
/**
* Write a chtype string to a window
*