Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

frm_driver.c File Reference

#include "form.priv.h"

Go to the source code of this file.

Classes

struct  Binding_Info

Defines

#define FRIENDLY_PREV_NEXT_WORD   (1)
#define FIX_FORM_INACTIVE_BUG   (1)
#define GROW_IF_NAVIGATE   (1)
#define myADDNSTR(w, s, n)   waddnstr(w, s, n)
#define myINSNSTR(w, s, n)   winsnstr(w, s, n)
#define myINNSTR(w, s, n)   winnstr(w, s, n)
#define myWCWIDTH(w, y, x)   1
#define Position_Of_Row_In_Buffer(field, row)   ((row)*(field)->dcols)
#define Address_Of_Nth_Buffer(field, N)   ((field)->buf + (N)*(1+Buffer_Length(field)))
#define Address_Of_Row_In_Nth_Buffer(field, N, row)   (Address_Of_Nth_Buffer(field,N) + Position_Of_Row_In_Buffer(field,row))
#define Address_Of_Row_In_Buffer(field, row)   Address_Of_Row_In_Nth_Buffer(field,0,row)
#define Address_Of_Current_Row_In_Nth_Buffer(form, N)   Address_Of_Row_In_Nth_Buffer((form)->current,N,(form)->currow)
#define Address_Of_Current_Row_In_Buffer(form)   Address_Of_Current_Row_In_Nth_Buffer(form,0)
#define Address_Of_Current_Position_In_Nth_Buffer(form, N)   (Address_Of_Current_Row_In_Nth_Buffer(form,N) + (form)->curcol)
#define Address_Of_Current_Position_In_Buffer(form)   Address_Of_Current_Position_In_Nth_Buffer(form,0)
#define Is_Scroll_Field(field)
#define Has_Invisible_Parts(field)
#define Justification_Allowed(field)
#define Growable(field)   ((field)->status & _MAY_GROW)
#define Set_Field_Window_Attributes(field, win)
#define Field_Really_Appears(field)
#define First_Position_In_Current_Field(form)   (((form)->currow==0) && ((form)->curcol==0))
#define Minimum(a, b)   (((a)<=(b)) ? (a) : (b))
#define Maximum(a, b)   (((a)>=(b)) ? (a) : (b))
#define CHECKPOS(form)
#define DeleteChar(form)
#define USE_DIV_T   (0)
#define Display_Field(field)   Display_Or_Erase_Field(field,FALSE)
#define Erase_Field(field)   Display_Or_Erase_Field(field,TRUE)
#define There_Is_No_Room_For_A_Char_In_Line(f)   !Is_There_Room_For_A_Char_In_Line(f)
#define ID_PN   (0x00000000)
#define ID_FN   (0x00010000)
#define ID_IFN   (0x00020000)
#define ID_VSC   (0x00030000)
#define ID_HSC   (0x00040000)
#define ID_FE   (0x00050000)
#define ID_EM   (0x00060000)
#define ID_FV   (0x00070000)
#define ID_CH   (0x00080000)
#define ID_Mask   (0xffff0000)
#define Key_Mask   (0x0000ffff)
#define ID_Shft   (16)

Functions

static int Inter_Field_Navigation (int(*const fct)(FORM *), FORM *form)
static int FN_Next_Field (FORM *form)
static int FN_Previous_Field (FORM *form)
static int FE_New_Line (FORM *)
static int FE_Delete_Previous (FORM *)
static INLINE FIELD_CELLGet_Start_Of_Data (FIELD_CELL *buf, int blen)
static INLINE FIELD_CELLAfter_End_Of_Data (FIELD_CELL *buf, int blen)
static INLINE FIELD_CELLGet_First_Whitespace_Character (FIELD_CELL *buf, int blen)
static INLINE FIELD_CELLAfter_Last_Whitespace_Character (FIELD_CELL *buf, int blen)
static INLINE void Adjust_Cursor_Position (FORM *form, const FIELD_CELL *pos)
static void Buffer_To_Window (const FIELD *field, WINDOW *win)
static void Window_To_Buffer (WINDOW *win, FIELD *field)
static INLINE void Synchronize_Buffer (FORM *form)
static bool Field_Grown (FIELD *field, int amount)
 _nc_Position_Form_Cursor (FORM *form)
 _nc_Refresh_Current_Field (FORM *form)
