git-svn-id: svn://10.65.10.50/branches/R_10_00@22936 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a0c6d081f1
commit
83117591a5
@ -21,7 +21,7 @@ po Penna Ottica
|
||||
ab Analisi di bilancio
|
||||
?? Modulo vario ex-gv Gestione versamenti F24
|
||||
ca Contabilità Analitica
|
||||
?? Modulo vario ex-vd Vendita al dettaglio
|
||||
sl Stato Avanzamento Lavori
|
||||
ic IVA per cassa
|
||||
pe Preventivazione
|
||||
ep Effetti Passivi
|
||||
|
@ -194,7 +194,7 @@ void TConfig_application::do_config(int m)
|
||||
|
||||
void TConfig_application::on_firm_change()
|
||||
{
|
||||
((TConfig_application *)this)->save_mask(FALSE);
|
||||
((TConfig_application *)this)->save_mask(false);
|
||||
load_config();
|
||||
load_mask();
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ const real & TExpression::as_real()
|
||||
{
|
||||
if (user_func_dirty() || _dirty)
|
||||
eval();
|
||||
_dirty = FALSE;
|
||||
_dirty = false;
|
||||
return _val.number();
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ const TString & TExpression::as_string()
|
||||
{
|
||||
if (user_func_dirty() || _dirty)
|
||||
eval();
|
||||
_dirty = FALSE;
|
||||
_dirty = false;
|
||||
return _val.string();
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,7 @@ public:
|
||||
// @cmember Ritorna l'espressione originale
|
||||
const char * string() const { return _original; }
|
||||
// @cmember Ritorna eventuali errori
|
||||
int error() {return _error;}
|
||||
int error() const { return _error; }
|
||||
|
||||
// @cmember Costruttore (assegna l'estressione e il suo tipo)
|
||||
TExpression(const char* expression, TTypeexp type = _numexpr, bool ignore_err=FALSE);
|
||||
|
@ -1046,7 +1046,7 @@ bool TForm_string::parse_item(TScanner& scanner)
|
||||
bool TForm_string::set(const char* s)
|
||||
{
|
||||
_str = s;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* TForm_string::get() const
|
||||
@ -1063,7 +1063,7 @@ bool TForm_string::read()
|
||||
{
|
||||
const char* s = "";
|
||||
// !?!?!?!!
|
||||
const TRelation* r = (TRelation*)form().relation();
|
||||
const TRelation* r = form().relation();
|
||||
CHECK(r, "Can't read from null relation");
|
||||
for (int i = 0; i < _field.items() && *s == '\0'; i++)
|
||||
s = field(i).read(*r);
|
||||
|
@ -4038,8 +4038,8 @@ bool TRectype::edit(int logicnum, const char* alternate_key_fields, const char*
|
||||
|
||||
if (ok)
|
||||
{
|
||||
TConfig ini(ininame, "Transaction");
|
||||
const TString& result = ini.get("Result");
|
||||
xvt_sys_sleep(500);
|
||||
const TString& result = ini_get_string(ininame, "Transaction", "Result");
|
||||
ok = result == "OK";
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,10 @@ void TMask::read_mask(
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
while (scanner.ok())
|
||||
if (scanner.line() == "ENDMASK") break;
|
||||
{
|
||||
if (scanner.line().starts_with("ENDMASK"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
init_mask();
|
||||
@ -666,13 +669,16 @@ int TMask::id2pos(
|
||||
|
||||
TMask_field& TMask::field(short id) const
|
||||
{
|
||||
int pos = id2pos(id);
|
||||
if (pos < 0)
|
||||
TMask_field* f = find_by_id(id);
|
||||
if (f == NULL)
|
||||
{
|
||||
yesnofatal_box("Non esiste il campo %d sulla maschera %s", id, (const char*)_source_file);
|
||||
pos = 0;
|
||||
if (_mask_num == 0)
|
||||
yesnofatal_box("Non esiste il campo %d sulla maschera %s", id, (const char*)_source_file);
|
||||
else
|
||||
yesnofatal_box("Non esiste il campo %d della griglia %d sulla maschera %s ", id, _mask_num, (const char*)_source_file);
|
||||
f = &((TMask*)this)->add_string(id, 0, "???", 1, id%100, 20, "D"); // Creo un campo anti-errore bloccante
|
||||
}
|
||||
return fld(pos);
|
||||
return *f;
|
||||
}
|
||||
|
||||
int TMask::field2pos(const char* fieldname) const
|
||||
@ -695,6 +701,11 @@ int TMask::field2pos(const char* fieldname) const
|
||||
|
||||
TMask_field* TMask::find_by_id(short id) const
|
||||
{
|
||||
if (id < DLG_NULL)
|
||||
{
|
||||
const TSheet_field* s = get_sheet();
|
||||
return s ? s->mask().find_by_id(-id) : NULL;
|
||||
}
|
||||
const int i = id2pos(id);
|
||||
return i >= 0 ? &fld(i) : NULL;
|
||||
}
|
||||
@ -1664,7 +1675,7 @@ void TMask::set(short fld_id, long n, byte hit)
|
||||
|
||||
void TMask::set(short fld_id, const real& n, byte hit)
|
||||
{
|
||||
CHECK(id2pos(fld_id) < 0 || field(fld_id).is_edit(), "Can't set a real value in a non edit field");
|
||||
CHECK(efield(fld_id).is_edit(), "Can't set a real value in a non edit field");
|
||||
set(fld_id, n.string(), hit);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ public:
|
||||
// @cmember Setta il campo con un currency
|
||||
void set(short fld_id, const TCurrency& num, byte hit=0x0);
|
||||
// @cmember Setta una tutti i campi che hanno come FIELD <p fld_id>
|
||||
void set(const char * fld_id, const char * str, byte hit=0x0);
|
||||
void set(const char* fld_id, const char* str, byte hit=0x0);
|
||||
// @cmember Ritorna il contenuto del campo <p fld_id> sotto forma di stringa
|
||||
|
||||
virtual const TString& get(short fld_id) const;
|
||||
@ -395,7 +395,7 @@ public:
|
||||
// @cmember Azzera il campo
|
||||
void reset(short fld_id = 0);
|
||||
// @cmember Azzera il campo
|
||||
void reset(const char * fld_id) {set(fld_id, "");}
|
||||
void reset(const char* fld_id) { set(fld_id, ""); }
|
||||
|
||||
// @cmember Legge, dalla relazione <p TRelation>, i valori del campo con specifica FIELD
|
||||
virtual void autoload(const TRelation& r);
|
||||
|
@ -903,9 +903,8 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
}
|
||||
else
|
||||
{
|
||||
TProgind pi(size, strpi, true, true);
|
||||
pi.set_caption(TR("Trasferimento in corso..."));
|
||||
while (!cur_socket->eof() && !pi.iscancelled())
|
||||
TProgress_monitor pi(size, strpi);
|
||||
while (!cur_socket->eof())
|
||||
{
|
||||
const int nchars = min(buf.size(), size - total);
|
||||
cur_socket->read(buf.get_buffer(), nchars);
|
||||
|
@ -335,15 +335,24 @@ bool TProgress_monitor::set_status(long n)
|
||||
{
|
||||
_pi = new TProgind(_total, _txt, _cancellable);
|
||||
_pi->set_start_time(_start);
|
||||
end_wait();
|
||||
}
|
||||
// Aggiorna la TProgind associata, sempre che esista
|
||||
_status = min(n, _total);
|
||||
return _pi == NULL || _pi->setstatus(_status);
|
||||
}
|
||||
|
||||
void TProgress_monitor::set_text(const char* msg)
|
||||
{
|
||||
_txt = msg;
|
||||
if (_pi != NULL)
|
||||
_pi->set_text(_txt);
|
||||
}
|
||||
|
||||
TProgress_monitor::TProgress_monitor(long items, const char* txt, bool cancancel)
|
||||
: _total(items), _txt(txt), _status(0), _cancellable(cancancel), _pi(NULL), _start(clock())
|
||||
{
|
||||
begin_wait();
|
||||
}
|
||||
|
||||
TProgress_monitor::~TProgress_monitor()
|
||||
@ -351,6 +360,8 @@ TProgress_monitor::~TProgress_monitor()
|
||||
// Distruggi la TProgind o la clessidra, a seconda del caso
|
||||
if (_pi != NULL)
|
||||
delete _pi;
|
||||
else
|
||||
end_wait();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -174,6 +174,7 @@ class TProgress_monitor : public TObject
|
||||
public:
|
||||
virtual bool set_status(long n);
|
||||
bool add_status(long i = 1) { return set_status(_status+i); }
|
||||
void set_text(const char* msg);
|
||||
|
||||
// deprecated TProgind compatibility methods
|
||||
bool setstatus(long n) { return set_status(n); }
|
||||
|
@ -67,6 +67,8 @@
|
||||
#define RDOC_CODAGG2 "CODAGG2"
|
||||
#define RDOC_PRIORITY "PRIORITY"
|
||||
#define RDOC_TIPODET "TIPODET"
|
||||
#define RDOC_TIPOCOLL "TIPOCOLL"
|
||||
#define RDOC_IDRIGACOLL "IDRIGACOLL"
|
||||
|
||||
// campi virtuali
|
||||
#define RDOC_LEVEL "LEVEL"
|
||||
|
@ -1692,7 +1692,7 @@ void TGeneric_distrib::add(real slice)
|
||||
_slices.add (slice);
|
||||
}
|
||||
|
||||
real TGeneric_distrib::get ()
|
||||
real TGeneric_distrib::get()
|
||||
{
|
||||
_ready = true;
|
||||
CHECK (_current < _slices.items(), "TGeneric_distrib: too many gets");
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <codeb.h>
|
||||
#include <colors.h>
|
||||
#include <dongle.h>
|
||||
#include <expr.h>
|
||||
#include <modaut.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
@ -557,11 +558,11 @@ const TVariant& TRecordset::get_var(const char* name) const
|
||||
if (var == NULL && *name == '#')
|
||||
{
|
||||
const TFixed_string n(name);
|
||||
// Se mi accorgo che posso e voglio accedere ad un campo del recordset padre
|
||||
// Se mi accorgo che posso e voglio accedere ad un campo del recordset padre
|
||||
if (_parentset != NULL && n.starts_with("#PARENT."))
|
||||
var = &_parentset->get(name+8); // Attenzione! E' giusto usare get() e non get_var()
|
||||
else
|
||||
{
|
||||
{
|
||||
if (n.starts_with("#RECORD."))
|
||||
{
|
||||
const TFixed_string fn(name + 8);
|
||||
@ -599,8 +600,8 @@ bool TRecordset::set_var(const char* name, const TVariant& var, bool create)
|
||||
}
|
||||
else
|
||||
{
|
||||
_var.add(name, var);
|
||||
_varnames.add(name);
|
||||
_var.add(name, var);
|
||||
_varnames.add(name);
|
||||
}
|
||||
ok = true;
|
||||
}
|
||||
@ -924,7 +925,7 @@ protected:
|
||||
void parse_sortexpr(TToken_string& se);
|
||||
void parse_filter(TToken_string& filter);
|
||||
void parse_select(TToken_string& filter);
|
||||
void parse_region(TRectype& rec);
|
||||
void parse_region(TRectype& rec, bool final);
|
||||
void parse_join_param(TRelation* rel, const TString& j, int to);
|
||||
void parse_join();
|
||||
void parse_sortedjoin();
|
||||
@ -1063,10 +1064,10 @@ void TCursor_parser::parse_select(TToken_string& filter)
|
||||
}
|
||||
|
||||
|
||||
void TCursor_parser::parse_region(TRectype& rec)
|
||||
void TCursor_parser::parse_region(TRectype& rec, bool final)
|
||||
{
|
||||
TString16 field;
|
||||
TString80 value;
|
||||
TString256 value;
|
||||
while (true)
|
||||
{
|
||||
const TString& ass = pop();
|
||||
@ -1076,11 +1077,42 @@ void TCursor_parser::parse_region(TRectype& rec)
|
||||
field = ass.left(equal);
|
||||
value = ass.mid(equal+1);
|
||||
value.trim();
|
||||
|
||||
const bool tilde = value[0] == '=';
|
||||
if (tilde)
|
||||
value.ltrim(1);
|
||||
|
||||
if (value[0] == '"' || value[0] == '\'')
|
||||
{
|
||||
int fr = -1, to = -1;
|
||||
if (value.ends_with("]"))
|
||||
{
|
||||
const int pa = value.rfind('[');
|
||||
if (pa > 0 && value[pa-1] == value[0])
|
||||
{
|
||||
TToken_string range(value.mid(pa+1), ',');
|
||||
fr = range.get_int()-1;
|
||||
to = range.get_int();
|
||||
value.cut(pa);
|
||||
}
|
||||
}
|
||||
value.rtrim(1);
|
||||
value.ltrim(1);
|
||||
if (fr >= 0)
|
||||
value = value.sub(fr, to);
|
||||
} else
|
||||
if (value.find('(') > 0)
|
||||
{
|
||||
TExpression expr(value, _strexpr, true);
|
||||
const TString& str = expr.as_string();
|
||||
if (expr.error() == 0)
|
||||
{
|
||||
value = str;
|
||||
value.trim();
|
||||
}
|
||||
}
|
||||
if (tilde && final)
|
||||
value << '~';
|
||||
rec.put(field, value);
|
||||
}
|
||||
else
|
||||
@ -1355,9 +1387,9 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
||||
{
|
||||
pop();
|
||||
if (tok.starts_with("FR"))
|
||||
parse_region(rec_start); else
|
||||
parse_region(rec_start, false); else
|
||||
if (tok.starts_with("TO"))
|
||||
parse_region(rec_stop); else
|
||||
parse_region(rec_stop, true); else
|
||||
if (tok.starts_with("JO"))
|
||||
parse_join(); else
|
||||
if (tok.starts_with("SO"))
|
||||
|
@ -398,10 +398,10 @@ bool TRelation_application::autonum(
|
||||
if (!get_next_key(k))
|
||||
{
|
||||
k = get_next_key();
|
||||
/*
|
||||
if (k.not_empty())
|
||||
NFCHECK("La 'const char* get_next_key()' verra' sostituita dalla 'bool get_next_key(TToken_string&)'");
|
||||
*/
|
||||
#ifdef DBG
|
||||
if (k.full())
|
||||
NFCHECK("'const char* get_next_key()' is deprecated: implement 'bool get_next_key(TToken_string&)'");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!rec && !m->query_mode())
|
||||
@ -410,18 +410,27 @@ bool TRelation_application::autonum(
|
||||
|
||||
for (const char* n = k.get(0); n && *n; n = k.get())
|
||||
{
|
||||
const short id = atoi(n);
|
||||
CHECKD (id > 0 && m->id2pos(id) >= 0, "Identificatore di autonumerazione errato: ", id);
|
||||
TMask_field* fld = NULL;
|
||||
if (isdigit(*n))
|
||||
fld = m->find_by_id(atoi(n));
|
||||
else
|
||||
fld = m->find_by_fieldname(n);
|
||||
if (fld == NULL)
|
||||
{
|
||||
NFCHECK("Identificatore di autonumerazione errato");
|
||||
return false;
|
||||
}
|
||||
const char* val = k.get();
|
||||
TMask_field& f = m->field(id);
|
||||
TMask_field& f = *fld;
|
||||
if (rec || f.empty())
|
||||
f.set(val);
|
||||
if (rec)
|
||||
((TEditable_field&)f).autosave(*get_relation());
|
||||
if (_renum_message.empty() || f.in_key(1))
|
||||
_renum_message.format("L'elemento è stato registrato con :\n %s = %s", (const char*)f.prompt(), (const char*)f.get());
|
||||
_renum_message.format(FR("L'elemento è stato registrato con:\n %s = %s"),
|
||||
(const char*)f.prompt(), (const char*)f.get());
|
||||
}
|
||||
return k.not_empty();
|
||||
return k.full();
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
@ -1107,17 +1116,17 @@ bool TRelation_application::save(bool check_dirty)
|
||||
err = write(*_mask);
|
||||
if (err == _isreinsert)
|
||||
{
|
||||
changed = autonum(_mask, TRUE);
|
||||
changed = autonum(_mask, true);
|
||||
if (!changed)
|
||||
{
|
||||
_mask->disable_starting_check();
|
||||
enable_query(); // Abilita chiave 1 per rinumerazione manuale
|
||||
}
|
||||
else
|
||||
changed_key = TRUE;
|
||||
changed_key = true;
|
||||
}
|
||||
else
|
||||
changed = FALSE;
|
||||
changed = false;
|
||||
}
|
||||
if (err == NOERR)
|
||||
{
|
||||
|
@ -2490,7 +2490,14 @@ void TFieldref::write(const char* val, TRelation& r) const
|
||||
|
||||
void TFieldref::write(const char* val, TRectype& rec) const
|
||||
{
|
||||
if (_fileid >= CNF_GENERAL) return;
|
||||
if (_fileid >= CNF_GENERAL)
|
||||
return;
|
||||
|
||||
if (_name.find(':') > 0)
|
||||
{
|
||||
TRecfield rf(rec, _name, _from, _to-1);
|
||||
rf = val;
|
||||
} else
|
||||
if (_from > 0 || _to > 0)
|
||||
{
|
||||
buffer = rec.get(_name);
|
||||
|
@ -22,7 +22,7 @@ TScanner::TScanner(const char* filename)
|
||||
msg << "Impossibile leggere il file '" << filename << "'\n"
|
||||
<< "Directory corrente '" << curdir << "'\n";
|
||||
if (xvt_fsys_file_exists(filename))
|
||||
msg << "Il file esite ma NON e' leggibile!";
|
||||
msg << "Il file esite ma NON è leggibile!";
|
||||
else
|
||||
msg << "Il file NON esite!";
|
||||
fatal_box(msg);
|
||||
|
@ -80,7 +80,13 @@ void TField_window::update()
|
||||
xi_draw_3d_rect((XinWindow)pa, (XinRect*)&rct, TRUE, 2,
|
||||
MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR);
|
||||
}
|
||||
xvt_dwin_clear(me, NORMAL_BACK_COLOR);
|
||||
if (ADVANCED_GRAPHICS)
|
||||
{
|
||||
RCT rct; xvt_vobj_get_client_rect(me, &rct);
|
||||
xvt_dwin_draw_gradient_linear(me, &rct, NORMAL_BACK_COLOR, DISABLED_BACK_COLOR, 90);
|
||||
}
|
||||
else
|
||||
xvt_dwin_clear(me, NORMAL_BACK_COLOR);
|
||||
set_font();
|
||||
}
|
||||
|
||||
|
@ -121,22 +121,45 @@ void TVariable_field::zero()
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
TVariable_rectype::TVariable_rectype(int logicnum)
|
||||
: TRectype(logicnum), _memo_fld_to_load(false)
|
||||
{}
|
||||
: TRectype(logicnum), _memo_fld_to_load(false)
|
||||
{
|
||||
switch (logicnum)
|
||||
{
|
||||
case LF_DOC : set_memo_fld("G1"); break;
|
||||
case LF_RIGHEDOC: set_memo_fld("RG1"); break;
|
||||
default : break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TVariable_rectype::TVariable_rectype(const TBaseisamfile* i)
|
||||
: TRectype(i), _memo_fld_to_load(false)
|
||||
{}
|
||||
: TRectype(i), _memo_fld_to_load(false)
|
||||
{
|
||||
switch (i->num())
|
||||
{
|
||||
case LF_DOC : set_memo_fld("G1"); break;
|
||||
case LF_RIGHEDOC: set_memo_fld("RG1"); break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
TVariable_rectype::TVariable_rectype(const TRectype& r)
|
||||
: TRectype(r), _memo_fld_to_load(false)
|
||||
{}
|
||||
{
|
||||
switch (r.num())
|
||||
{
|
||||
case LF_DOC : set_memo_fld("G1"); _memo_fld_to_load = !r.empty(); break;
|
||||
case LF_RIGHEDOC: set_memo_fld("RG1"); _memo_fld_to_load = !r.empty(); break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
TVariable_rectype::TVariable_rectype(const TVariable_rectype& r)
|
||||
: TRectype((const TRectype &) r), _memo_fld_to_load(false)
|
||||
{
|
||||
_virtual_fields = r._virtual_fields;
|
||||
set_memo_fld(r._memo_fld);
|
||||
_memo_fld_to_load = !r.empty(); // novità del 23-04-2014
|
||||
}
|
||||
|
||||
void TVariable_rectype::unknown_field(const char* name) const
|
||||
@ -191,7 +214,7 @@ void TVariable_rectype::set_variables(TExpression * e) const
|
||||
e->setvar(i, get(e->varname(i)));
|
||||
}
|
||||
|
||||
void TVariable_rectype::set_memo_fld( const char * fieldname)
|
||||
void TVariable_rectype::set_memo_fld(const char* fieldname)
|
||||
{
|
||||
if (fieldname && *fieldname && type(fieldname) == _memofld)
|
||||
_memo_fld = fieldname;
|
||||
|
Loading…
x
Reference in New Issue
Block a user