--------------------------------------------------------------------------- | Facility : libnform | Function : int _nc_Set_Form_Page(FORM * form, | int page, | FIELD * field) | | Description : Make the given page nr. the current page and make | the given field the current
| 3323 | /*---------------------------------------------------------------------------- |
| 3324 | Helper routines for Page Navigation |
| 3325 | --------------------------------------------------------------------------*/ |
| 3326 | |
| 3327 | /*--------------------------------------------------------------------------- |
| 3328 | | Facility : libnform |
| 3329 | | Function : int _nc_Set_Form_Page(FORM * form, |
| 3330 | | int page, |
| 3331 | | FIELD * field) |
| 3332 | | |
| 3333 | | Description : Make the given page nr. the current page and make |
| 3334 | | the given field the current field on the page. If |
| 3335 | | for the field NULL is given, make the first field on |
| 3336 | | the page the current field. The routine acts only |
| 3337 | | if the requested page is not the current page. |
| 3338 | | |
| 3339 | | Return Values : E_OK - success |
| 3340 | | != E_OK - error from subordinate call |
| 3341 | +--------------------------------------------------------------------------*/ |
| 3342 | int |
| 3343 | _nc_Set_Form_Page(FORM * form, int page, FIELD * field) |
| 3344 | { |
| 3345 | int res = E_OK; |
| 3346 | |
| 3347 | if ((form->curpage!=page)) |
| 3348 | { |
| 3349 | FIELD *last_field, *field_on_page; |
| 3350 | |
| 3351 | werase(Get_Form_Window(form)); |
| 3352 | form->curpage = page; |
| 3353 | last_field = field_on_page = form->field[form->page[page].smin]; |
| 3354 | do |
| 3355 | { |
| 3356 | if (field_on_page->opts & O_VISIBLE) |
| 3357 | if ((res=Display_Field(field_on_page))!=E_OK) |
| 3358 | return(res); |
no test coverage detected
searching dependent graphs…