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

Function _nc_First_Active_Field

Source/CursesDialog/form/frm_driver.c:2818–2854  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : FIELD* _nc_First_Active_Field(FORM * form) | | Description : Get the first active field on the current page, | if there are such. If there are none, get the first | visible field on the page. If there are also none, |

Source from the content-addressed store, hash-verified

2816 if (Field_Is_Selectable(*field_on_page))
2817 break;
2818 } while(field!=(*field_on_page));
2819 return(*field_on_page);
2820}
2821
2822/*---------------------------------------------------------------------------
2823| Facility : libnform
2824| Function : FIELD* _nc_First_Active_Field(FORM * form)
2825|
2826| Description : Get the first active field on the current page,
2827| if there are such. If there are none, get the first
2828| visible field on the page. If there are also none,
2829| we return the first field on page and hope the best.
2830|
2831| Return Values : Pointer to calculated field.
2832+--------------------------------------------------------------------------*/
2833FIELD*
2834_nc_First_Active_Field(FORM * form)
2835{
2836 FIELD **last_on_page = &form->field[form->page[form->curpage].pmax];
2837 FIELD *proposed = Next_Field_On_Page(*last_on_page);
2838
2839 if (proposed == *last_on_page)
2840 { /* there might be the special situation, where there is no
2841 active and visible field on the current page. We then select
2842 the first visible field on this readonly page
2843 */
2844 if (Field_Is_Not_Selectable(proposed))
2845 {
2846 FIELD **field = &form->field[proposed->index];
2847 FIELD **first = &form->field[form->page[form->curpage].pmin];
2848
2849 do
2850 {
2851 field = (field==last_on_page) ? first : field + 1;
2852 if (((*field)->opts & O_VISIBLE))
2853 break;
2854 } while(proposed!=(*field));
2855
2856 proposed = *field;
2857

Callers 2

set_form_pageFunction · 0.85
form_driverFunction · 0.85

Calls 1

Next_Field_On_PageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…