Migliorata insert
git-svn-id: svn://10.65.10.50/trunk@4659 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bb764186b6
commit
9b77c6ebca
@ -702,16 +702,6 @@ int TSpreadsheet::insert(
|
|||||||
if (ininsert || items() >= 999)
|
if (ininsert || items() >= 999)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (m.is_running() && rec < 0 && items() > 0 && !owner().append() )
|
|
||||||
{
|
|
||||||
XI_OBJ* itf = get_interface();
|
|
||||||
// XI_OBJ* focus = xi_get_focus(itf);
|
|
||||||
// if (focus && focus->type == XIT_CELL)
|
|
||||||
if (m.focus_field().dlg() == owner().dlg())
|
|
||||||
rec = _cur_rec + 1;
|
|
||||||
else
|
|
||||||
rec = 0;
|
|
||||||
}
|
|
||||||
ininsert = TRUE;
|
ininsert = TRUE;
|
||||||
int r = rec < 0 ? items() : rec;
|
int r = rec < 0 ? items() : rec;
|
||||||
|
|
||||||
@ -1021,8 +1011,18 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
if (xiev->v.xi_obj->type == XIT_LIST) // Bottone dello sheet
|
if (xiev->v.xi_obj->type == XIT_LIST) // Bottone dello sheet
|
||||||
{
|
{
|
||||||
if (test_focus_change())
|
if (test_focus_change())
|
||||||
{
|
{
|
||||||
insert(-1, TRUE, TRUE);
|
int rec = -1;
|
||||||
|
|
||||||
|
if (items() > 0 && !owner().append())
|
||||||
|
{
|
||||||
|
XI_OBJ* itf = get_interface();
|
||||||
|
if (owner().mask().focus_field().dlg() == owner().dlg())
|
||||||
|
rec = _cur_rec + 1;
|
||||||
|
else
|
||||||
|
rec = 0;
|
||||||
|
}
|
||||||
|
insert(rec, TRUE, TRUE);
|
||||||
owner().mask().notify_focus_field(owner().dlg());
|
owner().mask().notify_focus_field(owner().dlg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1308,7 +1308,17 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
case K_CTRL + '+': // ********* insert line
|
case K_CTRL + '+': // ********* insert line
|
||||||
if (test_focus_change())
|
if (test_focus_change())
|
||||||
{
|
{
|
||||||
insert(-1, TRUE, TRUE);
|
int rec = -1;
|
||||||
|
|
||||||
|
if (items() > 0 && !owner().append())
|
||||||
|
{
|
||||||
|
XI_OBJ* itf = get_interface();
|
||||||
|
if (owner().mask().focus_field().dlg() == owner().dlg())
|
||||||
|
rec = _cur_rec + 1;
|
||||||
|
else
|
||||||
|
rec = 0;
|
||||||
|
}
|
||||||
|
insert(rec, TRUE, TRUE);
|
||||||
owner().mask().notify_focus_field(owner().dlg());
|
owner().mask().notify_focus_field(owner().dlg());
|
||||||
refused = TRUE;
|
refused = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user