From f861502e4af6a5e3a9da3a1bcc16e42a7fc29c3d Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 1 Aug 1996 15:55:23 +0000 Subject: [PATCH] msksheet.cpp Corrette ricerche relation.cpp Corrtto congelamento git-svn-id: svn://10.65.10.50/trunk@3316 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/msksheet.cpp | 47 ++++++++++++++++++++++++-------------------- include/relation.cpp | 5 +++-- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 07a8b127c..ccd21bce8 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -857,27 +857,32 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) } break; case XIE_BUTTON: - if (xiev->v.xi_obj->type == XIT_CELL) - { - XI_CELL_DATA& cell = xiev->v.xi_obj->v.cell; - int num; - XI_OBJ** column = xi_get_member_list(_obj, &num); - CHECK(cell.column < num, "Bad column"); - int rec = cell.row; - rec = row2rec(rec); - const int col = column[cell.column]->cid - FIRST_FIELD; - if (!cell_disabled(rec, col)) - { - if (xi_move_focus(xiev->v.xi_obj)) - dispatch_e_char(parent(), K_F9); - } - } - else - if (xiev->v.xi_obj->type == XIT_LIST) - { - owner().mask().notify_focus_field(owner().dlg()); - insert(-1); + if (_check_enabled) + { + on_idle(); // Termina tutti gli eventuali update in corso + + if (xiev->v.xi_obj->type == XIT_CELL) + { + XI_CELL_DATA& cell = xiev->v.xi_obj->v.cell; + int num; + XI_OBJ** column = xi_get_member_list(_obj, &num); + CHECK(cell.column < num, "Bad column"); + int rec = cell.row; + rec = row2rec(rec); + const int col = column[cell.column]->cid - FIRST_FIELD; + if (!cell_disabled(rec, col)) + { + if (xi_move_focus(xiev->v.xi_obj)) + dispatch_e_char(parent(), K_F9); + } } + else + if (xiev->v.xi_obj->type == XIT_LIST) + { + owner().mask().notify_focus_field(owner().dlg()); + insert(-1); + } + } break; case XIE_SELECT: if (xiev->v.xi_obj->type == XIT_ROW) @@ -1387,7 +1392,7 @@ void TSpreadsheet::mask2str(int rec) // Certified 50% // @doc INTERNAL - + // @mfunc Permette di abilitare/disabilitare una singola cella void TSpreadsheet::enable_cell( int row, // @parm Riga della cella da abilitare/disabilitare diff --git a/include/relation.cpp b/include/relation.cpp index 59f6aca13..9669d5b52 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1078,8 +1078,6 @@ void TCursor::filter( // @comm ATTENZIONE: non e' possibile filtrare un cursore congelato { - CHECK(!_frozen, "Impossibile filtrare un cursore congelato"); - TString kf(_keyfrom), kto(_keyto); const bool filterchanged = (fil != NULL) && (_filter != fil); @@ -1104,9 +1102,12 @@ void TCursor::filter( if (filterchanged || (_keyfrom != kf) || (_keyto != kto)) { + CHECK(!frozen(), "Impossibile filtrare un cursore congelato"); + _pos = 0; _totrec = 0; _lastrec = 0; + if (filterchanged) { _filter = fil;