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

Function Field_Editing

Source/CursesDialog/form/frm_driver.c:2168–2209  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : static int Field_Editing( | int (* const fct) (FORM *), | FORM * form) | | Description : Generic routine for field editing requests. The driver | routines are only called for

Source from the content-addressed store, hash-verified

2166| int (* const fct) (FORM *),
2167| FORM * form)
2168|
2169| Description : Generic routine for field editing requests. The driver
2170| routines are only called for editable fields, the
2171| _WINDOW_MODIFIED flag is set if editing occurred.
2172| This is somewhat special due to the overload semantics
2173| of the NEW_LINE and DEL_PREV requests.
2174|
2175| Return Values : Error code from low level drivers.
2176+--------------------------------------------------------------------------*/
2177static int Field_Editing(int (* const fct) (FORM *), FORM * form)
2178{
2179 int res = E_REQUEST_DENIED;
2180
2181 /* We have to deal here with the specific case of the overloaded
2182 behaviour of New_Line and Delete_Previous requests.
2183 They may end up in navigational requests if we are on the first
2184 character in a field. But navigation is also allowed on non-
2185 editable fields.
2186 */
2187 if ((fct==FE_Delete_Previous) &&
2188 (form->opts & O_BS_OVERLOAD) &&
2189 First_Position_In_Current_Field(form) )
2190 {
2191 res = Inter_Field_Navigation(FN_Previous_Field,form);
2192 }
2193 else
2194 {
2195 if (fct==FE_New_Line)
2196 {
2197 if ((form->opts & O_NL_OVERLOAD) &&
2198 First_Position_In_Current_Field(form))
2199 {
2200 res = Inter_Field_Navigation(FN_Next_Field,form);
2201 }
2202 else
2203 /* FE_New_Line deals itself with the _WINDOW_MODIFIED flag */
2204 res = fct(form);
2205 }
2206 else
2207 {
2208 /* From now on, everything must be editable */
2209 if (form->current->opts & O_EDIT)
2210 {
2211 res = fct(form);
2212 if (res==E_OK)

Callers

nothing calls this directly

Calls 1

Inter_Field_NavigationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…