From 95f4974bddf41df006a6b34b5e68b0ffae9806e5 Mon Sep 17 00:00:00 2001 From: angelo Date: Thu, 20 Jun 1996 16:03:58 +0000 Subject: [PATCH] Modificato e reso un poco piu' veloce il ciclo sulla maschera di input. Aggiunta la disabilitazione del pulsante "Tutti" in ricerca Da-A. git-svn-id: svn://10.65.10.50/trunk@3047 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4400.cpp | 42 ++++++++++++++++++++++-------------------- cg/cg4400.h | 1 - cg/cg4400a.uml | 1 + 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index 838c23613..ba886455e 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -498,22 +498,6 @@ bool CG4400_application::is_mese_ok(int x, int month) //********* handlers *********/ -bool CG4400_application::mask_select (TMask_field& f, KEY k) -{ - if (k == K_SPACE) - { - app()._ditte->enable_check(); - // seleziona e aggiungi alle gia' selezionate - if (app()._ditte->run() == K_ENTER) - { - for (long j = 0l; j < app()._ditte->items(); j++) - app()._selected.set(j, app()._ditte->checked(j)); - app().set_choice_limits(f.mask()); - } - } - return TRUE; -} - bool CG4400_application::mask_azzera (TMask_field& f, KEY k) { if (k == K_SPACE) @@ -848,6 +832,7 @@ void CG4400_application::build_ditte_sheet() { // build sheet _ditte->destroy(); + _ditte->enable_row(-1); for (int i = 0; i < _nomiditte.items(); i++) { TToken_string* d = new TToken_string(64); @@ -874,11 +859,13 @@ bool CG4400_application::to_ditt_handler(TMask_field& f, KEY key) TMask& m = f.mask(); sh->disable_check(); + sh->disable(DLG_USER); if (sh->run() == K_ENTER) { app().select_firm_range(m.get_long(DA_CODICE),sh->row(sh->selected()).get_long(1)); app().set_choice_limits(m); } + sh->enable(DLG_USER); } if (key == K_TAB && f.focusdirty()) { @@ -898,12 +885,14 @@ bool CG4400_application::fr_ditt_handler(TMask_field& f, KEY key) TArray_sheet* sh = app().get_ditte_sheet(); sh->disable_check(); + sh->disable(DLG_USER); if (sh->run() == K_ENTER) { app().select_firm_range(sh->row(sh->selected()).get_long(1), m.get_long(A_CODICE)); app().set_choice_limits(m); } - } + sh->enable(DLG_USER); + } else if (key == K_TAB && f.focusdirty()) { const long l = app().select_firm_range(m.get_long(DA_CODICE), m.get_long(A_CODICE)); @@ -1004,8 +993,22 @@ bool CG4400_application::set_ditte(TMask& m) m.field(A_DATA).set(""); m.field(CODICE_LIBRO_PROVA).set(""); - KEY tasto; - tasto = m.run(); + KEY tasto; + do + { + tasto = m.run(); + if (tasto == DLG_SELECT) + { + _ditte->enable_check(); + // seleziona e aggiungi alle gia' selezionate + if (_ditte->run() == K_ENTER) + { + for (long j = 0l; j < _ditte->items(); j++) + _selected.set(j, _ditte->checked(j)); + set_choice_limits(m); + } + } + } while (tasto != K_ENTER && tasto != K_QUIT); // m.first_focus(tasto); return tasto == K_ENTER; } @@ -3241,7 +3244,6 @@ bool CG4400_application::set_print(int n) m.set_handler (FINO_A_MESE, mask_mese); m.set_handler (CODICE_LIB_UN, mask_cod); m.set_handler (CODICE_LIBRO_IVA, mask_libun); - m.set_handler (DLG_SELECT, mask_select); m.set_handler (F_ANNULLA, mask_azzera); m.set_handler (A_CODICE, to_ditt_handler); m.set_handler (DA_CODICE, fr_ditt_handler); diff --git a/cg/cg4400.h b/cg/cg4400.h index d87f32df5..012f32a86 100755 --- a/cg/cg4400.h +++ b/cg/cg4400.h @@ -83,7 +83,6 @@ protected: static bool mask_data (TMask_field&, KEY); static bool mask_mese (TMask_field&, KEY); static bool mask_fino_a_mese (TMask_field&, KEY); - static bool mask_select (TMask_field&, KEY); static bool mask_azzera (TMask_field&, KEY); static bool year_handler (TMask_field&, KEY); diff --git a/cg/cg4400a.uml b/cg/cg4400a.uml index b71ca615f..63e8e9a69 100755 --- a/cg/cg4400a.uml +++ b/cg/cg4400a.uml @@ -58,6 +58,7 @@ BUTTON DLG_SELECT 10 2 BEGIN PROMPT 41 3 "~Selezione" HELP "Indicare le ditte da selezionare per la stampa" + MESSAGE EXIT, DLG_SELECT END BUTTON F_ANNULLA 10