X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fedit_field.c;h=5ac096dcfb7b59aba8c1a9b3ab690d79a978128e;hp=5e1aa6a27d7f2a8d7716a424cde1db1e6e25b497;hb=8485ec820b6d0ad70950b63834f31b3ca235c84b;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/test/edit_field.c b/test/edit_field.c index 5e1aa6a2..5ac096dc 100644 --- a/test/edit_field.c +++ b/test/edit_field.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: edit_field.c,v 1.13 2006/12/09 16:50:11 tom Exp $ + * $Id: edit_field.c,v 1.15 2008/12/20 19:23:01 tom Exp $ * * A wrapper for form_driver() which keeps track of the user's editing changes * for each field, and makes the result available as a null-terminated string @@ -291,6 +291,13 @@ offset_in_field(FORM * form) return form->curcol + form->currow * field->dcols; } +static void +inactive_field(FIELD * f) +{ + FieldAttrs *ptr = (FieldAttrs *) field_userptr(f); + set_field_back(f, ptr->background); +} + int edit_field(FORM * form, int *result) { @@ -310,7 +317,7 @@ edit_field(FORM * form, int *result) if (ch <= KEY_MAX) { set_field_back(before, A_REVERSE); } else if (ch <= MAX_FORM_COMMAND) { - set_field_back(before, A_UNDERLINE); + inactive_field(before); } *result = ch; @@ -439,7 +446,7 @@ edit_field(FORM * form, int *result) } if (current_field(form) != before) - set_field_back(before, A_UNDERLINE); + inactive_field(before); return status; } #else