--------------------------------------------------------------------------- | Facility : libnform | Function : int _nc_Refresh_Current_Field(FORM * form) | | Description : Propagate the changes in the fields window to the | window of the form. | | Return Values : E_OK - on success | E_BAD_ARGUMENT - invalid form poi
| 620 | | Return Values : E_OK - on success |
| 621 | | E_BAD_ARGUMENT - invalid form pointer |
| 622 | | E_SYSTEM_ERROR - general error |
| 623 | +--------------------------------------------------------------------------*/ |
| 624 | int |
| 625 | _nc_Refresh_Current_Field(FORM * form) |
| 626 | { |
| 627 | WINDOW *formwin; |
| 628 | FIELD *field; |
| 629 | |
| 630 | if (!form) |
| 631 | RETURN(E_BAD_ARGUMENT); |
| 632 | |
| 633 | if (!form->w || !form->current) |
| 634 | RETURN(E_SYSTEM_ERROR); |
| 635 | |
| 636 | field = form->current; |
| 637 | formwin = Get_Form_Window(form); |
| 638 | |
| 639 | if (field->opts & O_PUBLIC) |
| 640 | { |
| 641 | if (Is_Scroll_Field(field)) |
| 642 | { |
| 643 | /* Again, in this case the fieldwin isn't derived from formwin, |
| 644 | so we have to perform a copy operation. */ |
| 645 | if (Single_Line_Field(field)) |
| 646 | { /* horizontal scrolling */ |
| 647 | if (form->curcol < form->begincol) |
| 648 | form->begincol = form->curcol; |
| 649 | else |
| 650 | { |
| 651 | if (form->curcol >= (form->begincol + field->cols)) |
| 652 | form->begincol = form->curcol - field->cols + 1; |
| 653 | } |
| 654 | copywin(form->w, |
| 655 | formwin, |
| 656 | 0, |
| 657 | form->begincol, |
| 658 | field->frow, |
| 659 | field->fcol, |
| 660 | field->frow, |
| 661 | field->cols + field->fcol - 1, |
| 662 | 0); |
| 663 | } |
| 664 | else |
| 665 | { /* A multiline, i.e. vertical scrolling field */ |
| 666 | int row_after_bottom,first_modified_row,first_unmodified_row; |
| 667 | |
| 668 | if (field->drows > field->rows) |
| 669 | { |
| 670 | row_after_bottom = form->toprow + field->rows; |
| 671 | if (form->currow < form->toprow) |
| 672 | { |
| 673 | form->toprow = form->currow; |
| 674 | field->status |= _NEWTOP; |
| 675 | } |
| 676 | if (form->currow >= row_after_bottom) |
| 677 | { |
| 678 | form->toprow = form->currow - field->rows + 1; |
| 679 | field->status |= _NEWTOP; |
no test coverage detected
searching dependent graphs…