static void Perform_Justification (FIELD *field, WINDOW *win)
static void Undo_Justification (FIELD *field, WINDOW *win)
static bool Check_Char (FIELDTYPE *typ, int ch, TypeArgument *argp)
static int Display_Or_Erase_Field (FIELD *field, bool bEraseFlag)
static int Synchronize_Field (FIELD *field)
static int Synchronize_Linked_Fields (FIELD *field)
 _nc_Synchronize_Attributes (FIELD *field)
 _nc_Synchronize_Options (FIELD *field, Field_Options newopts)
 _nc_Set_Current_Field (FORM *form, FIELD *newfield)
static int IFN_Next_Character (FORM *form)
static int IFN_Previous_Character (FORM *form)
static int IFN_Next_Line (FORM *form)
static int IFN_Previous_Line (FORM *form)
static int IFN_Next_Word (FORM *form)
static int IFN_Previous_Word (FORM *form)
static int IFN_Beginning_Of_Field (FORM *form)
static int IFN_End_Of_Field (FORM *form)
static int IFN_Beginning_Of_Line (FORM *form)
static int IFN_End_Of_Line (FORM *form)
static int IFN_Left_Character (FORM *form)
static int IFN_Right_Character (FORM *form)
static int IFN_Up_Character (FORM *form)
static int IFN_Down_Character (FORM *form)
static int VSC_Generic (FORM *form, int nlines)
static int Vertical_Scrolling (int(*const fct)(FORM *), FORM *form)
static int VSC_Scroll_Line_Forward (FORM *form)
static int VSC_Scroll_Line_Backward (FORM *form)
static int VSC_Scroll_Page_Forward (FORM *form)
static int VSC_Scroll_Half_Page_Forward (FORM *form)
static int VSC_Scroll_Page_Backward (FORM *form)
static int VSC_Scroll_Half_Page_Backward (FORM *form)
static int HSC_Generic (FORM *form, int ncolumns)
static int Horizontal_Scrolling (int(*const fct)(FORM *), FORM *form)
static int HSC_Scroll_Char_Forward (FORM *form)
static int HSC_Scroll_Char_Backward (FORM *form)
static int HSC_Horizontal_Line_Forward (FORM *form)
static int HSC_Horizontal_Half_Line_Forward (FORM *form)
static int HSC_Horizontal_Line_Backward (FORM *form)
static int HSC_Horizontal_Half_Line_Backward (FORM *form)
static INLINE bool Is_There_Room_For_A_Line (FORM *form)
static INLINE bool Is_There_Room_For_A_Char_In_Line (FORM *form)
static int Insert_String (FORM *form, int row, FIELD_CELL *txt, int len)
static int Wrapping_Not_Necessary_Or_Wrapping_Ok (FORM *form)
static int Field_Editing (int(*const fct)(FORM *), FORM *form)
static int FE_Insert_Character (FORM *form)
static int FE_Insert_Line (FORM *form)
static int FE_Delete_Character (FORM *form)
static int FE_Delete_Line (FORM *form)
static int FE_Delete_Word (FORM *form)
static int FE_Clear_To_End_Of_Line (FORM *form)
static int FE_Clear_To_End_Of_Field (FORM *form)
static int FE_Clear_Field (FORM *form)
static int EM_Overlay_Mode (FORM *form)
static int EM_Insert_Mode (FORM *form)
static bool Next_Choice (FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
static bool Previous_Choice (FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
static int CR_Next_Choice (FORM *form)
static int CR_Previous_Choice (FORM *form)
static bool Check_Field (FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
 _nc_Internal_Validation (FORM *form)
static int FV_Validation (FORM *form)
static INLINE FIELDNext_Field_On_Page (FIELD *field)
 _nc_First_Active_Field (FORM *form)
static INLINE FIELDPrevious_Field_On_Page (FIELD *field)
static INLINE FIELDSorted_Next_Field (FIELD *field)
static INLINE FIELDSorted_Previous_Field (FIELD *field)
static INLINE FIELDLeft_Neighbor_Field (FIELD *field)
static INLINE FIELDRight_Neighbor_Field (FIELD *field)
static FIELDUpper_Neighbor_Field (FIELD *field)
static FIELDDown_Neighbor_Field (FIELD *field)
static int FN_First_Field (FORM *form)
static int FN_Last_Field (FORM *form)
static int FN_Sorted_Next_Field (FORM *form)
static int FN_Sorted_Previous_Field (FORM *form)
static int FN_Sorted_First_Field (FORM *form)
static int FN_Sorted_Last_Field (FORM *form)
static int FN_Left_Field (FORM *form)
static int FN_Right_Field (FORM *form)
static int FN_Up_Field (FORM *form)
static int FN_Down_Field (FORM *form)
 _nc_Set_Form_Page (FORM *form, int page, FIELD *field)
static INLINE int Next_Page_Number (const FORM *form)
static INLINE int Previous_Page_Number (const FORM *form)
static int Page_Navigation (int(*const fct)(FORM *), FORM *form)
static int PN_Next_Page (FORM *form)
static int PN_Previous_Page (FORM *form)
static int PN_First_Page (FORM *form)
static int PN_Last_Page (FORM *form)
static int Data_Entry (FORM *form, int c)
 form_driver (FORM *form, int c)
 set_field_buffer (FIELD *field, int buffer, const char *value)
 field_buffer (const FIELD *field, int buffer)

Variables

static FIELD_CELL myBLANK = BLANK
static FIELD_CELL myZEROS
static const Binding_Info bindings [MAX_FORM_COMMAND-MIN_FORM_COMMAND+1]


Define Documentation

#define Address_Of_Current_Position_In_Buffer form   )     Address_Of_Current_Position_In_Nth_Buffer(form,0)
 

Definition at line 162 of file frm_driver.c.

Referenced by FE_New_Line(), IFN_Next_Word(), and IFN_Previous_Word().

#define Address_Of_Current_Position_In_Nth_Buffer form,
 )     (Address_Of_Current_Row_In_Nth_Buffer(form,N) + (form)->curcol)
 

Definition at line 157 of file frm_driver.c.

#define Address_Of_Current_Row_In_Buffer form   )     Address_Of_Current_Row_In_Nth_Buffer(form,0)
 

Definition at line 152 of file frm_driver.c.

Referenced by FE_Delete_Word(), IFN_Beginning_Of_Line(), IFN_End_Of_Line(), and Wrapping_Not_Necessary_Or_Wrapping_Ok().

#define Address_Of_Current_Row_In_Nth_Buffer form,
 )     Address_Of_Row_In_Nth_Buffer((form)->current,N,(form)->currow)
 

Definition at line 147 of file frm_driver.c.

#define Address_Of_Nth_Buffer field,
 )     ((field)->buf + (N)*(1+Buffer_Length(field)))
 

