Corretta gestione tasti in un radiobutton

Corretti recordarray


git-svn-id: svn://10.65.10.50/trunk@1571 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-07-06 15:22:26 +00:00
parent 7f283345e6
commit 5b2a3e59af
2 changed files with 31 additions and 16 deletions

View File

@ -3046,7 +3046,7 @@ bool TList_field::on_key(KEY key)
{ {
if (key >= '0' && key <= 'z') if (key >= '0' && key <= 'z')
{ {
const int index = xvt_list_get_sel_index(win()); const int index = current();
CHECK(index >= 0, "List with no selection!"); CHECK(index >= 0, "List with no selection!");
int newindex = -1; int newindex = -1;
@ -3088,13 +3088,16 @@ bool TList_field::on_key(KEY key)
} }
if (newindex >= 0) if (newindex >= 0)
{ current(newindex);
xvt_list_suspend(win()); /*
xvt_list_set_sel(win(), index, FALSE); {
xvt_list_set_sel(win(), newindex, TRUE); xvt_list_suspend(win());
xvt_list_resume(win()); xvt_list_set_sel(win(), index, FALSE);
} xvt_list_set_sel(win(), newindex, TRUE);
} // alphanumeric xvt_list_resume(win());
}
*/
}
#if XVTWS == VMWS #if XVTWS == VMWS
if (key == K_TAB && class_id() == CLASS_LIST_FIELD) if (key == K_TAB && class_id() == CLASS_LIST_FIELD)

View File

@ -1,4 +1,4 @@
// $Id: relation.cpp,v 1.50 1995-07-03 07:49:22 angelo Exp $ // $Id: relation.cpp,v 1.51 1995-07-06 15:22:26 guy Exp $
// relation.cpp // relation.cpp
// fv 12/8/93 // fv 12/8/93
// relation class for isam files // relation class for isam files
@ -1422,6 +1422,7 @@ bool TRecord_array::renum_key(const char* field, const TString& num)
bool TRecord_array::renum_key(const char* field, long num) bool TRecord_array::renum_key(const char* field, long num)
{ {
CHECKS(num > 0, "Null key value for field: ", field);
TString16 n; n << num; TString16 n; n << num;
return renum_key(field, n); return renum_key(field, n);
} }
@ -1493,12 +1494,23 @@ int TRecord_array::write(bool re)
const TRectype* r = (TRectype*)objptr(i); const TRectype* r = (TRectype*)objptr(i);
if (r != NULL) if (r != NULL)
{ {
err = re ? f.rewrite(*r) : f.write(*r); if (re)
if (err != NOERR) {
err = re ? f.write(*r) : f.rewrite(*r); err = f.rewrite(*r);
if (err != NOERR) if (err == _iskeynotfound || err == _iseof || err == _isemptyfile)
break; err = f.write(*r);
if (err != NOERR)
break;
}
else
{
err = f.write(*r);
if (err == _isreinsert)
err = f.rewrite(*r);
if (err != NOERR)
break;
}
} }
else else
{ {
@ -1513,7 +1525,7 @@ int TRecord_array::write(bool re)
} }
} }
if (err == NOERR) if (re && err == NOERR)
{ {
// Cancella eventuali residui successivi // Cancella eventuali residui successivi
f.curr() = key(); f.put(_num, i + _offset); f.curr() = key(); f.put(_num, i + _offset);