diff --git a/ci/ci0600.cpp b/ci/ci0600.cpp index bdb163986..e4afc44b8 100755 --- a/ci/ci0600.cpp +++ b/ci/ci0600.cpp @@ -378,11 +378,8 @@ void TDef_risoatt_msk::registra() //ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera bool TDef_risoatt_msk::on_field_event(TOperable_field& f, TField_event e, long jolly) { - if (f.dlg() >= F_ANAL && f.dlg() <= F_ANAL+12) - { - if (e == fe_modify) - riempi_sheet(); - } + if (e == fe_modify && f.dlg() >= F_ANAL && f.dlg() < F_ANAL+12) + riempi_sheet(); switch (f.dlg()) { case DLG_CERCA: @@ -558,6 +555,17 @@ TDef_risoatt_msk::TDef_risoatt_msk() sdlg += h; } + for (int i = 0; i < 12; i++) + { + const short id = F_ANAL + i; + + const int pos = id2pos(id); + if (pos >= 0) + { + set_universal_handler(id); + set_universal_handler(id + 100); + } + } for (short id = S_CDC12 + 100; id >= S_CDC1 + 100; id--) { const int pos = sm.id2pos(id); @@ -570,6 +578,8 @@ TDef_risoatt_msk::TDef_risoatt_msk() s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD)); s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX); s.enable_column(id); + set_insheet_universal_handler(F_SHEET, id); + set_insheet_universal_handler(F_SHEET, id + 50); } else s.delete_column(id); diff --git a/ci/ci2100.cpp b/ci/ci2100.cpp index b4136141e..adfc72072 100755 --- a/ci/ci2100.cpp +++ b/ci/ci2100.cpp @@ -587,11 +587,8 @@ void TRilevamento_prev_msk::registra() //ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera bool TRilevamento_prev_msk::on_field_event(TOperable_field& f, TField_event e, long jolly) { - if (f.dlg() >= F_ANAL && f.dlg() <= F_ANAL+12) - { - if (e == fe_modify) - riempi_sheet(); - } + if (e == fe_modify && f.dlg() >= F_ANAL && f.dlg() < F_ANAL+12) + riempi_sheet(); switch (f.dlg()) { case DLG_DEFAULT: @@ -780,6 +777,17 @@ TRilevamento_prev_msk::TRilevamento_prev_msk() sdlg += h; } + for (int i = 0; i < 12; i++) + { + const short id = F_ANAL + i; + + const int pos = id2pos(id); + if (pos >= 0) + { + set_universal_handler(id); + set_universal_handler(id + 100); + } + } for (short id = S_CDC12 + 100; id >= S_CDC1 + 100; id--) { const int pos = sm.id2pos(id); @@ -792,6 +800,8 @@ TRilevamento_prev_msk::TRilevamento_prev_msk() s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD)); s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX); s.enable_column(id); + set_insheet_universal_handler(F_SHEET, id); + set_insheet_universal_handler(F_SHEET, id + 50); } else s.delete_column(id); diff --git a/ci/ci2200.cpp b/ci/ci2200.cpp index 14a679b93..303803f63 100755 --- a/ci/ci2200.cpp +++ b/ci/ci2200.cpp @@ -533,11 +533,8 @@ void TRilevamento_cons_msk::notify_focus_field(short id) //ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, long jolly) { - if (f.dlg() >= F_ANAL && f.dlg() <= F_ANAL+12) - { - if (e == fe_modify) - riempi_sheet(); - } + if (e == fe_modify && f.dlg() >= F_ANAL && f.dlg() < F_ANAL+12) + riempi_sheet(); switch (f.dlg()) { case DLG_DEFAULT: @@ -684,7 +681,18 @@ TRilevamento_cons_msk::TRilevamento_cons_msk() sdlg += h; } - for (short id = S_CDC12 + 100; id >= S_CDC1 + 100; id--) + for (int i = 0; i < 12; i++) + { + const short id = F_ANAL + i; + + const int pos = id2pos(id); + if (pos >= 0) + { + set_universal_handler(id); + set_universal_handler(id + 100); + } + } + for (short id = S_CDC12 + 100; id >= S_CDC1 + 100; id--) { const int pos = sm.id2pos(id); if (pos >= 0) @@ -696,7 +704,9 @@ TRilevamento_cons_msk::TRilevamento_cons_msk() s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD)); s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX); s.enable_column(id); - } + set_insheet_universal_handler(F_SHEET, id); + set_insheet_universal_handler(F_SHEET, id + 50); + } else s.delete_column(id); } diff --git a/include/automask.h b/include/automask.h index 1e96d1d8b..c51211453 100755 --- a/include/automask.h +++ b/include/automask.h @@ -27,6 +27,8 @@ protected: public: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) pure; bool error_box(const char* fmt, ...); // No more f.error_box + void set_universal_handler(const short id) { set_handler(id, universal_handler);} + void set_insheet_universal_handler(const short sid, const short id) { sfield(sid).sheet_mask().set_handler(id, insheet_universal_handler);} TAutomask() { } TAutomask(const char* name, int num = 0);