Definition at line 134 of file frm_driver.c.

Referenced by field_buffer(), Field_Grown(), and set_field_buffer().

#define Address_Of_Row_In_Buffer field,
row   )     Address_Of_Row_In_Nth_Buffer(field,0,row)
 

Definition at line 142 of file frm_driver.c.

Referenced by FE_Delete_Previous(), Insert_String(), and Is_There_Room_For_A_Line().

#define Address_Of_Row_In_Nth_Buffer field,
N,
row   )     (Address_Of_Nth_Buffer(field,N) + Position_Of_Row_In_Buffer(field,row))
 

Definition at line 138 of file frm_driver.c.

#define CHECKPOS form   ) 
 

Definition at line 234 of file frm_driver.c.

Referenced by _nc_Synchronize_Attributes().

#define DeleteChar form   ) 
 

Value:

wmove((form)->w, (form)->currow, (form)->curcol), \
          wdelch((form)->w)

Definition at line 335 of file frm_driver.c.

Referenced by FE_Delete_Character(), FE_Delete_Previous(), and Wrapping_Not_Necessary_Or_Wrapping_Ok().

#define Display_Field field   )     Display_Or_Erase_Field(field,FALSE)
 

Definition at line 1058 of file frm_driver.c.

Referenced by _nc_Set_Form_Page(), _nc_Synchronize_Attributes(), _nc_Synchronize_Options(), and Synchronize_Field().

#define Erase_Field field   )     Display_Or_Erase_Field(field,TRUE)
 

Definition at line 1059 of file frm_driver.c.

Referenced by _nc_Synchronize_Options().

#define Field_Really_Appears field   ) 
 

Value:

((field->form)                          &&\
   (field->form->status & _POSTED)        &&\
   (field->opts & O_VISIBLE)              &&\
   (field->page == field->form->curpage))

Definition at line 194 of file frm_driver.c.

Referenced by _nc_Synchronize_Attributes(), _nc_Synchronize_Options(), and Synchronize_Field().

#define First_Position_In_Current_Field form   )     (((form)->currow==0) && ((form)->curcol==0))
 

Definition at line 202 of file frm_driver.c.

Referenced by Data_Entry(), FE_Delete_Previous(), and Field_Editing().

