|
|
As with menu processing, some processing of user form requests may move the cursor from the location required for continued processing by the form driver. This function moves the cursor back to where it belongs.
SYNOPSIS
int pos_form_cursor (form) FORM form;You need call this function only if your application program changes the cursor position of the form window.
``Repositioning the cursor after printing page number'' illustrates one use of this function. Function printpage repositions the cursor after it prints the page number in the form window.
void printpage (form) FORM * form; { int p = form_page (form) + 1; WINDOW * w = form_win (form); int rows, cols; char buf[80];box (w, 0, 0); /* put border around form window */ getmaxyx (w, rows, cols); /* fetch window size */ sprintf (buf, " %d ", p); /* store next page number */
wmove (w, (rows-1), ((cols-1)-strlen(buf))/2); /* position cursor */ waddstr (w, buf); /* print page number */
/* position the form cursor for continued form processing */
pos_form_cursor (form); }
main () { FORM * form;
set_form_init (form, printpage); }
Repositioning the cursor after printing page number
If pos_form_cursor encounters an error, it returns one of the following: