From c6433f6e2e33f352087ed32c41ac3191d0645d7f Mon Sep 17 00:00:00 2001 From: angelo Date: Mon, 19 May 1997 15:32:14 +0000 Subject: [PATCH] Bonazzi's advice reporting: modifiche agli spreadsheet per il caricamento delle righe e l'aggiunta delle righe nll'inizio el caso non si abbia il focus; git-svn-id: svn://10.65.10.50/trunk@4348 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/msksheet.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 48783552e..896598440 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -680,15 +680,17 @@ int TSpreadsheet::insert( // almeno 999 righe oppure se lo spreadsheet non e' attivo. { static bool ininsert = FALSE; - + + TMask & m = owner().mask(); if (ininsert || items() >= 999) return -1; - if (rec < 0 && items() > 0 && !owner().append() ) + 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) +// 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; @@ -1003,8 +1005,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) { if (test_focus_change()) { - owner().mask().notify_focus_field(owner().dlg()); insert(-1, TRUE, TRUE); + owner().mask().notify_focus_field(owner().dlg()); } } } @@ -1287,8 +1289,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) case K_CTRL+'+': if (test_focus_change()) { - owner().mask().notify_focus_field(owner().dlg()); insert(-1, TRUE, TRUE); + owner().mask().notify_focus_field(owner().dlg()); refused = TRUE; } break;