diff options
| author | blymn <blymn@NetBSD.org> | 2002-07-08 10:43:37 +0000 |
|---|---|---|
| committer | blymn <blymn@NetBSD.org> | 2002-07-08 10:43:37 +0000 |
| commit | ecd0dffb7901a7fbfff21f2c555bf894b2f351ee (patch) | |
| tree | 2d30a2b5db7be7f8160138b3b2d07d4253c844b6 | |
| parent | b615d06ee16132474be5d93b63a5e0e1d4cdc7b2 (diff) | |
* Set character attributes when adding pad to field, null fields will
now be displayed correctly (fixes part 1 of pr 17480)
* Prevent field manipulations on null fields, the fields have nothing in
them so they should not be manipulated.
| -rw-r--r-- | lib/libform/internals.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libform/internals.c b/lib/libform/internals.c index 9d7add2796d..fcb2a4ddecd 100644 --- a/lib/libform/internals.c +++ b/lib/libform/internals.c @@ -1,4 +1,4 @@ -/* $NetBSD: internals.c,v 1.23 2002/05/20 15:00:11 blymn Exp $ */ +/* $NetBSD: internals.c,v 1.24 2002/07/08 10:43:37 blymn Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn @@ -1246,11 +1246,18 @@ _formi_redraw_field(FORM *form, int field) for (row = cur->row_count - cur->start_line; row < cur->rows; row++) { wmove(form->scrwin, (int) (cur->form_row + row), (int) cur->form_col); + + if (form->cur_field == field) + wattrset(form->scrwin, cur->fore); + else + wattrset(form->scrwin, cur->back); + for (i = 0; i < cur->cols; i++) { waddch(form->scrwin, cur->pad); } } + wattrset(form->scrwin, cur->back); return; } @@ -1551,6 +1558,8 @@ _formi_manipulate_field(FORM *form, int c) int len; cur = form->fields[form->cur_field]; + if ((cur->buffers[0].string == NULL) || (cur->buffers[0].length == 0)) + return E_REQUEST_DENIED; #ifdef DEBUG fprintf(dbg, "entry: request is REQ_%s\n", reqs[c - REQ_MIN_REQUEST]); |