#define FIX_FORM_INACTIVE_BUG   (1)
 

Definition at line 97 of file frm_driver.c.

Referenced by Data_Entry().

#define FRIENDLY_PREV_NEXT_WORD   (1)
 

Definition at line 95 of file frm_driver.c.

#define GROW_IF_NAVIGATE   (1)
 

Definition at line 99 of file frm_driver.c.

#define Growable field   )     ((field)->status & _MAY_GROW)
 

Definition at line 186 of file frm_driver.c.

Referenced by Data_Entry(), FE_Insert_Character(), FE_Insert_Line(), FE_New_Line(), Field_Grown(), Insert_String(), set_field_buffer(), and Wrapping_Not_Necessary_Or_Wrapping_Ok().

#define Has_Invisible_Parts field   ) 
 

Value:

(!((field)->opts & O_PUBLIC)      || \
   Is_Scroll_Field(field))

Definition at line 174 of file frm_driver.c.

Referenced by _nc_Position_Form_Cursor(), and _nc_Set_Current_Field().

#define ID_CH   (0x00080000)
 

Definition at line 3979 of file frm_driver.c.

#define ID_EM   (0x00060000)
 

Definition at line 3977 of file frm_driver.c.

#define ID_FE   (0x00050000)
 

Definition at line 3976 of file frm_driver.c.

#define ID_FN   (0x00010000)
 

Definition at line 3972 of file frm_driver.c.

#define ID_FV   (0x00070000)
 

Definition at line 3978 of file frm_driver.c.

#define ID_HSC   (0x00040000)
 

Definition at line 3975 of file frm_driver.c.

#define ID_IFN   (0x00020000)
 

Definition at line 3973 of file frm_driver.c.

#define ID_Mask   (0xffff0000)
 

Definition at line 3980 of file frm_driver.c.

Referenced by form_driver().

#define ID_PN   (0x00000000)
 

Definition at line 3971 of file frm_driver.c.

#define ID_Shft   (16)
 

Definition at line 3982 of file frm_driver.c.

Referenced by form_driver().

#define ID_VSC   (0x00030000)
 

Definition at line 3974 of file frm_driver.c.

#define Is_Scroll_Field field   ) 
 

Value:

(((field)->drows > (field)->rows) || \
    ((field)->dcols > (field)->cols))

Definition at line 167 of file frm_driver.c.

Referenced by _nc_Refresh_Current_Field().

#define Justification_Allowed field   ) 
 

Value:

(((field)->just != NO_JUSTIFICATION)  && \
    (Single_Line_Field(field))           && \
    (((field)->dcols == (field)->cols)   && \
    ((field)->opts & O_STATIC))             )

Definition at line 179 of file frm_driver.c.

Referenced by _nc_Set_Current_Field(), _nc_Synchronize_Attributes(), Display_Or_Erase_Field(), and Synchronize_Field().

#define Key_Mask   (0x0000ffff)
 

Definition at line 3981 of file frm_driver.c.

Referenced by form_driver().

#define Maximum a,
 )     (((a)>=(b)) ? (a) : (b))
 

Definition at line 206 of file frm_driver.c.

#define Minimum a,
 )     (((a)<=(b)) ? (a) : (b))
 

Definition at line 205 of file frm_driver.c.

Referenced by Field_Grown().

#define myADDNSTR w,
s,
 )     waddnstr(w, s, n)
 

Definition at line 107 of file frm_driver.c.

Referenced by Buffer_To_Window(), FE_Delete_Previous(), FE_Delete_Word(), FE_New_Line(), Perform_Justification(), and Undo_Justification().

#define myINNSTR w,
s,
 )     winnstr(w, s, n)
 

Definition at line 109 of file frm_driver.c.

Referenced by Window_To_Buffer().

#define myINSNSTR w,
s,
 )     winsnstr(w, s, n)
 

Definition at line 108 of file frm_driver.c.

Referenced by Insert_String().

#define myWCWIDTH w,
y,
x   )     1
 

Definition at line 110 of file frm_driver.c.

Referenced by IFN_Left_Character(), IFN_Next_Character(), IFN_Previous_Character(), and IFN_Right_Character().

#define Position_Of_Row_In_Buffer field,
row   )     ((row)*(field)->dcols)
 

Definition at line 131 of file frm_driver.c.

#define Set_Field_Window_Attributes field,
win   ) 
 

Value:

(  wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
   wattrset((win),(field)->fore) )

