From 3c9e5b7de57b30bfb08d35bd13a912365044637a Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 13 Feb 1995 17:21:25 +0000 Subject: [PATCH] Corretta selezione iniziale degli array sheet git-svn-id: svn://10.65.10.50/trunk@993 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/mask.cpp | 6 +++--- include/maskfld.cpp | 12 ++++++++++-- include/sheet.cpp | 10 ++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/mask.cpp b/include/mask.cpp index 4841458bc..51c61dddc 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -200,6 +200,7 @@ void TMask::read_mask(const char* name, int num, int max) _source_file = name; _source_file.ext(MASK_EXT); + _source_file.lower(); TScanner scanner(_source_file); _sheetmask = num > 0; @@ -1182,11 +1183,10 @@ void TMask::on_firm_change() for (int i = 0; i < fields(); i++) { TMask_field& f = fld(i); - if (f._flags.firm) + if (f._flags.firm && f.get() != firm) { f.set(firm); - f.check(STARTING_CHECK); - f.on_hit(); + f.on_key(K_TAB); // f.check(STARTING_CHECK); f.on_hit(); } } } diff --git a/include/maskfld.cpp b/include/maskfld.cpp index d966b165d..202b912f8 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -1,4 +1,4 @@ -// $Id: maskfld.cpp,v 1.78 1995-02-10 17:42:23 guy Exp $ +// $Id: maskfld.cpp,v 1.79 1995-02-13 17:21:17 guy Exp $ #include #include @@ -2592,8 +2592,16 @@ bool TReal_field::on_key(KEY key) const char* n = get(); if (*n && !real::is_real(n)) return error_box("Valore numerico non valido"); - if (_flags.uppercase && real(n).sign() < 0) + if (_flags.uppercase && *n == '-') return error_box("Il numero deve essere positivo"); + if (_flags.firm) + { + const long f = atol(n); + if (!prefhndl->exist(f)) + return error_box("Ditta non utilizzabile in contabilita'"); + else + main_app().set_firm(f); + } } } diff --git a/include/sheet.cpp b/include/sheet.cpp index be1491baa..b5460a15e 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -137,7 +137,7 @@ void TSheet::open() if (buttons_on()) { // Abilita selezione se c'e' almeno un elemento - xvt_enable_control(_button[0], items() > 0); + xvt_enable_control(_button[0], items() > 0 && _disabled.ones() < items()); repos_buttons(); } TScroll_window::open(); @@ -273,8 +273,8 @@ bool TSheet::on_key(KEY key) switch(key) { case K_ENTER: - if (items() < 1) key = K_ESC; - if (_disabled[selected()]) + if (items() == 0) key = K_ESC; + if (selected() < 0 || _disabled[selected()]) break; case K_ESC: stop_run(key); @@ -613,7 +613,9 @@ void TSheet::print() TArray_sheet::TArray_sheet(short x, short y, short dx, short dy, const char* caption, const char* head, byte buttons, WINDOW parent) : TSheet(x, y, dx, dy, caption, head, buttons, 0L, parent) -{} +{ + select(0); +} bool TArray_sheet::destroy(int i) {