From a18564a49adbd1b29eb0f586585b6d95c0ac92d4 Mon Sep 17 00:00:00 2001 From: angelo Date: Thu, 21 Sep 1995 16:43:03 +0000 Subject: [PATCH] Sistemato l'aggiornamento dello sheet degli indirizzi di spedizione: tolto dall'handler() e messo nella notify(). git-svn-id: svn://10.65.10.50/trunk@1873 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg0200.cpp | 53 +++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/cg/cg0200.cpp b/cg/cg0200.cpp index 428708620..cf2debd35 100755 --- a/cg/cg0200.cpp +++ b/cg/cg0200.cpp @@ -48,7 +48,7 @@ protected: //////////// static bool indsp_notify(TSheet_field& s, int r, KEY key); - static bool indsp_handler(TMask_field& f, KEY key) ; + static void indsp_sheet_rebuilder(); virtual int write(const TMask& m); virtual int rewrite(const TMask& m); virtual int read(TMask& m); @@ -522,35 +522,25 @@ void TClifo_application::common_f(const TMask& m) } } } - -bool TClifo_application::indsp_handler(TMask_field& f, KEY key) +void TClifo_application::indsp_sheet_rebuilder() { - static int first_time=1; - - if (key == K_TAB && f.dirty()) // Was it changed ? - if (first_time) - { - TArray& righe=app().indsp_sheet().rows_array(); - int n=righe.items(); - app().reset_sheet(); - // Rebuild Sheets - for (int i=0; iadd(rigav); - app().field_sheet(F_CODINDSP)->add(rigav); - app().field_sheet(F_CODINDEFF)->add(rigav); - } - first_time=0; - } else - first_time=1; - return TRUE; + TArray& righe=app().indsp_sheet().rows_array(); + const int n=righe.items(); + app().reset_sheet(); + // Rebuild Sheets + for (int i=0; iadd(rigav); + app().field_sheet(F_CODINDSP)->add(rigav); + app().field_sheet(F_CODINDEFF)->add(rigav); + } } bool TClifo_application::indsp_notify(TSheet_field& indsp, int r, KEY key) @@ -579,7 +569,9 @@ bool TClifo_application::indsp_notify(TSheet_field& indsp, int r, KEY key) break; default: break; -} +} + if (key == K_ENTER || key == K_DEL) + indsp_sheet_rebuilder(); return TRUE; } @@ -608,7 +600,6 @@ bool TClifo_application::user_create() // initvar e arrmask _msk->set_handler(F_CODALLEG, codalleg_handler); if (!_ignoreven) { - _msk->set_handler(F_SHEET_G_VEN, indsp_handler); TSheet_field& ind = (TSheet_field&) _msk->field(F_SHEET_G_VEN); ind.set_notify(indsp_notify); }