diff --git a/src/include/checks.cpp b/src/include/checks.cpp index 4d494d3ae..22a627137 100755 --- a/src/include/checks.cpp +++ b/src/include/checks.cpp @@ -153,6 +153,24 @@ int noyesall_box( return r == RESP_DEFAULT ? K_YES : (r == RESP_2 ? K_NO : K_SPACE); } +// @msg custom_box | Crea una finestra di RICHIESTA con il relativo messaggio +int custom_box( + const char* fmt, // @parm Messaggio da stampare nella finestra + const char* buttons, // Bottone Sinistra + const char* buttonc, // Bottone Centro + const char* buttond, // Bottone Destra + ...) // @parmvar Uno o piu' parametri corrispondenti ai codici in
+{ + buildmsg(); + if (__batch) + { + __errors.add(msg); + return K_NO; + } + ASK_RESPONSE r = xvt_dm_post_ask(buttons, buttonc, buttond, msg); + return r == RESP_DEFAULT ? K_YES : (r == RESP_2 ? K_NO : K_SPACE); +} + // @doc EXTERNAL // @msg yesno_box | Crea una finestra di RICHIESTA con il relativo messaggio bool yesno_box( diff --git a/src/include/checks.h b/src/include/checks.h index 491eb73cc..101775011 100755 --- a/src/include/checks.h +++ b/src/include/checks.h @@ -17,6 +17,7 @@ extern "C" { bool fatal_box(const char* fmt, ...); bool noyes_box(const char* fmt, ...); int noyesall_box(const char* fmt, ...); + int custom_box(const char* fmt, const char* buttons, const char* buttonc, const char* buttond, ...); bool yesno_box(const char* fmt, ...); int yesnoall_box(const char* fmt, ...); int yesnocancel_box(const char* fmt, ...); diff --git a/src/include/config.cpp b/src/include/config.cpp index 9244d1013..ebc6d518a 100755 --- a/src/include/config.cpp +++ b/src/include/config.cpp @@ -854,6 +854,9 @@ static void cfg2file(int which_config, TFilename& file) break; case CONFIG_SSA: file = "ssa.ini"; + break; + case CONFIG_SERVICE: + file = "server/service.ini"; break; default: NFCHECK("Chi usa questo strano .ini?"); diff --git a/src/include/config.h b/src/include/config.h index 15bfed7ea..0cc0c46fb 100755 --- a/src/include/config.h +++ b/src/include/config.h @@ -29,6 +29,8 @@ class TConfig; #define CONFIG_OEM 9 // file parametri SSA (ssa.ini) #define CONFIG_SSA 10 +// file parametri CampoService (server/service.ini) +#define CONFIG_SERVICE 11 // Callback per for_each_paragraph typedef int (*CONFIG_CALLBACK)(TConfig& cfg, void* jolly); diff --git a/src/include/date.cpp b/src/include/date.cpp index 386a1602e..28192af3c 100755 --- a/src/include/date.cpp +++ b/src/include/date.cpp @@ -106,7 +106,13 @@ TDate::TDate(const char* s) TDate::TDate(int day, int month, int year) { if (day >= 1 && day <= 31 && month >= 1 && month <= 12 && year > 0) - _val = makedata(day, month, year); + { + // 01/06/07 Tolla: Se passo il giorno 31 sicuramente voglio l'ultimo! Cosė passando 31/02/xx mi torna + if(day == 31) + _val = makedata(last_day(month,year), month, year); + else + _val = makedata(day, month, year); + } else _val = NULLDATE; } diff --git a/src/include/msksheet.h b/src/include/msksheet.h index 23043d15e..06a65d0fb 100755 --- a/src/include/msksheet.h +++ b/src/include/msksheet.h @@ -305,6 +305,11 @@ public: virtual ~TSheet_field(); }; +/* FOR_EACH_SHEET_ROW(__sheet, __r, __riga) + * __sheet: variabile di tipo TSheet_field& dello sheet + * __r: numero riga + * __riga: variabile TToken_string* contenente la riga + */ #define FOR_EACH_SHEET_ROW(__sheet, __r, __riga) \ TString_array& sheetof##__riga = (__sheet).rows_array(); \ FOR_EACH_ARRAY_ROW(sheetof##__riga, __r, __riga) diff --git a/src/include/recset.cpp b/src/include/recset.cpp index 14788ee40..57fa76771 100755 --- a/src/include/recset.cpp +++ b/src/include/recset.cpp @@ -579,7 +579,11 @@ const TVariant& TRecordset::get_var(const char* name) const bool TRecordset::set_var(const char* name, const TVariant& var, bool create) { bool ok = false; - TVariant* old = (TVariant*)_var.objptr(name); + + TVariant* old = NULL; + if(_var.is_key(name)) + old = (TVariant*)_var.objptr(name); + if (old != NULL) { *old = var; diff --git a/src/include/variant.cpp b/src/include/variant.cpp index 31f093c79..f27549967 100755 --- a/src/include/variant.cpp +++ b/src/include/variant.cpp @@ -5,7 +5,7 @@ // TVariant /////////////////////////////////////////////////////////// -const TVariant NULL_VARIANT; +const TVariant NULL_VARIANT = ""; void TVariant::set_null() {