diff --git a/include/sheet.cpp b/include/sheet.cpp index ba3fd9f8d..9fad7918d 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -589,7 +589,7 @@ TCursor_sheet::TCursor_sheet(TCursor* cursor, const char* fields, TToken_string fldlst(fields); int campi = 0; for (const char* t = fldlst.get(0); t; t = fldlst.get(), campi++) - if (*t > ' ' && *t != '\"') + if (*t > ' ' && *t != '"') { TFieldref fr(t, 0); TRecfield* rf = new TRecfield(_cursor->curr(fr.file()), @@ -705,14 +705,16 @@ bool TBrowse_sheet::on_key(KEY k) { WINDOW ctl = get_ctl_window(win(), 100); - const bool alnum = (k >= '0' && k <= '9') || - (k >= 'A' && k <= 'Z') || - (k >= 'a' && k <= 'z') || - k == ' '; + const bool alnum = k < 256 && isprint(k); if (alnum || k == K_BACKSPACE || k == K_DEL) { const long oldsel = selected(); - const TString80 old(_field->get()); + // const TString80 old(_field->get()); + WINDOW fwin = get_ctl_window(_field->parent(), _field->dlg()); + TString80 old; + get_title(fwin, (char *) (const char *) old, 80); + old.ltrim(); + TString80 val((const char*)old); if (alnum) @@ -722,14 +724,17 @@ bool TBrowse_sheet::on_key(KEY k) val << char(k); } else val.rtrim(1); - field().set(val); + // field().set(val); + set_title(fwin, (char *) (const char*) val); ((TBrowse*)field().browse())->do_input(FALSE); _cursor->read(); if (_cursor->file().bad()) { beep(); - field().set(val = old); + // field().set(val = old); + val = old; + set_title(fwin, (char *) (const char *)val); *_cursor = oldsel; } else @@ -740,7 +745,7 @@ bool TBrowse_sheet::on_key(KEY k) } else { - field().reset(); + field().set(""); if (ctl != NULL_WIN) set_title(ctl, ""); }