Definition at line 189 of file frm_driver.c.

Referenced by _nc_Set_Current_Field(), _nc_Synchronize_Attributes(), Display_Or_Erase_Field(), and Field_Grown().

#define There_Is_No_Room_For_A_Char_In_Line  )     !Is_There_Room_For_A_Char_In_Line(f)
 

Definition at line 2243 of file frm_driver.c.

Referenced by Wrapping_Not_Necessary_Or_Wrapping_Ok().

#define USE_DIV_T   (0)
 

Definition at line 430 of file frm_driver.c.


Function Documentation

_nc_First_Active_Field FORM form  ) 
 

Definition at line 3144 of file frm_driver.c.

References field, Field_Is_Not_Selectable, Next_Field_On_Page(), and O_VISIBLE.

Referenced by form_driver(), and set_form_page().

03145 {
03146   FIELD **last_on_page = &form->field[form->page[form->curpage].pmax];
03147   FIELD *proposed = Next_Field_On_Page(*last_on_page);
03148 
03149   if (proposed == *last_on_page)
03150     {
03151       /* there might be the special situation, where there is no
03152          active and visible field on the current page. We then select
03153          the first visible field on this readonly page
03154        */
03155       if (Field_Is_Not_Selectable(proposed))
03156         {
03157           FIELD **field = &form->field[proposed->index];
03158           FIELD **first = &form->field[form->page[form->curpage].pmin];
03159 
03160           do
03161             {
03162               field = (field == last_on_page) ? first : field + 1;
03163               if (((*field)->opts & O_VISIBLE))
03164                 break;
03165             }
03166           while (proposed != (*field));
03167 
03168           proposed = *field;
03169 
03170           if ((proposed == *last_on_page) && !(proposed->opts & O_VISIBLE))
03171             {
03172               /* This means, there is also no visible field on the page.
03173                  So we propose the first one and hope the very best...
03174                  Some very clever user has designed a readonly and invisible
03175                  page on this form.
03176                */
03177               proposed = *first;
03178             }
03179         }
03180     }
03181   return (proposed);
03182 }

_nc_Internal_Validation FORM form  ) 
 

Definition at line 3050 of file frm_driver.c.

References _CHANGED, _FCHECK_REQUIRED, fieldnode::arg, Check_Field(), field, O_PASSOK, fieldnode::opts, fieldnode::status, Synchronize_Buffer(), Synchronize_Linked_Fields(), and fieldnode::type.

Referenced by FV_Validation(), Inter_Field_Navigation(), Page_Navigation(), set_current_field(), and set_form_page().

03051 {
03052   FIELD *field;
03053 
03054   field = form->current;
03055 
03056   Synchronize_Buffer(form);
03057   if ((form->status & _FCHECK_REQUIRED) ||
03058       (!(field->opts & O_PASSOK)))
03059     {
03060       if (!Check_Field(field->type, field, (TypeArgument *)(field->arg)))
03061         return FALSE;
03062       form->status &= ~_FCHECK_REQUIRED;
03063       field->status |= _CHANGED;
03064       Synchronize_Linked_Fields(field);
03065     }
03066   return TRUE;
03067 }

_nc_Position_Form_Cursor FORM form  ) 
 

Definition at line 741 of file frm_driver.c.

References E_BAD_ARGUMENT, E_OK, E_SYSTEM_ERROR, fieldnode::fcol, field, fieldnode::frow, Get_Form_Window, Has_Invisible_Parts, wcursyncup(), and wmove().

Referenced by _nc_Refresh_Current_Field(), and pos_form_cursor().

00742 {
00743   FIELD *field;
00744   WINDOW *formwin;
00745 
00746   if (!form)
00747     return (E_BAD_ARGUMENT);
00748 
00749   if (!form->w || !form->current)
00750     return (E_SYSTEM_ERROR);
00751 
00752   field = form->current;
00753   formwin = Get_Form_Window(form);
00754 
00755   wmove(form->w, form->currow, form->curcol);
00756   if (Has_Invisible_Parts(field))
00757     {
00758       /* in this case fieldwin isn't derived from formwin, so we have
00759          to move the cursor in formwin by hand... */
00760       wmove(formwin,
00761             field->frow + form->currow - form->toprow,
00762             field->fcol + form->curcol - form->begincol);
00763       wcursyncup(formwin);
00764     }
00765   else
00766     wcursyncup(form->w);
00767   return (E_OK);
00768 }

_nc_Refresh_Current_Field FORM form  ) 
 

