diff options
author | paul <paul@FreeBSD.org> | 1995-01-11 06:08:45 +0000 |
---|---|---|
committer | paul <paul@FreeBSD.org> | 1995-01-11 06:08:45 +0000 |
commit | c81d36156b03bf39e90e7cc067a1eb06561979a5 (patch) | |
tree | f3bb96c196d1e82f52b515abd2a2e36b790fe659 /lib | |
parent | 48a3ca7f45bfe12aaf989130ade7c6b154d3416a (diff) | |
download | FreeBSD-src-c81d36156b03bf39e90e7cc067a1eb06561979a5.zip FreeBSD-src-c81d36156b03bf39e90e7cc067a1eb06561979a5.tar.gz |
Added emacs ^A,^E,^B & ^F keybindings to field editor.
Changed a constant to a sizeof in test.c
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libforms/examples/test.c | 2 | ||||
-rw-r--r-- | lib/libforms/forms.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libforms/examples/test.c b/lib/libforms/examples/test.c index 8725c2b..d587354 100644 --- a/lib/libforms/examples/test.c +++ b/lib/libforms/examples/test.c @@ -35,7 +35,7 @@ main() struct text_field field4 = {string4}; struct input_field field5 = {1,"A place filler",0}; struct text_field field6 = {string6}; - struct menu_field field7 = {4, 0, options7}; + struct menu_field field7 = {sizeof &options7, 0, options7}; struct action_field field8 = {"EXIT",&exit_form}; struct action_field field9 = {"CANCEL",&cancel_form}; diff --git a/lib/libforms/forms.c b/lib/libforms/forms.c index c865b34..72dd90f 100644 --- a/lib/libforms/forms.c +++ b/lib/libforms/forms.c @@ -101,6 +101,8 @@ int update_form(struct form *form) { + show_form(form); + switch (form->field[form->current_field].type) { case F_MENU: field_menu(form); @@ -115,8 +117,6 @@ update_form(struct form *form) default: } - show_form(form); - return (done); } @@ -379,11 +379,11 @@ field_input(struct form *form) if (field->field.input->lbl_flag) { field->field.input->lbl_flag = 0; } - if (ch == F_CHOME) { + if ((ch == F_CHOME) || (ch == '')) { disp_off = 0; cursor = 0; abspos = 0; - } else if (ch == F_CEND) { + } else if ((ch == F_CEND) || (ch == '')) { disp_off = DISPOFF; abspos = len; cursor = CURSPOS; @@ -396,7 +396,7 @@ field_input(struct form *form) len - abspos); --len; } - } else if ((ch == F_CLEFT) || (ch == F_CBS)) { + } else if ((ch == F_CLEFT) || (ch == F_CBS) || (ch == '')) { if (!abspos) beep(); else { @@ -413,7 +413,7 @@ field_input(struct form *form) ++cursor; } } - } else if (ch == F_CRIGHT) { + } else if ((ch == F_CRIGHT) || (ch == '')) { if (abspos == len) beep(); else { |