Descrizione da ripristinare per commit rifatto

git-svn-id: svn://10.65.10.50/trunk@4307 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
augusto 1997-04-29 09:55:11 +00:00
parent bbb94e2cbd
commit 6b2002d740

View File

@ -696,18 +696,22 @@ int TSpreadsheet::insert(
ininsert = TRUE; ininsert = TRUE;
int r = rec < 0 ? items() : rec; int r = rec < 0 ? items() : rec;
const bool ok = call_notify ? notify(r, K_INS) : TRUE; bool ok = call_notify ? notify(r, K_INS) : TRUE;
if (ok) if (ok)
{ {
r = _str.insert(new TToken_string(80), rec); TToken_string* toktok = new TToken_string(80);
r = _str.insert(toktok, rec);
_property.insert(NULL, r); _property.insert(NULL, r);
// Notifica che l'inserimento e' terminato // Notifica che l'inserimento e' terminato
xi_insert_row(_obj, INT_MAX);
owner().post_insert(r); owner().post_insert(r);
if (call_notify) if (call_notify)
notify(r, K_CTRL + K_INS); notify(r, K_CTRL + K_INS);
xi_insert_row(_obj, INT_MAX);
if (update_sheet) if (update_sheet)
xi_cell_request(_obj); xi_cell_request(_obj);
@ -854,8 +858,12 @@ bool TSpreadsheet::off_cell_handler(XI_OBJ *cell)
} }
bool TSpreadsheet::test_focus_change() bool TSpreadsheet::test_focus_change()
{ {
bool ok = xi_move_focus(get_interface()) ? TRUE : FALSE; bool ok = TRUE;
if (_cell_dirty)
ok = off_cell_handler();
if (ok)
ok = xi_move_focus(get_interface()) ? TRUE : FALSE;
return ok; return ok;
} }
@ -974,7 +982,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
{ {
on_idle(); // Termina tutti gli eventuali update in corso on_idle(); // Termina tutti gli eventuali update in corso
if (xiev->v.xi_obj->type == XIT_CELL) if (xiev->v.xi_obj->type == XIT_CELL) // Bottone della cella
{ {
XI_CELL_DATA& cell = xiev->v.xi_obj->v.cell; XI_CELL_DATA& cell = xiev->v.xi_obj->v.cell;
int num; int num;
@ -990,11 +998,16 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
} }
} }
else else
if (xiev->v.xi_obj->type == XIT_LIST) {
if (xiev->v.xi_obj->type == XIT_LIST) // Bottone dello sheet
{ {
owner().mask().notify_focus_field(owner().dlg()); if (test_focus_change())
insert(-1, TRUE, TRUE); {
owner().mask().notify_focus_field(owner().dlg());
insert(-1, TRUE, TRUE);
}
} }
}
} }
break; break;
case XIE_SELECT: case XIE_SELECT:
@ -1121,14 +1134,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
ok = notify(_cur_rec, K_ENTER); // Notify edit ok = notify(_cur_rec, K_ENTER); // Notify edit
_row_dirty = FALSE; // Avoid double notifications! _row_dirty = FALSE; // Avoid double notifications!
} }
if (ok) if (!ok)
{
//xvt_statbar_refresh();
}
else
{
refused = TRUE; refused = TRUE;
}
} }
if (!refused) // Notifica l'abbandono della riga if (!refused) // Notifica l'abbandono della riga
refused = !notify(_cur_rec, K_CTRL+K_TAB); refused = !notify(_cur_rec, K_CTRL+K_TAB);
@ -1277,10 +1284,13 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
refused = TRUE; refused = TRUE;
} }
break; break;
case K_CTRL + '+': case K_CTRL+'+':
owner().mask().notify_focus_field(owner().dlg()); if (test_focus_change())
insert(-1, TRUE, TRUE); {
refused = TRUE; owner().mask().notify_focus_field(owner().dlg());
insert(-1, TRUE, TRUE);
refused = TRUE;
}
break; break;
case K_CTRL + 'A': case K_CTRL + 'A':
{ {