Riportate dalla vecchia 11.0 funzioni necessarie a ve per maschera handlers

git-svn-id: svn://10.65.10.50/branches/R_10_00@22645 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-04-24 10:23:05 +00:00
parent 225725bb5a
commit 12fe75b20a
4 changed files with 967 additions and 932 deletions

View File

@ -252,10 +252,38 @@ bool TConfig::remove(
{ {
const char* key = get_varkey(var, index); const char* key = get_varkey(var, index);
const bool ok = _data.remove(key); const bool ok = _data.remove(key);
if (ok) _dirty = TRUE; if (ok) _dirty = true;
return ok; return ok;
} }
// @doc EXTERNAL
// @mfunc Elimina una serie di variabili dal paragrafo corrente
//
// @rdesc Ritorna i seguenti valori:
//
// @flag TRUE | Se la variabile esiteva
// @flag FALSE | Se la variabile non esiteva
bool TConfig::remove_array(
const char* var) // @parm Nome della variabile
// @comm Viene cancellata l'aray di variabili passata in <p var>.
{
TAssoc_array & arr = list_variables();
bool ok = false;
TString80 s = var; s << '(';
FOR_EACH_ASSOC_STRING(arr, obj, key, str)
{
const TFixed_string k(key);
if (k.starts_with(s))
ok = remove(key);
}
if (ok) _dirty = true;
return ok;
}
void TConfig::remove_all() void TConfig::remove_all()
{ {
if (_data.items() > 0) if (_data.items() > 0)

View File

@ -126,6 +126,9 @@ public:
// @cmember Elimina una variabile nel paragrafo attivo // @cmember Elimina una variabile nel paragrafo attivo
bool remove(const char* var, int index = -1); bool remove(const char* var, int index = -1);
// @cmember Elimina una array di variabili nel paragrafo attivo
bool remove_array(const char* var);
// @cmember Elimina tutte le variabili nel paragrafo attivo // @cmember Elimina tutte le variabili nel paragrafo attivo
void remove_all(); void remove_all();

View File

@ -1912,6 +1912,7 @@ int TSystemisamfile::update(
{ {
if (newrec.len() == 0) if (newrec.len() == 0)
{ {
if (interactive)
error_box(FR("Il nuovo tracciato per il file %d e' vuoto"), num()); error_box(FR("Il nuovo tracciato per il file %d e' vuoto"), num());
setstatus(_istrcerr); setstatus(_istrcerr);
return status(); return status();
@ -3606,7 +3607,8 @@ char TRectype::get_char(const char* fieldname) const
bool TRectype::get_bool(const char* fieldname) const bool TRectype::get_bool(const char* fieldname) const
{ {
return get_char(fieldname) == 'X'; const char c = get_char(fieldname);
return strchr("XY1", c) != NULL;
} }
TDate TRectype::get_date(const char* fieldname) const TDate TRectype::get_date(const char* fieldname) const
@ -3618,7 +3620,7 @@ TDate TRectype::get_date(const char* fieldname) const
void TRectype::put(const char* fieldname, int val) void TRectype::put(const char* fieldname, int val)
{ {
char tmp[16]; char tmp[16];
itoa(val, tmp, 10); _itoa_s(val, tmp, 10);
put_str(fieldname, tmp); put_str(fieldname, tmp);
} }
@ -3626,7 +3628,7 @@ void TRectype::put(const char* fieldname, int val)
void TRectype::put(const char* fieldname, long val) void TRectype::put(const char* fieldname, long val)
{ {
char tmp[16]; char tmp[16];
ltoa(val, tmp, 10); _ltoa_s(val, tmp, 10);
put_str(fieldname, tmp); put_str(fieldname, tmp);
} }

View File

@ -296,6 +296,8 @@ public:
// @cmember Controlla se il campo e' abilitato di default // @cmember Controlla se il campo e' abilitato di default
bool enabled_default() const bool enabled_default() const
{ return _flags.enable_default; } { return _flags.enable_default; }
bool shown_default() const
{ return _flags.show_default; }
// @cmember Permette di rendere visibile/invisibile un campo // @cmember Permette di rendere visibile/invisibile un campo
virtual void show(bool on = true); virtual void show(bool on = true);