diff --git a/src/include/mask.cpp b/src/include/mask.cpp index 8e08984e3..b0781d46f 100755 --- a/src/include/mask.cpp +++ b/src/include/mask.cpp @@ -2810,6 +2810,17 @@ KEY TMask::check_mask() return stop_run(K_ENTER) ? K_ENTER : K_ESC; } +// @cmember ritorna la posizione del primo campo di una cella di uno sheet +int TMask::first_cell_fldpos(int & cid) +{ + return id2pos(cid = first_cell_id(cid)); +} + +// @cmember ritorna la posizione del campo successivo di una cella di uno sheet +int TMask::next_cell_fldpos(int & cid) + +{ return id2pos(cid = next_cell_id(cid)); } + // @doc INTERNAL // @mfunc costruttore di copia diff --git a/src/include/mask.h b/src/include/mask.h index 3e4db8ea0..c22248aa3 100755 --- a/src/include/mask.h +++ b/src/include/mask.h @@ -508,8 +508,12 @@ public: { return _toolwin; } WINDOW toolbar() const { return _toolbar; } - // @cmember verifica la mascher senza eseguirla + // @cmember verifica la maschera senza eseguirla KEY check_mask(); + // @cmember ritorna la posizione del primo campo di una cella di uno sheet + int first_cell_fldpos(int & cid); + // @cmember ritorna la posizione del campo successivo di una cella di uno sheet + int next_cell_fldpos(int & cid); }; // @doc EXTERNAL diff --git a/src/include/maskfld.cpp b/src/include/maskfld.cpp index d3c029030..aefa3f9a2 100755 --- a/src/include/maskfld.cpp +++ b/src/include/maskfld.cpp @@ -581,7 +581,17 @@ void TMask_field::show( const int nrow = s->selected(); if (nrow >= 0 && nrow < s->items() && s->exist_column(dlg())) + { + int id = dlg(); + + for (int pos = mask().first_cell_fldpos(id); pos >= 0; pos = mask().next_cell_fldpos(id)) + if (mask().fld(pos).shown()) + { + on = true; + break; + } s->enable_cell(nrow, dlg(), on); + } } } #ifdef DBG diff --git a/src/include/msksheet.cpp b/src/include/msksheet.cpp index cc8abda5f..93b018664 100755 --- a/src/include/msksheet.cpp +++ b/src/include/msksheet.cpp @@ -23,6 +23,17 @@ int cid2index(short cid) return xvtil_cid2index(cid); } +int first_cell_id(const int cid) +{ + return xvtil_first_cell_id(cid); +} + +int next_cell_id(const int cid) +{ + return xvtil_next_cell_id(cid); +} + + class TCell_property : public TObject { COLOR _back, _fore; @@ -2201,7 +2212,7 @@ void TSpreadsheet::enable_cell( { if (column >= FIRST_FIELD) column = cid2index(column); - + TRow_property* prop = get_property(row); if (prop == NULL) { @@ -3453,6 +3464,9 @@ bool TSheet_field::cell_enabled(int row, int column) const void TSheet_field::show_column(int col, bool on) const { TSpreadsheet* s = (TSpreadsheet*)_ctl; + + if (col >= FIRST_FIELD) + col = cid2index(col); s->show_column(col, on); } diff --git a/src/include/msksheet.h b/src/include/msksheet.h index 6eb98ca88..e4821979a 100755 --- a/src/include/msksheet.h +++ b/src/include/msksheet.h @@ -37,6 +37,9 @@ typedef bool (*SPREADSHEET_NOTIFY)(TSheet_field& s, int r, KEY k); typedef void (*SHEET_USERGETPUT)(TSheet_field &fld_righe, int item); int cid2index(short cid); +int first_cell_id(const int cid); +int next_cell_id(const int cid); + // @doc EXTERNAL // @class TSheet_field | Classe per la gestione dei campi di uno spreadsheet diff --git a/src/include/strings.cpp b/src/include/strings.cpp index 8ac261063..7e6278010 100755 --- a/src/include/strings.cpp +++ b/src/include/strings.cpp @@ -243,7 +243,6 @@ bool TString::full() const if (!is_space(*s)) return true; return false; - } TString& TString::strip_spaces() diff --git a/src/include/tree.cpp b/src/include/tree.cpp index 4a7066b8f..b3e408284 100755 --- a/src/include/tree.cpp +++ b/src/include/tree.cpp @@ -851,4 +851,3 @@ bool TString_tree::get_description(TString& str) const str.cut(0); return obj != NULL; } - diff --git a/src/include/xvtility.cpp b/src/include/xvtility.cpp index 5ea294f25..64158bece 100755 --- a/src/include/xvtility.cpp +++ b/src/include/xvtility.cpp @@ -848,3 +848,15 @@ int xvtil_cid2index(const int cid) CHECKD(cid >= FIRST_FIELD, "Bad column id ", cid); return (cid % 100) - 1; } + +int xvtil_first_cell_id(const int cid) +{ + CHECKD(cid >= FIRST_FIELD, "Bad column id ", cid); + return (cid % 100) + 100; +} + +int xvtil_next_cell_id(const int cid) +{ + CHECKD(cid >= FIRST_FIELD, "Bad column id ", cid); + return cid + 100; +} \ No newline at end of file diff --git a/src/include/xvtility.h b/src/include/xvtility.h index f559879ed..2a83146f3 100755 --- a/src/include/xvtility.h +++ b/src/include/xvtility.h @@ -46,6 +46,8 @@ bool xvtil_popup_error(const char* msg); bool xvtil_system_error(unsigned long lasterror, ...); int xvtil_cid2index(const int cid); +int xvtil_first_cell_id(const int cid); +int xvtil_next_cell_id(const int cid); void beep(int severity = 0); void do_events();