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

Function Data_Entry

Source/CursesDialog/form/frm_driver.c:3498–3553  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : static int Data_Entry(FORM * form,int c) | | Description : Enter character c into at the current position of the | current field of the form. | | Return Values : E_OK - | E_REQUEST_DENIED - |

Source from the content-addressed store, hash-verified

3496}
3497/*----------------------------------------------------------------------------
3498 END of Field Navigation routines
3499 --------------------------------------------------------------------------*/
3500
3501
3502/*----------------------------------------------------------------------------
3503 Helper routines for the core form driver.
3504 --------------------------------------------------------------------------*/
3505
3506/*---------------------------------------------------------------------------
3507| Facility : libnform
3508| Function : static int Data_Entry(FORM * form,int c)
3509|
3510| Description : Enter character c into at the current position of the
3511| current field of the form.
3512|
3513| Return Values : E_OK -
3514| E_REQUEST_DENIED -
3515| E_SYSTEM_ERROR -
3516+--------------------------------------------------------------------------*/
3517static int Data_Entry(FORM * form, int c)
3518{
3519 FIELD *field = form->current;
3520 int result = E_REQUEST_DENIED;
3521
3522 if ( (field->opts & O_EDIT)
3523#if FIX_FORM_INACTIVE_BUG
3524 && (field->opts & O_ACTIVE)
3525#endif
3526 )
3527 {
3528 if ( (field->opts & O_BLANK) &&
3529 First_Position_In_Current_Field(form) &&
3530 !(form->status & _FCHECK_REQUIRED) &&
3531 !(form->status & _WINDOW_MODIFIED) )
3532 werase(form->w);
3533
3534 if (form->status & _OVLMODE)
3535 {
3536 waddch(form->w,(chtype)c);
3537 }
3538 else /* no _OVLMODE */
3539 {
3540 bool There_Is_Room = Is_There_Room_For_A_Char_In_Line(form);
3541
3542 if (!(There_Is_Room ||
3543 ((Single_Line_Field(field) && Growable(field)))))
3544 return E_REQUEST_DENIED;
3545
3546 if (!There_Is_Room && !Field_Grown(field,1))
3547 return E_SYSTEM_ERROR;
3548
3549 winsch(form->w,(chtype)c);
3550 }
3551
3552 if ((result=Wrapping_Not_Necessary_Or_Wrapping_Ok(form))==E_OK)
3553 {
3554 bool End_Of_Field= (((field->drows-1)==form->currow) &&
3555 ((field->dcols-1)==form->curcol));

Callers 1

form_driverFunction · 0.85

Calls 8

weraseFunction · 0.85
waddchFunction · 0.85
Field_GrownFunction · 0.85
winschFunction · 0.85
Inter_Field_NavigationFunction · 0.85
IFN_Next_CharacterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…