From 97149ea3170e15e94879676a0fbed99bf63dc32d Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 25 Feb 2009 16:53:27 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : tutti Ricompilazione Demo : [ ] Commento : Migliorata forzatura del focus ad una cella di una griglia git-svn-id: svn://10.65.10.50/trunk@18356 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/msksheet.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 8ae13bf25..30305a89e 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -3051,13 +3051,19 @@ void TSheet_field::set_focus_cell(int riga, int colonna) void TSheet_field::set_focus_cell_id(long rec, short cid) { TSpreadsheet* s = (TSpreadsheet*)_ctl; - - //qui - - const int row = s->rec2row(rec); - const int col = s->cid2col(cid); - s->set_focus_cell(rec, col); + const int col = s->cid2col(cid); + const int row = s->rec2row(rec); + + // Controlla che la cella sia veramente visibile + int first_col, last_col, first_row, last_row; + xi_get_visible_columns(s->_obj, &first_col, &last_col); + xi_get_visible_rows(s->_obj, &first_row, &last_row); + + if (col >= first_col && col <= last_col && row >= first_row && row <= last_row) + s->set_focus_cell(row, col); + else + s->select(rec, col, true); } bool TSheet_field::on_key(KEY k)