Definition at line 782 of file frm_driver.c.

References _nc_Position_Form_Cursor(), _NEWTOP, copywin(), E_BAD_ARGUMENT, E_SYSTEM_ERROR, field, Get_Form_Window, is_linetouched(), Is_Scroll_Field, O_PUBLIC, fieldnode::opts, RETURN, returnCode, Single_Line_Field, T, T_CALLED, and wsyncup().

Referenced by _nc_Set_Current_Field(), _nc_Synchronize_Attributes(), form_driver(), post_form(), set_current_field(), set_form_page(), and Synchronize_Field().

00783 {
00784   WINDOW *formwin;
00785   FIELD *field;
00786 
00787   T((T_CALLED("_nc_Refresh_Current_Field(%p)"), form));
00788 
00789   if (!form)
00790     RETURN(E_BAD_ARGUMENT);
00791 
00792   if (!form->w || !form->current)
00793     RETURN(E_SYSTEM_ERROR);
00794 
00795   field = form->current;
00796   formwin = Get_Form_Window(form);
00797 
00798   if (field->opts & O_PUBLIC)
00799     {
00800       if (Is_Scroll_Field(field))
00801         {
00802           /* Again, in this case the fieldwin isn't derived from formwin,
00803              so we have to perform a copy operation. */
00804           if (Single_Line_Field(field))
00805             {
00806               /* horizontal scrolling */
00807               if (form->curcol < form->begincol)
00808                 form->begincol = form->curcol;
00809               else
00810                 {
00811                   if (form->curcol >= (form->begincol + field->cols))
00812                     form->begincol = form->curcol - field->cols + 1;
00813                 }
00814               copywin(form->w,
00815                       formwin,
00816                       0,
00817                       form->begincol,
00818                       field->frow,
00819                       field->fcol,
00820                       field->frow,
00821                       field->cols + field->fcol - 1,
00822                       0);
00823             }
00824           else
00825             {
00826               /* A multi-line, i.e. vertical scrolling field */
00827               int row_after_bottom, first_modified_row, first_unmodified_row;
00828 
00829               if (field->drows > field->rows)
00830                 {
00831                   row_after_bottom = form->toprow + field->rows;
00832                   if (form->currow < form->toprow)
00833                     {
00834                       form->toprow = form->currow;
00835                       field->status |= _NEWTOP;
00836                     }
00837                   if (form->currow >= row_after_bottom)
00838                     {
00839                       form->toprow = form->currow - field->rows + 1;
00840                       field->status |= _NEWTOP;
00841                     }
00842                   if (field->status & _NEWTOP)
00843                     {
00844                       /* means we have to copy whole range */
00845                       first_modified_row = form->toprow;
00846                       first_unmodified_row = first_modified_row + field->rows;
00847                       field->status &= ~_NEWTOP;
00848                     }
00849                   else
00850                     {
00851                       /* we try to optimize : finding the range of touched
00852                          lines */
00853                       first_modified_row = form->toprow;
00854                       while (first_modified_row < row_after_bottom)
00855                         {
00856                           if (is_linetouched(form->w, first_modified_row))
00857                             break;
00858                           first_modified_row++;
00859                         }
00860                       first_unmodified_row = first_modified_row;
00861                       while (first_unmodified_row < row_after_bottom)
00862                         {
00863                           if (!is_linetouched(form->w, first_unmodified_row))
00864                             break;
00865                           first_unmodified_row++;
00866                         }
00867                     }
00868                 }
00869               else
00870                 {
00871                   first_modified_row = form->toprow;
00872                   first_unmodified_row = first_modified_row + field->rows;
00873                 }
00874               if (first_unmodified_row != first_modified_row)
00875                 copywin(form->w,
00876                         formwin,
00877                         first_modified_row,
00878                         0,
00879                         field->frow + first_modified_row - form->toprow,
00880                         field->fcol,
00881                         field->frow + first_unmodified_row - form->toprow - 1,
00882                         field->cols + field->fcol - 1,
00883                         0);
00884             }
00885           wsyncup(formwin);
00886         }
00887       else
00888         {
00889           /* if the field-window is simply a derived window, i.e. contains no
00890            * invisible parts, the whole thing is trivial
00891            */
00892           wsyncup(form->w);
00893         }
00894     }
00895   untouchwin(form->w);
00896   returnCode(_nc_Position_Form_Cursor(form));
00897 }

_nc_Set_Current_Field FORM form,
FIELD ne