From d3ccbe467385e5684d145b5c4da6b72a3c5435ed Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 11 Jul 1996 12:33:58 +0000 Subject: [PATCH] Corretta gestione righe disabilitate degli sheet git-svn-id: svn://10.65.10.50/trunk@3179 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.cpp | 4 ++-- include/maskfld.cpp | 2 +- include/sheet.cpp | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/form.cpp b/include/form.cpp index 4b3f3916f..e283757b1 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -3589,7 +3589,7 @@ void TForm::arrange_form() FILE* lpt = fopen(device,"w"); if (lpt == NULL) - fatal_box("Non rieso ad aprire il device %s.",device); + fatal_box("Impossibile aprire il device %s.",device); #endif // _ipy viene assunto uguale per entrambi i posizionamneti @@ -3619,7 +3619,7 @@ void TForm::arrange_form() SpoolRow((char *)(const char *) str_pos, str_pos.len()); #else lpt = fopen(device,"w"); - if (lpt == NULL) fatal_box("Non riesco ad aprire il device %s.",device); + if (lpt == NULL) fatal_box("Impossibile aprire il device %s.",device); // fprintf(lpt,"%s",(const char*) bspc); fprintf(lpt,"%s\r",(const char*) str_pos); fflush(lpt); diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 3bda28b39..3a9562ccc 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -490,7 +490,7 @@ bool TMask_field::on_hit() bool TMask_field::on_key(KEY key) { #ifdef DBG - if (key > K_CTRL) + if (key > (K_CTRL+K_SPACE)) return error_box("Tasto ignorato %d", key); #endif diff --git a/include/sheet.cpp b/include/sheet.cpp index f8ca31c1e..78151684d 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -570,7 +570,17 @@ bool TSheet_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev) { const long rec = row2rec(xiev->v.xi_obj->v.row); if (_disabled[rec]) + { refused = TRUE; + // Cerca la prossima riga abilitata e valida + const int dir = rec > selected() ? +1: -1; + const long max = items(); + for (long r = rec+dir; r >= 0 && r < max; r += dir) if (!_disabled[r]) + { + _sheet->post_select(r); + break; + } + } else if (_sheet->_select_row < 0) make_current(rec);