From 8c4b95f71ded55c6c27d53825220dba9c98d056b Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 16 Oct 2003 11:02:28 +0000 Subject: [PATCH] Patch level : 2.0 602 Files correlati : ef0.exe Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@11505 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ef/ef0300.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/ef/ef0300.cpp b/ef/ef0300.cpp index 1bbf3f3cd..f0fdc1e24 100755 --- a/ef/ef0300.cpp +++ b/ef/ef0300.cpp @@ -39,6 +39,7 @@ protected: static bool imp_sel_handler(TMask_field& f, KEY k); static bool check_handler(TMask_field& f, KEY k); static bool imp_notify(TSheet_field& s, int r, KEY key); + static bool dist_check_handler(TMask_field& f, KEY key); static bool impdist_notify(TSheet_field& s, int r, KEY key); static bool conferma_handler(TMask_field& f, KEY k); static bool annulla_handler(TMask_field& f, KEY k); @@ -404,6 +405,7 @@ bool TVariazione_distinte::user_create() _msk->set_handler(F_IMPBUTTON, importo_handler); _msk->set_handler(F_UNCONTABIL, uncontabilize_handler); righe_sheet().set_notify(impdist_notify); + righe_sheet().sheet_mask().set_handler(FIRST_FIELD, dist_check_handler); _m2->set_handler(F_IMPSEL, imp_sel_handler); _m2->set_handler(DLG_OK, conferma_handler); @@ -846,14 +848,29 @@ void TVariazione_distinte::calcola_totale() // se l'effetto è selezionato per l'eliminazione tolgo il suo importo // dal totale presentazione della distinta - if (*row.get(0) != 'X') // valido (not to delete) + if (row.get_char(0) != 'X') // valido (not to delete) { const real imp = row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO)); impdist += imp; } } m->set(F_TOTIMP, impdist); -} +} + +// Notify per il calcolo dei totali relativi alla selezione effetti +bool TVariazione_distinte::dist_check_handler(TMask_field& f, KEY key) +{ + if (key == K_SPACE) + { + TSheet_field& s = app().righe_sheet(); + TToken_string& row = s.row(s.selected()); + const bool checked = f.get().not_empty(); + row.add(checked ? "X" : "", 0); + app().calcola_totale(); + } + return TRUE; +} + // Metodo che calcola i totali relativi alla selezione effetti per la // distinta nella maschera di scelta delle riba (ef0300c) @@ -867,8 +884,7 @@ void TVariazione_distinte::calcola() for (int i = 0; i < sf.items(); i++) { TToken_string& row = sf.row(i); -// se l'effetto è selezionato aggiungo il suo importo al totale importo -// selezionato + // se l'effetto è selezionato aggiungo il suo importo al totale importo selezionato if (row.get_char(0) == 'X') { const real imp = row.get(imp_col); @@ -919,8 +935,6 @@ void TVariazione_distinte::aggiungi() // nella maschera della relap (ef0300a) bool TVariazione_distinte::impdist_notify(TSheet_field& s, int r, KEY key) { - if (s.to_check(key, TRUE)) - calcola_totale(); if (key == K_INS) { aggiungi();