Completata la modifica per l'errore 6

git-svn-id: svn://10.65.10.50/trunk@65 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-26 13:50:01 +00:00
parent b108a12dba
commit 9b980ba6c5

View File

@ -608,9 +608,14 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
: TCursor_sheet(cursor, fields, title, head, buttons), _field(f)
{
#if XVT_OS == XVT_OS_WIN
xvt_create_control(WC_EDIT, 1, -3, f->size()+1, 1, f->get(), win(),
CTL_FLAG_DISABLED, 0L, 100);
#else
xvt_create_control(WC_EDIT, 1, -3, f->size()+2, 1, f->get(), win(),
CTL_FLAG_DISABLED, 0L, 100);
#endif
if (s && s->items() > 2)
{
int maxlen = 0;
@ -652,7 +657,7 @@ void TBrowse_sheet::repos_buttons() const
if (w != NULL_WIN)
{
RCT r; get_client_rect(w, &r);
r.left = CHARX*(id == 99 ? _field->size()+3 : 1);
r.left = CHARX*(id == 99 ? _field->size()+4 : 1);
r.top = wr.bottom - 4*CHARY + 4;
r.right += r.left;
r.bottom += r.top;
@ -674,11 +679,11 @@ bool TBrowse_sheet::on_key(KEY k)
{
const long oldsel = selected();
const TString old(_field->get());
TString val(old.size()+1); val = old;
if (alnum)
{
if (val.len() > field().size())
if (val.len() >= field().size())
val.cut(0);
val << char(k);
}