MCPcopy Create free account
hub / github.com/Kitware/CMake / _nc_Set_Current_Field

Function _nc_Set_Current_Field

Source/CursesDialog/form/frm_driver.c:1146–1230  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : int _nc_Set_Current_Field(FORM * form, | FIELD * newfield) | | Description : Make the newfield the new current field. | | Return Values : E_OK - success | E_BAD_ARGUMENT - inv

Source from the content-addressed store, hash-verified

1144| Return Values : E_OK - success
1145| E_BAD_ARGUMENT - invalid form or field pointer
1146| E_SYSTEM_ERROR - some severe basic error
1147+--------------------------------------------------------------------------*/
1148int
1149_nc_Set_Current_Field(FORM *form, FIELD *newfield)
1150{
1151 FIELD *field;
1152 WINDOW *new_window;
1153
1154 if (!form || !newfield || !form->current || (newfield->form!=form))
1155 return(E_BAD_ARGUMENT);
1156
1157 if ( (form->status & _IN_DRIVER) )
1158 return(E_BAD_STATE);
1159
1160 if (!(form->field))
1161 return(E_NOT_CONNECTED);
1162
1163 field = form->current;
1164
1165 if ((field!=newfield) ||
1166 !(form->status & _POSTED))
1167 {
1168 if ((form->w) &&
1169 (field->opts & O_VISIBLE) &&
1170 (field->form->curpage == field->page))
1171 {
1172 _nc_Refresh_Current_Field(form);
1173 if (field->opts & O_PUBLIC)
1174 {
1175 if (field->drows > field->rows)
1176 {
1177 if (form->toprow==0)
1178 field->status &= ~_NEWTOP;
1179 else
1180 field->status |= _NEWTOP;
1181 }
1182 else
1183 {
1184 if (Justification_Allowed(field))
1185 {
1186 Window_To_Buffer(form->w,field);
1187 werase(form->w);
1188 Perform_Justification(field,form->w);
1189 wsyncup(form->w);
1190 }
1191 }
1192 }
1193 delwin(form->w);
1194 }
1195
1196 field = newfield;
1197
1198 if (Has_Invisible_Parts(field))
1199 new_window = newpad(field->drows,field->dcols);
1200 else
1201 new_window = derwin(Get_Form_Window(form),
1202 field->rows,field->cols,field->frow,field->fcol);
1203

Callers 14

FN_Next_FieldFunction · 0.85
FN_Previous_FieldFunction · 0.85
FN_First_FieldFunction · 0.85
FN_Last_FieldFunction · 0.85
FN_Sorted_Next_FieldFunction · 0.85
FN_Sorted_Previous_FieldFunction · 0.85
FN_Sorted_First_FieldFunction · 0.85
FN_Sorted_Last_FieldFunction · 0.85
FN_Left_FieldFunction · 0.85
FN_Right_FieldFunction · 0.85
FN_Up_FieldFunction · 0.85
FN_Down_FieldFunction · 0.85

Calls 11

Window_To_BufferFunction · 0.85
weraseFunction · 0.85
Perform_JustificationFunction · 0.85
wsyncupFunction · 0.85
delwinFunction · 0.85
newpadFunction · 0.85
derwinFunction · 0.85
Buffer_To_WindowFunction · 0.85
Undo_JustificationFunction · 0.85
untouchwinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…