Patch level : 4.0 905
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 patch 1092 git-svn-id: svn://10.65.10.50/trunk@16352 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
88f78c69b0
commit
8e9fb3fce8
@ -71,11 +71,11 @@ TInfo_mask::TInfo_mask()
|
|||||||
|
|
||||||
int year = 2007, release = 3, tag = 1, patch = 1;
|
int year = 2007, release = 3, tag = 1, patch = 1;
|
||||||
TString16 versione = "2007.03";
|
TString16 versione = "2007.03";
|
||||||
TString16 strpatch = "01.001";
|
TString16 strpatch = "01.0001";
|
||||||
if (main_app().get_version_info(year, release, tag, patch))
|
if (main_app().get_version_info(year, release, tag, patch))
|
||||||
{
|
{
|
||||||
versione.format("%d.%02d", year, release);
|
versione.format("%d.%02d", year, release);
|
||||||
strpatch.format("%02d.%03d", tag, patch);
|
strpatch.format("%02d.%04d", tag, patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
TString arg;
|
TString arg;
|
||||||
@ -665,7 +665,7 @@ void TApplication::run(
|
|||||||
|
|
||||||
bool TApplication::get_version_info(int& year, int& release, int& tag, int& patch)
|
bool TApplication::get_version_info(int& year, int& release, int& tag, int& patch)
|
||||||
{
|
{
|
||||||
const char* const VERSIONANDPATCH = "Don't cry for me Argentina.2006.02.02.000.2010";
|
const char* const VERSIONANDPATCH = "Don't cry for me Argentina.2007.03.01.0001.2012";
|
||||||
|
|
||||||
TToken_string vep(VERSIONANDPATCH, '.');
|
TToken_string vep(VERSIONANDPATCH, '.');
|
||||||
year = vep.get_int(1);
|
year = vep.get_int(1);
|
||||||
@ -674,7 +674,7 @@ bool TApplication::get_version_info(int& year, int& release, int& tag, int& patc
|
|||||||
patch = vep.get_int();
|
patch = vep.get_int();
|
||||||
int checksum = vep.get_int();
|
int checksum = vep.get_int();
|
||||||
|
|
||||||
bool valid = year >= 2006 && release > 0 && tag >= 0 && patch >= 0 &&
|
bool valid = year >= 2007 && release > 0 && tag >= 0 && patch >= 0 &&
|
||||||
checksum == (year + release + tag + patch);
|
checksum == (year + release + tag + patch);
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
@ -729,7 +729,7 @@ bool TApplication::has_module(int module, int checktype) const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Testa bit di attivazione dell'utente
|
// Testa bit di attivazione dell'utente
|
||||||
if (ok && checktype != CHK_DONGLE)
|
if (ok && checktype != CHK_DONGLE && module != EEAUT)
|
||||||
ok = _user_aut[module];
|
ok = _user_aut[module];
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -102,10 +102,10 @@ public:
|
|||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
// @cmember Aggiunge un oggetto. Se era gia' presente guarda il parametro force
|
// @cmember Aggiunge un oggetto. Se era gia' presente guarda il parametro force
|
||||||
bool add(const char* key, TObject* obj = NULL, bool force = FALSE);
|
bool add(const char* key, TObject* obj = NULL, bool force = false);
|
||||||
|
|
||||||
// @cmember Aggiunge una copia dell'oggetto
|
// @cmember Aggiunge una copia dell'oggetto
|
||||||
bool add(const char* key, const TObject& obj, bool force = FALSE);
|
bool add(const char* key, const TObject& obj, bool force = false);
|
||||||
|
|
||||||
// @cmember Elimina un oggetto
|
// @cmember Elimina un oggetto
|
||||||
bool remove(const char* key);
|
bool remove(const char* key);
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#define ATT_ATTLAVDIP "ATTLAVDIP"
|
#define ATT_ATTLAVDIP "ATTLAVDIP"
|
||||||
#define ATT_ART74_4 "ART74_4"
|
#define ATT_ART74_4 "ART74_4"
|
||||||
#define ATT_TIPOATT "TIPOATT"
|
#define ATT_TIPOATT "TIPOATT"
|
||||||
|
#define ATT_CODATECO "CODATECO"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ BEGIN
|
|||||||
PROMPT -15 -1 "~PDF"
|
PROMPT -15 -1 "~PDF"
|
||||||
PICTURE BMP_PDF
|
PICTURE BMP_PDF
|
||||||
MESSAGE EXIT,80
|
MESSAGE EXIT,80
|
||||||
FLAGS "D"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_ARCHIVE 10 2
|
BUTTON DLG_ARCHIVE 10 2
|
||||||
@ -31,7 +30,6 @@ BEGIN
|
|||||||
PROMPT -25 -1 "~Archivia"
|
PROMPT -25 -1 "~Archivia"
|
||||||
PICTURE BMP_ARCHIVE
|
PICTURE BMP_ARCHIVE
|
||||||
MESSAGE EXIT,65
|
MESSAGE EXIT,65
|
||||||
FLAGS "D"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_EDIT 10 2
|
BUTTON DLG_EDIT 10 2
|
||||||
@ -46,7 +44,6 @@ BEGIN
|
|||||||
PROMPT -45 -1 "~Mail"
|
PROMPT -45 -1 "~Mail"
|
||||||
PICTURE BMP_EMAIL
|
PICTURE BMP_EMAIL
|
||||||
MESSAGE EXIT,77
|
MESSAGE EXIT,77
|
||||||
FLAGS "DH"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 10 2
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#define CLI_FAX "FAX"
|
#define CLI_FAX "FAX"
|
||||||
#define CLI_PTELEX "PTELEX"
|
#define CLI_PTELEX "PTELEX"
|
||||||
#define CLI_TELEX "TELEX"
|
#define CLI_TELEX "TELEX"
|
||||||
|
#define CLI_BYMAIL "BYMAIL"
|
||||||
|
#define CLI_DOCMAIL "DOCMAIL"
|
||||||
#define CLI_MAIL "MAIL"
|
#define CLI_MAIL "MAIL"
|
||||||
#define CLI_DATANASC "DATANASC"
|
#define CLI_DATANASC "DATANASC"
|
||||||
#define CLI_STATONASC "STATONASC"
|
#define CLI_STATONASC "STATONASC"
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
#include <colmask.h>
|
#include <colmask.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <diction.h>
|
||||||
|
|
||||||
COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue)
|
COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue)
|
||||||
{
|
{
|
||||||
COLOR def = XVT_MAKE_COLOR(red, green, blue);
|
COLOR def = XVT_MAKE_COLOR(red, green, blue);
|
||||||
|
|
||||||
|
#ifndef DBG
|
||||||
// Se nel colore non compare l'indice cerca di calcolarlo
|
// Se nel colore non compare l'indice cerca di calcolarlo
|
||||||
const unsigned char color_index = (unsigned char)(def >> 12);
|
const unsigned char color_index = (unsigned char)(def >> 12);
|
||||||
if (color_index <= 0x0 || color_index > 0xF)
|
if (color_index <= 0x0 || color_index > 0xF)
|
||||||
@ -24,6 +26,7 @@ COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
@ -191,7 +194,7 @@ bool TSelect_color_mask::color_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool TSelect_color_mask::reset_handler(TMask_field& f, KEY k)
|
bool TSelect_color_mask::reset_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_SPACE && f.yesno_box("Si desidera azzerare tutti i colori?"))
|
if (k == K_SPACE && f.yesno_box(TR("Si desidera azzerare tutti i colori?")))
|
||||||
{
|
{
|
||||||
TSelect_color_mask& cm = (TSelect_color_mask&)f.mask();
|
TSelect_color_mask& cm = (TSelect_color_mask&)f.mask();
|
||||||
TSheet_field& s = cm.sfield(101);
|
TSheet_field& s = cm.sfield(101);
|
||||||
|
@ -19,7 +19,7 @@ extern "C"
|
|||||||
|
|
||||||
#include <statbar.h>
|
#include <statbar.h>
|
||||||
|
|
||||||
COLOR MASK_BACK_COLOR = MAKE_COLOR(201,194,188); // COLOR_LTGRAY;
|
COLOR MASK_BACK_COLOR = XVT_MAKE_COLOR(201,194,188); // COLOR_LTGRAY;
|
||||||
COLOR MASK_LIGHT_COLOR = COLOR_WHITE;
|
COLOR MASK_LIGHT_COLOR = COLOR_WHITE;
|
||||||
COLOR MASK_DARK_COLOR = COLOR_GRAY;
|
COLOR MASK_DARK_COLOR = COLOR_GRAY;
|
||||||
COLOR BTN_BACK_COLOR = COLOR_LTGRAY;
|
COLOR BTN_BACK_COLOR = COLOR_LTGRAY;
|
||||||
@ -32,7 +32,7 @@ COLOR DISABLED_COLOR = COLOR_DKGRAY;
|
|||||||
COLOR DISABLED_BACK_COLOR = MASK_BACK_COLOR;
|
COLOR DISABLED_BACK_COLOR = MASK_BACK_COLOR;
|
||||||
COLOR FOCUS_COLOR = NORMAL_COLOR;
|
COLOR FOCUS_COLOR = NORMAL_COLOR;
|
||||||
COLOR FOCUS_BACK_COLOR = COLOR_YELLOW;
|
COLOR FOCUS_BACK_COLOR = COLOR_YELLOW;
|
||||||
COLOR REQUIRED_BACK_COLOR = MAKE_COLOR(255,255,156);
|
COLOR REQUIRED_BACK_COLOR = XVT_MAKE_COLOR(255,255,156);
|
||||||
|
|
||||||
bool CAMPI_SCAVATI = true;
|
bool CAMPI_SCAVATI = true;
|
||||||
bool AUTOSELECT = false;
|
bool AUTOSELECT = false;
|
||||||
@ -1073,7 +1073,7 @@ const char* TControl::parse_caption(const char* cap, bool& bold, bool& big, COLO
|
|||||||
if (r == 0 && g == 0 && b == 0)
|
if (r == 0 && g == 0 && b == 0)
|
||||||
color = COLOR_BLACK;
|
color = COLOR_BLACK;
|
||||||
else
|
else
|
||||||
color = MAKE_COLOR(r, g, b);
|
color = XVT_MAKE_COLOR(r, g, b);
|
||||||
}
|
}
|
||||||
while (*t && *t != ']') t++;
|
while (*t && *t != ']') t++;
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,10 @@ protected:
|
|||||||
|
|
||||||
// @access Public Member
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
// @cmember Controlla se si tratta di un fractione uguale 0 (TRUE se 0)
|
// @cmember Controlla se si tratta di un frazione uguale 0 (TRUE se 0)
|
||||||
bool is_zero() const { return _num == 0;}
|
bool is_zero() const { return _num == 0;}
|
||||||
|
// @cmember Controlla se si tratta di un frazione uguale 1 (TRUE se 1)
|
||||||
|
bool is_one() const { return _num == _den;}
|
||||||
// @cmember Ritorna il segno del fraction
|
// @cmember Ritorna il segno del fraction
|
||||||
int sign() const ;
|
int sign() const ;
|
||||||
// @cmember Trasforma il fraction in intero (operator int era troppo pericoloso)
|
// @cmember Trasforma il fraction in intero (operator int era troppo pericoloso)
|
||||||
|
28
include/imbarcazioni.h
Executable file
28
include/imbarcazioni.h
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef __IMBARCAZIONI_H
|
||||||
|
#define __IMBARCAZIONI_H
|
||||||
|
|
||||||
|
#define I_CODCF "CODCF"
|
||||||
|
#define I_PROGIMB "PROGIMB"
|
||||||
|
#define I_TIPOCOMAPP "TIPOCOMAPP"
|
||||||
|
#define I_TARGA "TARGA"
|
||||||
|
#define I_MOTOBARCA "MOTOBARCA"
|
||||||
|
#define I_DATAISC "DATAISC"
|
||||||
|
#define I_LUNGHEZZA "LUNGHEZZA"
|
||||||
|
#define I_LARGHEZZA "LARGHEZZA"
|
||||||
|
#define I_ALTEZZA "ALTEZZA"
|
||||||
|
#define I_STLORDA "STLORDA"
|
||||||
|
#define I_SCADCOLL "SCADCOLL"
|
||||||
|
#define I_SCADSPEC "SCADSPEC"
|
||||||
|
#define I_STNETTA "STNETTA"
|
||||||
|
#define I_GT "GT"
|
||||||
|
#define I_HP "HP"
|
||||||
|
#define I_KW "KW"
|
||||||
|
#define I_RIP "RIP"
|
||||||
|
#define I_SCADLICNAV "SCADLICNAV"
|
||||||
|
#define I_SCADRUOLEQ "SCADRUOLEQ"
|
||||||
|
#define I_NRRUOLEQUI "NRRUOLEQUI"
|
||||||
|
#define I_SCADLICPES "SCADLICPAG"
|
||||||
|
#define I_SCADPAGLIS "SCADPAGLIS"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1614,7 +1614,7 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create, bool
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
n.tempdir();
|
n.tempdir();
|
||||||
n << SLASH << radix;
|
n.add(radix);
|
||||||
}
|
}
|
||||||
n.ext("dbf");
|
n.ext("dbf");
|
||||||
}
|
}
|
||||||
@ -4415,4 +4415,4 @@ TRecnotype TRecfield::ptr() const
|
|||||||
while(wp-- > (unsigned char*) _p)
|
while(wp-- > (unsigned char*) _p)
|
||||||
r = (r << 8) + *wp;
|
r = (r << 8) + *wp;
|
||||||
return n ? -r : r;
|
return n ? -r : r;
|
||||||
}
|
}
|
||||||
|
@ -3414,7 +3414,7 @@ void TEdit_field::set_background()
|
|||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (NORMAL_BACK_COLOR != REQUIRED_BACK_COLOR)
|
if (color_distance(NORMAL_BACK_COLOR, REQUIRED_BACK_COLOR) != 0)
|
||||||
c = REQUIRED_BACK_COLOR;
|
c = REQUIRED_BACK_COLOR;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -3447,10 +3447,10 @@ void TEdit_field::set_read_only(bool r)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
set_background();
|
set_background();
|
||||||
if (_browse && _browse->is_browse())
|
if (_browse != NULL && _browse->is_browse())
|
||||||
{
|
{
|
||||||
TToken_string out_ids(((TBrowse *)_browse)->get_output_fields());
|
TToken_string out_ids(((TBrowse*)_browse)->get_output_fields());
|
||||||
TMask & m = mask();
|
TMask& m = mask();
|
||||||
FOR_EACH_TOKEN(out_ids, fld)
|
FOR_EACH_TOKEN(out_ids, fld)
|
||||||
m.field(atoi(fld)).set_read_only(r);
|
m.field(atoi(fld)).set_read_only(r);
|
||||||
}
|
}
|
||||||
@ -3519,13 +3519,13 @@ const char* TEdit_field::reformat(const char* str) const
|
|||||||
|
|
||||||
if (_flags.zerofilled)
|
if (_flags.zerofilled)
|
||||||
{
|
{
|
||||||
if (len < size())
|
if (len > 0 && len < size())
|
||||||
{
|
{
|
||||||
if (isdigit(s[0]) && real::is_natural(s))
|
if (isdigit(s[0]) && real::is_natural(s))
|
||||||
s.right_just(size(), '0');
|
s.right_just(size(), '0');
|
||||||
}
|
}
|
||||||
const char * w;
|
const char* w;
|
||||||
for (w = (const char *) s; *w == '0'; w++) ;
|
for (w = (const char*)s; *w == '0'; w++) ;
|
||||||
if (*w == '\0')
|
if (*w == '\0')
|
||||||
s.cut(0);
|
s.cut(0);
|
||||||
}
|
}
|
||||||
|
@ -628,7 +628,7 @@ class TEditable_field : public TLoadable_field
|
|||||||
// @cmember Identificatore della funzione di validazione
|
// @cmember Identificatore della funzione di validazione
|
||||||
int _func;
|
int _func;
|
||||||
// @cmember Parametri da passare alla funzione di validazione
|
// @cmember Parametri da passare alla funzione di validazione
|
||||||
TArray _parms;
|
TString_array _parms;
|
||||||
};
|
};
|
||||||
TValidation_data* _validate;
|
TValidation_data* _validate;
|
||||||
|
|
||||||
|
17
include/mercaticoop.h
Executable file
17
include/mercaticoop.h
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef __MERCATICOOP_H
|
||||||
|
#define __MERCATICOOP_H
|
||||||
|
|
||||||
|
#define MC_CODCF "CODCF"
|
||||||
|
#define MC_DIRITTI1 "DIRITTI1"
|
||||||
|
#define MC_ARROT1 "ARROT1"
|
||||||
|
#define MC_CODIVA1 "CODIVA1"
|
||||||
|
#define MC_DIRITTI2 "DIRITTI2"
|
||||||
|
#define MC_ARROT2 "ARROT2"
|
||||||
|
#define MC_CODIVA2 "CODIVA2"
|
||||||
|
#define MC_SPESEFACC "SPESEFACC"
|
||||||
|
#define MC_CODIVAFACC "CODIVAFACC"
|
||||||
|
#define MC_SPESECASSE "SPESECASSE"
|
||||||
|
#define MC_CODIVACASS "CODIVACASS"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -71,7 +71,8 @@ protected:
|
|||||||
//
|
//
|
||||||
// skstream
|
// skstream
|
||||||
//
|
//
|
||||||
class skstream : public iostream {
|
class skstream : public iostream
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
// constants
|
// constants
|
||||||
enum service
|
enum service
|
||||||
@ -1017,6 +1018,8 @@ bool TSocketClient::HttpSoap(CONNID id, const char* cmd)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char* const eol = "\r\n";
|
||||||
|
|
||||||
bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization)
|
bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
@ -1024,10 +1027,13 @@ bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* loca
|
|||||||
TSocket_connection* conn = (TSocket_connection*)GetConnection(id);
|
TSocket_connection* conn = (TSocket_connection*)GetConnection(id);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return ok;
|
return ok;
|
||||||
const char* const eol = "\r\n";
|
|
||||||
|
char peer[MAX_PATH];
|
||||||
|
conn->GetSocket()->getpeername(peer, sizeof(peer));
|
||||||
|
|
||||||
TString buf(4096);
|
TString buf(4096);
|
||||||
buf << "POST " << remote << " HTTP/1.0" << eol
|
buf << "POST " << remote << " HTTP/1.1" << eol
|
||||||
|
<< "Host: " << peer << eol
|
||||||
<< "User-Agent: Campo" << eol
|
<< "User-Agent: Campo" << eol
|
||||||
<< "Content-Type: text/plain" << eol
|
<< "Content-Type: text/plain" << eol
|
||||||
<< "Content-Length: " << fsize(local) << eol;
|
<< "Content-Length: " << fsize(local) << eol;
|
||||||
@ -1095,7 +1101,7 @@ bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* loca
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool FtpSendCommand(TSocket_connection& conn, const char* cmd, const char* param, TString* line)
|
Vstatic bool FtpSendCommand(TSocket_connection& conn, const char* cmd, const char* param, TString* line)
|
||||||
{
|
{
|
||||||
TString command = cmd;
|
TString command = cmd;
|
||||||
if (param && *param)
|
if (param && *param)
|
||||||
|
@ -566,6 +566,10 @@ const char *real::string (
|
|||||||
__tmp_real.round (dec);
|
__tmp_real.round (dec);
|
||||||
else
|
else
|
||||||
__tmp_real.trail();
|
__tmp_real.trail();
|
||||||
|
const bool patch_negative = (pad == '0' && __tmp_real.sign() < 0);
|
||||||
|
|
||||||
|
if (patch_negative)
|
||||||
|
__tmp_real = -__tmp_real;
|
||||||
|
|
||||||
TString& tmp = get_tmp_string(32);
|
TString& tmp = get_tmp_string(32);
|
||||||
char* s = tmp.get_buffer();
|
char* s = tmp.get_buffer();
|
||||||
@ -581,6 +585,8 @@ const char *real::string (
|
|||||||
}
|
}
|
||||||
if (len > tmp.len())
|
if (len > tmp.len())
|
||||||
tmp.right_just(len, pad);
|
tmp.right_just(len, pad);
|
||||||
|
if (patch_negative)
|
||||||
|
tmp.overwrite("-");
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,13 +462,30 @@ const TVariant& TRecordset::get(const char* column_name) const
|
|||||||
|
|
||||||
const TVariant& TRecordset::get_var(const char* name) const
|
const TVariant& TRecordset::get_var(const char* name) const
|
||||||
{
|
{
|
||||||
// Se mi accorgo che posso e voglio accedere ad un campo del recordset padre
|
const TVariant* var = (const TVariant*)_var.objptr(name);
|
||||||
if (_parentset != NULL && strncmp(name, "#PARENT.", 8) == 0)
|
|
||||||
{
|
|
||||||
return _parentset->get(name+8); // Attenzione! E' giusto usare get() e non get_var()
|
|
||||||
}
|
|
||||||
|
|
||||||
const TVariant* var = (const TVariant*)_var.objptr(name);
|
// Non so che variabile sia: provo con quelle di sistema
|
||||||
|
if (var == NULL && *name == '#')
|
||||||
|
{
|
||||||
|
const TFixed_string n(name);
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
TVariant& v = get_tmp_var();
|
||||||
|
if (fn == "NUMBER")
|
||||||
|
v.set(current_row()+1); else
|
||||||
|
if (fn == "LAST")
|
||||||
|
v.set(items());
|
||||||
|
var = &v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return var != NULL ? *var : NULL_VARIANT;
|
return var != NULL ? *var : NULL_VARIANT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,8 +502,17 @@ bool TRecordset::set_var(const char* name, const TVariant& var, bool create)
|
|||||||
{
|
{
|
||||||
if (create)
|
if (create)
|
||||||
{
|
{
|
||||||
|
const TFixed_string n(name);
|
||||||
|
if (n.starts_with("#PARENT.") || n.starts_with("#RECORD."))
|
||||||
|
{
|
||||||
|
// Aggiungo solo il nome alla lista: niente valore!
|
||||||
|
_varnames.add(name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_var.add(name, var);
|
_var.add(name, var);
|
||||||
_varnames.add(name);
|
_varnames.add(name);
|
||||||
|
}
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -689,6 +715,11 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
|
|
||||||
TString_array files;
|
TString_array files;
|
||||||
|
TFilename name = path.name();
|
||||||
|
const bool wild = (name.find('*') >= 0) || (name.find('?') >= 0);
|
||||||
|
if (!wild)
|
||||||
|
name = "*";
|
||||||
|
|
||||||
// Leggo i files in custom
|
// Leggo i files in custom
|
||||||
if (main_app().has_module(RSAUT))
|
if (main_app().has_module(RSAUT))
|
||||||
{
|
{
|
||||||
@ -698,7 +729,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
xvt_fsys_mkdir(custom);
|
xvt_fsys_mkdir(custom);
|
||||||
|
|
||||||
path = custom;
|
path = custom;
|
||||||
path.add("*");
|
path.add(name);
|
||||||
path.ext(ext);
|
path.ext(ext);
|
||||||
}
|
}
|
||||||
list_files(path, lista);
|
list_files(path, lista);
|
||||||
@ -738,6 +769,9 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
path = name; path.ext(ext); // Leggo i files in campo
|
||||||
|
list_files(path, files);
|
||||||
|
sort_files(files)
|
||||||
return !files.empty();
|
return !files.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,6 +1158,7 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int logicnum = table2logic(tok);
|
int logicnum = table2logic(tok);
|
||||||
|
const TString table(tok);
|
||||||
if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG
|
if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG
|
||||||
logicnum = LF_TAB;
|
logicnum = LF_TAB;
|
||||||
|
|
||||||
@ -1131,10 +1166,11 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
_relation = new TRelation(tok);
|
_relation = new TRelation(tok);
|
||||||
else
|
else
|
||||||
_relation = new TRelation(logicnum);
|
_relation = new TRelation(logicnum);
|
||||||
add_column_info(tok, _relation->curr());
|
pop();
|
||||||
|
|
||||||
|
add_column_info(table, _relation->curr());
|
||||||
|
|
||||||
int key = 1; // key number
|
int key = 1; // key number
|
||||||
pop();
|
|
||||||
if (tok.starts_with("KE"))
|
if (tok.starts_with("KE"))
|
||||||
{
|
{
|
||||||
pop();
|
pop();
|
||||||
@ -1169,6 +1205,21 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
TRectype rec_start(_relation->curr());
|
TRectype rec_start(_relation->curr());
|
||||||
TRectype rec_stop(rec_start);
|
TRectype rec_stop(rec_start);
|
||||||
|
|
||||||
|
TString_array fields;
|
||||||
|
pop();
|
||||||
|
while (tok.starts_with("DI"))
|
||||||
|
{
|
||||||
|
pop();
|
||||||
|
pop();
|
||||||
|
TString field;
|
||||||
|
|
||||||
|
if (tok.find(".") < 0)
|
||||||
|
field << table << ".";
|
||||||
|
field << tok;
|
||||||
|
fields.add(field);
|
||||||
|
pop();
|
||||||
|
}
|
||||||
|
push();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
pop();
|
pop();
|
||||||
@ -1189,6 +1240,16 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
_cursor->setregion(rec_start, rec_stop);
|
_cursor->setregion(rec_start, rec_stop);
|
||||||
if (!filter.empty())
|
if (!filter.empty())
|
||||||
_cursor->setfilter(filter);
|
_cursor->setfilter(filter);
|
||||||
|
if (fields.items() > 0)
|
||||||
|
{
|
||||||
|
FOR_EACH_ARRAY_ITEM_BACK(_column, i, obj)
|
||||||
|
{
|
||||||
|
TRecordset_column_info* info = (TRecordset_column_info*)obj;
|
||||||
|
|
||||||
|
if (fields.find(info->_name) == -1)
|
||||||
|
_column.destroy(i, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_relation->items() == 0) // Non ci sono anche tabelle collegate
|
if (_relation->items() == 0) // Non ci sono anche tabelle collegate
|
||||||
{
|
{
|
||||||
FOR_EACH_ARRAY_ITEM(_column, i, obj)
|
FOR_EACH_ARRAY_ITEM(_column, i, obj)
|
||||||
|
@ -1448,7 +1448,8 @@ int TCursor::test(TIsamop op, TReclock lockop) const
|
|||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (((TCursor *)this)->items() == 0)
|
//if (((TCursor *)this)->items() == 0)
|
||||||
|
if (_totrec == 0)
|
||||||
{
|
{
|
||||||
err = _isemptyfile;
|
err = _isemptyfile;
|
||||||
break;
|
break;
|
||||||
@ -1476,9 +1477,22 @@ int TCursor::test(TIsamop op, TReclock lockop) const
|
|||||||
|
|
||||||
TRecnotype TCursor::read(TIsamop op, TReclock lockop)
|
TRecnotype TCursor::read(TIsamop op, TReclock lockop)
|
||||||
{
|
{
|
||||||
int err = test(op, lockop);
|
|
||||||
TLocalisamfile& curfile = file();
|
TLocalisamfile& curfile = file();
|
||||||
|
|
||||||
|
if (changed())
|
||||||
|
{
|
||||||
|
const TRectype savecurr = curfile.curr();
|
||||||
|
update();
|
||||||
|
curfile.curr() = savecurr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int err = test(op, lockop);
|
||||||
const TRecnotype curpos = curfile.recno();
|
const TRecnotype curpos = curfile.recno();
|
||||||
|
|
||||||
|
TString match;
|
||||||
|
if (err == NOERR)
|
||||||
|
match = curfile.curr().key(_nkey);
|
||||||
|
|
||||||
if (changed())
|
if (changed())
|
||||||
update();
|
update();
|
||||||
|
|
||||||
@ -1501,7 +1515,7 @@ TRecnotype TCursor::read(TIsamop op, TReclock lockop)
|
|||||||
_pos = -1;
|
_pos = -1;
|
||||||
if (pages > 1)
|
if (pages > 1)
|
||||||
{
|
{
|
||||||
const TString match(curfile.curr().key(_nkey));
|
// const TString match(curfile.curr().key(_nkey));
|
||||||
|
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
FOR_EACH_ARRAY_ROW(_fpkey, p , s)
|
FOR_EACH_ARRAY_ROW(_fpkey, p , s)
|
||||||
|
@ -304,7 +304,7 @@ static void set_col_attr(TXmlItem& item, const char* attr, COLOR col, COLOR def
|
|||||||
{
|
{
|
||||||
if (color_distance(col, def) != 0)
|
if (color_distance(col, def) != 0)
|
||||||
{
|
{
|
||||||
TString16 str;
|
TString8 str;
|
||||||
str.format("#%06X", col & 0xFFFFFF);
|
str.format("#%06X", col & 0xFFFFFF);
|
||||||
item.SetAttr(attr, str);
|
item.SetAttr(attr, str);
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ static short get_num_attr(const TXmlItem& item, const char* attr, short def = 0)
|
|||||||
const TString& str = item.GetAttr(attr);
|
const TString& str = item.GetAttr(attr);
|
||||||
if (str.not_empty())
|
if (str.not_empty())
|
||||||
{
|
{
|
||||||
real n(str); n *=CENTO ;
|
real n(str); n *= CENTO;
|
||||||
def = (short)n.integer();
|
def = (short)n.integer();
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
@ -1517,7 +1517,7 @@ void TReport_field::print(TBook& book) const
|
|||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
print_rect(book);
|
print_rect(book);
|
||||||
if (!_picture.blank())
|
if (_picture.full())
|
||||||
{
|
{
|
||||||
book.set_font(print_font());
|
book.set_font(print_font());
|
||||||
const TRectangle& pr = print_rect(book); // Calcolo rettangolo dopo aver settato il font!
|
const TRectangle& pr = print_rect(book); // Calcolo rettangolo dopo aver settato il font!
|
||||||
@ -1538,7 +1538,7 @@ void TReport_field::print(TBook& book) const
|
|||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
const TString& str = formatted_text();
|
const TString& str = formatted_text();
|
||||||
if (!str.blank())
|
if (str.full())
|
||||||
{
|
{
|
||||||
book.set_font(print_font());
|
book.set_font(print_font());
|
||||||
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
||||||
@ -1953,7 +1953,7 @@ int TReport::parse_field(const char* code, char& type, int& level, int& id) cons
|
|||||||
if (isdigit(code[0]) || strncmp(code, "THIS", 4) == 0) // Niente sezione davanti
|
if (isdigit(code[0]) || strncmp(code, "THIS", 4) == 0) // Niente sezione davanti
|
||||||
{
|
{
|
||||||
if (strchr(code, '.') != NULL)
|
if (strchr(code, '.') != NULL)
|
||||||
return 0; // Mi sono confuso con un a campo su file, es: 34.CODART
|
return 0; // Mi sono confuso con un campo su file, es: 34.CODART
|
||||||
|
|
||||||
TReport_field* rf = curr_field();
|
TReport_field* rf = curr_field();
|
||||||
if (rf != NULL)
|
if (rf != NULL)
|
||||||
@ -2322,7 +2322,16 @@ bool TReport::get_report_field(const TString& name, TVariant& var) const
|
|||||||
var = long(_book_page);
|
var = long(_book_page);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
if (xvt_str_compare_ignoring_case(str, "COPY") == 0)
|
||||||
|
{
|
||||||
|
var = long(_rep_copy);
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
if (xvt_str_compare_ignoring_case(str, "COPIES") == 0)
|
||||||
|
{
|
||||||
|
var = long(_rep_copies);
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
if (strncmp(str, "ALLEGATE", 8) == 0)
|
if (strncmp(str, "ALLEGATE", 8) == 0)
|
||||||
{
|
{
|
||||||
const int index = atoi(str + 9);
|
const int index = atoi(str + 9);
|
||||||
@ -2339,18 +2348,14 @@ bool TReport::get_record_field(const TString& name, TVariant& var) const
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
if (recordset() != NULL)
|
if (recordset() != NULL)
|
||||||
{
|
{
|
||||||
const char* str = name;
|
|
||||||
if (name.starts_with("#RECORD."))
|
|
||||||
str += 8; // Elimino prefisso
|
|
||||||
|
|
||||||
// Cerco il campo nel recordset della eventuale sottosezione di appartenenza
|
// Cerco il campo nel recordset della eventuale sottosezione di appartenenza
|
||||||
if (_curr_field != NULL)
|
if (_curr_field != NULL)
|
||||||
found = _curr_field->section().get_record_field(str, var);
|
found = _curr_field->section().get_record_field(name, var);
|
||||||
|
|
||||||
// Se non lo trovo, allora lo cerco nel recordset principale
|
// Se non lo trovo, allora lo cerco nel recordset principale
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
var = recordset()->get(str);
|
var = recordset()->get(name);
|
||||||
if (!var.is_null())
|
if (!var.is_null())
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
@ -3103,7 +3108,7 @@ bool TReport::archive()
|
|||||||
|
|
||||||
TReport::TReport()
|
TReport::TReport()
|
||||||
: _cpi(0), _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL),
|
: _cpi(0), _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL),
|
||||||
_use_printer_font(false), _orientation(0), _page_split(false), _page_merge(false)
|
_use_printer_font(false), _orientation(0), _page_split(false), _page_merge(false), _rep_copy(1), _rep_copies(1
|
||||||
{
|
{
|
||||||
_expressions.set_report(this);
|
_expressions.set_report(this);
|
||||||
_prescript.set_description("PRESCRIPT");
|
_prescript.set_description("PRESCRIPT");
|
||||||
|
@ -461,7 +461,7 @@ class TReport : public TAlex_virtual_machine
|
|||||||
TString_array _params;
|
TString_array _params;
|
||||||
TRecordset* _recordset;
|
TRecordset* _recordset;
|
||||||
TReport_expr_cache _expressions;
|
TReport_expr_cache _expressions;
|
||||||
word _rep_page, _book_page;
|
word _rep_page, _book_page, _rep_copy, _rep_copies;
|
||||||
bool _use_printer_font;
|
bool _use_printer_font;
|
||||||
int _orientation;
|
int _orientation;
|
||||||
TString_array _allegati;
|
TString_array _allegati;
|
||||||
@ -566,6 +566,7 @@ public:
|
|||||||
|
|
||||||
// Used by TReport_printer
|
// Used by TReport_printer
|
||||||
void set_page(word r, word p) { _rep_page = r; _book_page = p; }
|
void set_page(word r, word p) { _rep_page = r; _book_page = p; }
|
||||||
|
void set_copy(word c, word s) { _rep_copy = c; _rep_copies = s; }
|
||||||
word page() const { return _rep_page; }
|
word page() const { return _rep_page; }
|
||||||
virtual word last_printed_page() const { return 0; }
|
virtual word last_printed_page() const { return 0; }
|
||||||
|
|
||||||
|
@ -340,8 +340,8 @@ void TPrint_preview_window::update()
|
|||||||
const int lpi = _book->lpi();
|
const int lpi = _book->lpi();
|
||||||
for (int i = 1; lpi > 0; i++)
|
for (int i = 1; lpi > 0; i++)
|
||||||
{
|
{
|
||||||
set_pen(i%lpi ? MAKE_COLOR(232,232,255) : MAKE_COLOR(255,192,255));
|
set_pen(i%lpi ? XVT_MAKE_COLOR(232,232,255) : XVT_MAKE_COLOR(255,192,255));
|
||||||
const short y = short(i * res.y / lpi);
|
const short y = (short) i * res.y / lpi;
|
||||||
if (y > size.y)
|
if (y > size.y)
|
||||||
break;
|
break;
|
||||||
line(0, y, (short)size.x, y);
|
line(0, y, (short)size.x, y);
|
||||||
@ -349,7 +349,7 @@ void TPrint_preview_window::update()
|
|||||||
const int cpi = _book->cpi();
|
const int cpi = _book->cpi();
|
||||||
for (int j = 1; cpi > 0; j++)
|
for (int j = 1; cpi > 0; j++)
|
||||||
{
|
{
|
||||||
set_pen(j%10 ? MAKE_COLOR(232,232,255) : MAKE_COLOR(255,192,255));
|
set_pen(j%10 ? XVT_MAKE_COLOR(232,232,255) : XVT_MAKE_COLOR(255,192,255));
|
||||||
const short x = short(j * res.x / cpi);
|
const short x = short(j * res.x / cpi);
|
||||||
if (x > size.x)
|
if (x > size.x)
|
||||||
break;
|
break;
|
||||||
@ -1183,7 +1183,7 @@ void TBook::print_doc(TWindow& win, const TFilename& name)
|
|||||||
advanced_draw_text_line(win, name, page, 'C', 'T');
|
advanced_draw_text_line(win, name, page, 'C', 'T');
|
||||||
|
|
||||||
TString8 ext = name.ext(); ext.lower();
|
TString8 ext = name.ext(); ext.lower();
|
||||||
if (ext == "bmp" || ext == "gif" || ext == "jpg" || ext == "jpeg")
|
if (ext == "bmp" || ext == "gif" || ext == "jpg" || ext == "jpeg" || ext == "png")
|
||||||
{
|
{
|
||||||
const TImage* img = _images.image(name);
|
const TImage* img = _images.image(name);
|
||||||
if (img != NULL)
|
if (img != NULL)
|
||||||
@ -1853,7 +1853,7 @@ bool TBook::main_loop()
|
|||||||
_pageto = pages();
|
_pageto = pages();
|
||||||
|
|
||||||
_print_aborted = false;
|
_print_aborted = false;
|
||||||
for (size_t c = 0; c < _copies && !_print_aborted; c++)
|
for (word copy = 1; copy < _copies && !_print_aborted; copy++)
|
||||||
{
|
{
|
||||||
for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++)
|
for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++)
|
||||||
{
|
{
|
||||||
@ -1877,11 +1877,11 @@ static BOOLEAN main_loop_callback(long jolly)
|
|||||||
return pp->main_loop();
|
return pp->main_loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TBook::print(size_t pagefrom, size_t pageto, size_t copies)
|
bool TBook::print(size_t pagefrom, size_t pageto, word copies)
|
||||||
{
|
{
|
||||||
bool ok = pages() > 0;
|
if (pages() <= 0)
|
||||||
if (ok)
|
return false;
|
||||||
{
|
|
||||||
if (pagefrom == 0)
|
if (pagefrom == 0)
|
||||||
{
|
{
|
||||||
TPrinter& p = printer();
|
TPrinter& p = printer();
|
||||||
@ -1912,9 +1912,7 @@ bool TBook::print(size_t pagefrom, size_t pageto, size_t copies)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_pdf_file.cut(0);
|
_pdf_file.cut(0);
|
||||||
ok = xvt_print_start_thread(main_loop_callback, (long)this) != 0;
|
return xvt_print_start_thread(main_loop_callback, (long)this) != 0;
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TBook::export_pdf(const TFilename& filename)
|
bool TBook::export_pdf(const TFilename& filename)
|
||||||
|
@ -23,9 +23,10 @@ class TBook : public TObject
|
|||||||
char _horizontal_alignment, _vertical_alignment;
|
char _horizontal_alignment, _vertical_alignment;
|
||||||
TReport_image_cache _images;
|
TReport_image_cache _images;
|
||||||
|
|
||||||
size_t _pagefrom, _pageto, _copies;
|
size_t _pagefrom, _pageto;
|
||||||
TPoint _max_frame; // Massimo rettangolo scritto sul file di output
|
TPoint _max_frame;
|
||||||
|
word _copies;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PRINT_RCD* _rcd;
|
PRINT_RCD* _rcd;
|
||||||
TWindow* _printwin;
|
TWindow* _printwin;
|
||||||
@ -74,6 +75,7 @@ public:
|
|||||||
TPoint page_res() const;
|
TPoint page_res() const;
|
||||||
size_t page() const { return _page; }
|
size_t page() const { return _page; }
|
||||||
size_t pages() const { return _pages; }
|
size_t pages() const { return _pages; }
|
||||||
|
|
||||||
virtual int lpi() const { return 6; }
|
virtual int lpi() const { return 6; }
|
||||||
virtual int cpi() const { return 10; }
|
virtual int cpi() const { return 10; }
|
||||||
virtual int logical_page_width() const { return page_size().x * cpi() / page_res().x * 100; }
|
virtual int logical_page_width() const { return page_size().x * cpi() / page_res().x * 100; }
|
||||||
@ -83,8 +85,8 @@ public:
|
|||||||
// virtual void print_doc(TWindow& win, const TFilename& name);
|
// virtual void print_doc(TWindow& win, const TFilename& name);
|
||||||
virtual bool on_link(const TReport_link&) { return false; }
|
virtual bool on_link(const TReport_link&) { return false; }
|
||||||
|
|
||||||
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
|
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
|
||||||
virtual bool archive(const char* repname = NULL);
|
virtual bool archive(const char* repname = NULL);
|
||||||
virtual bool preview();
|
virtual bool preview();
|
||||||
|
|
||||||
virtual bool export_pdf(const TFilename& fname);
|
virtual bool export_pdf(const TFilename& fname);
|
||||||
@ -129,10 +131,8 @@ public:
|
|||||||
virtual int cpi() const;
|
virtual int cpi() const;
|
||||||
virtual int logical_page_width() const { return _logical_page_width; }
|
virtual int logical_page_width() const { return _logical_page_width; }
|
||||||
virtual int logical_page_height() const { return _logical_page_height; }
|
virtual int logical_page_height() const { return _logical_page_height; }
|
||||||
|
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
|
||||||
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
|
virtual bool archive(const char* repname = NULL);
|
||||||
virtual bool archive(const char* repname = NULL);
|
|
||||||
|
|
||||||
TReport_book(const char* name = NULL);
|
TReport_book(const char* name = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ bool TAS400_report::set_recordset(TRecordset* rs)
|
|||||||
b->set_pos(x*100, 0);
|
b->set_pos(x*100, 0);
|
||||||
b->set_size(tabstop*100, 100);
|
b->set_size(tabstop*100, 100);
|
||||||
b->set_pattern(PAT_SOLID);
|
b->set_pattern(PAT_SOLID);
|
||||||
b->set_back_color(MAKE_COLOR(192,255,255)); // Light Cyan
|
b->set_back_color(XVT_MAKE_COLOR(192,255,255)); // Light Cyan
|
||||||
body.add(b);
|
body.add(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ bool TAS400_report::set_recordset(TRecordset* rs)
|
|||||||
b->set_pos(keypos*100, 0);
|
b->set_pos(keypos*100, 0);
|
||||||
b->set_size(keylen*100, 100);
|
b->set_size(keylen*100, 100);
|
||||||
b->set_pattern(PAT_SOLID);
|
b->set_pattern(PAT_SOLID);
|
||||||
b->set_back_color(MAKE_COLOR(255,192,192)); // Light Fucsia
|
b->set_back_color(XVT_MAKE_COLOR(255,192,192)); // Light Fucsia
|
||||||
body.add(b);
|
body.add(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,5 +21,6 @@
|
|||||||
#define RMI_TIPOC "TIPOC"
|
#define RMI_TIPOC "TIPOC"
|
||||||
#define RMI_RIGAIMP "RIGAIMP"
|
#define RMI_RIGAIMP "RIGAIMP"
|
||||||
#define RMI_RIGAIVA "RIGAIVA"
|
#define RMI_RIGAIVA "RIGAIVA"
|
||||||
|
#define RMI_NAVP "NAVP"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
29
include/socicoop.h
Executable file
29
include/socicoop.h
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef __SOCICOOP_H
|
||||||
|
#define __SOCICOOP_H
|
||||||
|
|
||||||
|
#define SC_CODCF "CODCF"
|
||||||
|
#define SC_DATANASC "DATANASC"
|
||||||
|
#define SC_COMNASC "COMNASC"
|
||||||
|
#define SC_DATAASS "DATAASS"
|
||||||
|
#define SC_DATAREC "DATAREC"
|
||||||
|
#define SC_NUMQUOTE "NUMQUOTE"
|
||||||
|
#define SC_VALQUOTE "VALQUOTE"
|
||||||
|
#define SC_LIBLAVORO "LIBLAVORO"
|
||||||
|
#define SC_COMEMISS "COMEMISS"
|
||||||
|
#define SC_DATAEMISS "DATAEMISS"
|
||||||
|
#define SC_COMPAGNIA1 "COMPAGNIA1"
|
||||||
|
#define SC_QUOTA1 "QUOTA1"
|
||||||
|
#define SC_COMPAGNIA2 "COMPAGNIA2"
|
||||||
|
#define SC_QUOTA2 "QUOTA2"
|
||||||
|
#define SC_COMPAGNIA3 "COMPAGNIA3"
|
||||||
|
#define SC_QUOTA3 "QUOTA3"
|
||||||
|
#define SC_NOMEBARCA "NOMEBARCA"
|
||||||
|
#define SC_TIPOPROP "TIPOPROP"
|
||||||
|
#define SC_TIPOCOMAPP "TIPOCOMAPP"
|
||||||
|
#define SC_LICENZA "LICENZA"
|
||||||
|
#define SC_DATALIC "DATALIC"
|
||||||
|
#define SC_DATADEL "DATADEL"
|
||||||
|
#define SC_DATASCALIC "DATASCALIC"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -40,7 +40,7 @@ KEY spotlite_ask_name(TFilename& pdf)
|
|||||||
|
|
||||||
msk.enable(DLG_ARCHIVE, can_arc && gnp);
|
msk.enable(DLG_ARCHIVE, can_arc && gnp);
|
||||||
msk.enable(DLG_EMAIL, can_arc);
|
msk.enable(DLG_EMAIL, can_arc);
|
||||||
msk.show(DLG_EMAIL, can_arc && dongle().active(EEAUT));
|
|
||||||
|
|
||||||
pdf.tempdir();
|
pdf.tempdir();
|
||||||
msk.set(F_PRINTER, pdf); // Cartella dei file da esportare
|
msk.set(F_PRINTER, pdf); // Cartella dei file da esportare
|
||||||
@ -86,11 +86,9 @@ bool spotlite_notify(const TFilename& pdf)
|
|||||||
// Funzione per spedire un pdf via mail
|
// Funzione per spedire un pdf via mail
|
||||||
bool spotlite_send_mail(const TFilename& pdf)
|
bool spotlite_send_mail(const TFilename& pdf)
|
||||||
{
|
{
|
||||||
TToken_string to(15, ';'), cc(15, ';'), ccn(15, ';');
|
TToken_string to(15, ';'), cc(15, ';'), ccn(15, ';'), attach(pdf, ';');
|
||||||
TString subj, text;
|
TString subj, text;
|
||||||
|
|
||||||
TToken_string attach(pdf, ';');
|
|
||||||
|
|
||||||
bool ui = true;
|
bool ui = true;
|
||||||
bool ok = main_app().get_next_mail(to, cc, ccn, subj, text, attach, ui);
|
bool ok = main_app().get_next_mail(to, cc, ccn, subj, text, attach, ui);
|
||||||
ok = xvt_mail_send(to, cc, ccn, subj, text, attach, ui) != 0;
|
ok = xvt_mail_send(to, cc, ccn, subj, text, attach, ui) != 0;
|
||||||
|
@ -350,7 +350,9 @@ bool TSQLite::parse_select_from(const char* szSql)
|
|||||||
if (table[i] <= ' ' || table[i] == ';')
|
if (table[i] <= ' ' || table[i] == ';')
|
||||||
{ table.cut(i); break; }
|
{ table.cut(i); break; }
|
||||||
}
|
}
|
||||||
const int logicnum = table2logic(table);
|
|
||||||
|
const int logicnum = (table == "MAG") ? LF_MAG : table2logic(table);
|
||||||
|
|
||||||
if (logicnum > 0)
|
if (logicnum > 0)
|
||||||
import(logicnum);
|
import(logicnum);
|
||||||
}
|
}
|
||||||
|
@ -85,13 +85,14 @@ bool TText_recordset::load_file(const TFilename& n)
|
|||||||
|
|
||||||
int TText_recordset::find_column(const char* column) const
|
int TText_recordset::find_column(const char* column) const
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = -1;
|
||||||
if (column && *column)
|
if (column && *column && *column != '#')
|
||||||
{
|
{
|
||||||
if (real::is_natural(column))
|
if (real::is_natural(column))
|
||||||
n = atoi(column);
|
n = atoi(column);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
n = 0;
|
||||||
for (const char* c = column; isalpha(*c); c++)
|
for (const char* c = column; isalpha(*c); c++)
|
||||||
{
|
{
|
||||||
n *= 26;
|
n *= 26;
|
||||||
@ -567,15 +568,32 @@ const TVariant& TAS400_recordset::get(unsigned int column) const
|
|||||||
|
|
||||||
const TVariant& TAS400_recordset::get(const char* column) const
|
const TVariant& TAS400_recordset::get(const char* column) const
|
||||||
{
|
{
|
||||||
int c = -1;
|
const TArray* info = (const TArray*)_trc.objptr(rec_type());
|
||||||
if (column && column[1] != '\0')
|
if (info)
|
||||||
{
|
{
|
||||||
const TAS400_column_info* ci = ((TAS400_recordset*)this)->parse_field(column, c, false);
|
const TAS400_column_info* ci = ((TAS400_recordset*)this)->parse_field(column, c, false);
|
||||||
if (ci != NULL)
|
if (ci != NULL)
|
||||||
return get_field(*ci);
|
return get_field(*ci);
|
||||||
}
|
}
|
||||||
c = TText_recordset::find_column(column);
|
return TText_recordset::get(column);
|
||||||
return TText_recordset::get(c);
|
}
|
||||||
|
|
||||||
|
const TVariant& TAS400_recordset::get(const char* column) const
|
||||||
|
{
|
||||||
|
if (column && *column != '#')
|
||||||
|
{
|
||||||
|
int c = -1;
|
||||||
|
if (column[1] != '\0')
|
||||||
|
{
|
||||||
|
const TAS400_column_info* ci = ((TAS400_recordset*)this)->parse_field(column, c, false);
|
||||||
|
if (ci != NULL)
|
||||||
|
return get_field(*ci);
|
||||||
|
}
|
||||||
|
c = TText_recordset::find_column(column);
|
||||||
|
if (c >= 0)
|
||||||
|
return TText_recordset::get(c);
|
||||||
|
}
|
||||||
|
return TRecordset::get(column);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRecnotype TAS400_recordset::new_rec(const char* trc)
|
TRecnotype TAS400_recordset::new_rec(const char* trc)
|
||||||
|
@ -9,13 +9,18 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
||||||
HIDDEN const TArray* _parms;
|
HIDDEN const TString_array* _parms;
|
||||||
|
|
||||||
HIDDEN int get_val_param_count()
|
HIDDEN int get_val_param_count()
|
||||||
{ return _parms->items(); }
|
{ return _parms->items(); }
|
||||||
|
|
||||||
HIDDEN const char* get_val_param(int i)
|
HIDDEN const TString& get_val_param(int i)
|
||||||
{ return i >= 0 && i < _parms->items() ? (const char*)((const TString&)(*_parms)[i]) : ""; }
|
{
|
||||||
|
const TString* str = (const TString*)_parms->objptr(i);
|
||||||
|
if (str && *str)
|
||||||
|
return *str;
|
||||||
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
HIDDEN int get_int_val_param(int i)
|
HIDDEN int get_int_val_param(int i)
|
||||||
{ return atoi(get_val_param(i)); }
|
{ return atoi(get_val_param(i)); }
|
||||||
@ -172,7 +177,7 @@ HIDDEN bool _pi_val(TMask_field& f, KEY)
|
|||||||
if (m.query_mode())
|
if (m.query_mode())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
const TString& stato = m.get(atoi(get_val_param(0)));
|
const TString& stato = m.get(get_int_val_param(0));
|
||||||
const TString& pi = f.get();
|
const TString& pi = f.get();
|
||||||
bool ok = pi_check (stato, pi);
|
bool ok = pi_check (stato, pi);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
@ -383,9 +388,9 @@ HIDDEN bool _xt_cf_val(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
|
|
||||||
TMask_field& fld_sex = m.field(atoi(get_val_param(1)));
|
TMask_field& fld_sex = m.field(get_int_val_param(1));
|
||||||
TMask_field& fld_dat = m.field(atoi(get_val_param(2)));
|
TMask_field& fld_dat = m.field(get_int_val_param(2));
|
||||||
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
|
TMask_field& fld_com = m.field(get_int_val_param(3));
|
||||||
|
|
||||||
const char sesso = fld_sex.get()[0];
|
const char sesso = fld_sex.get()[0];
|
||||||
TString16 data = fld_dat.get();
|
TString16 data = fld_dat.get();
|
||||||
@ -578,7 +583,7 @@ HIDDEN bool _numcalc_val(TMask_field& f, KEY k)
|
|||||||
if (k != K_TAB) return true;
|
if (k != K_TAB) return true;
|
||||||
TExpression e(get_val_param(0), _numexpr);
|
TExpression e(get_val_param(0), _numexpr);
|
||||||
|
|
||||||
for (int i = 0 ; i < e.numvar(); i++)
|
for (int i = 0; i < e.numvar(); i++)
|
||||||
{
|
{
|
||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
@ -638,7 +643,7 @@ HIDDEN bool _chkfld_val(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
{
|
{
|
||||||
const int fldid = atoi(get_val_param(0));
|
const int fldid = get_int_val_param(0);
|
||||||
|
|
||||||
if (fldid == THIS_FIELD)
|
if (fldid == THIS_FIELD)
|
||||||
{
|
{
|
||||||
@ -666,7 +671,7 @@ HIDDEN bool _zerofill_val(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
{
|
{
|
||||||
const int columns = atoi(get_val_param(0));
|
const int columns = get_int_val_param(0);
|
||||||
const TString& val = f.get();
|
const TString& val = f.get();
|
||||||
if (val.len() < columns && real::is_natural(val))
|
if (val.len() < columns && real::is_natural(val))
|
||||||
{
|
{
|
||||||
@ -929,7 +934,7 @@ HIDDEN bool _iban_val(TMask_field& f, KEY key)
|
|||||||
CHECKD(nparms == 8, "IBAN_CHECK deve avere 8 parametri: ", nparms);
|
CHECKD(nparms == 8, "IBAN_CHECK deve avere 8 parametri: ", nparms);
|
||||||
int id[8];
|
int id[8];
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
id[i] = atoi(get_val_param(i));
|
id[i] = get_int_val_param(i);
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
@ -1029,7 +1034,7 @@ HIDDEN bool _bban_val(TMask_field& f, KEY key)
|
|||||||
CHECKD(nparms == 5, "BBAN_CHECK deve avere 5 parametri: ", nparms);
|
CHECKD(nparms == 5, "BBAN_CHECK deve avere 5 parametri: ", nparms);
|
||||||
int id[5];
|
int id[5];
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
id[i] = atoi(get_val_param(i));
|
id[i] = get_int_val_param(i);
|
||||||
|
|
||||||
if (f.dlg() == id[1])
|
if (f.dlg() == id[1])
|
||||||
{
|
{
|
||||||
@ -1102,7 +1107,7 @@ bool validate(
|
|||||||
int fn, // @parm Numero della funzione da effettuare
|
int fn, // @parm Numero della funzione da effettuare
|
||||||
TMask_field& f, // @parm Identificatore del campo da controllare
|
TMask_field& f, // @parm Identificatore del campo da controllare
|
||||||
KEY k, // @parm Codice del tasto premuto sul campo
|
KEY k, // @parm Codice del tasto premuto sul campo
|
||||||
const TArray& parms) // @parm Array di paramtri per effettuare il controllo
|
const TString_array& parms) // @parm Array di parametri per effettuare il controllo
|
||||||
{
|
{
|
||||||
_parms = &parms;
|
_parms = &parms;
|
||||||
return (fn >= 0 && fn < MAX_FUNC) ? _global_val_func[fn](f, k) : true;
|
return (fn >= 0 && fn < MAX_FUNC) ? _global_val_func[fn](f, k) : true;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <maskfld.h>
|
#include <maskfld.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool validate(int fn, TMask_field& f, KEY k, const TArray& parms);
|
bool validate(int fn, TMask_field& f, KEY k, const TString_array& parms);
|
||||||
|
|
||||||
bool pi_check (const char* stato, const char* pi);
|
bool pi_check (const char* stato, const char* pi);
|
||||||
bool cf_check (const char* stato, const char* cf);
|
bool cf_check (const char* stato, const char* cf);
|
||||||
|
@ -132,7 +132,7 @@ COLOR TVariant::as_color() const
|
|||||||
unsigned char r = XVT_COLOR_GET_RED(rgb);
|
unsigned char r = XVT_COLOR_GET_RED(rgb);
|
||||||
unsigned char g = XVT_COLOR_GET_GREEN(rgb);
|
unsigned char g = XVT_COLOR_GET_GREEN(rgb);
|
||||||
unsigned char b = XVT_COLOR_GET_BLUE(rgb);
|
unsigned char b = XVT_COLOR_GET_BLUE(rgb);
|
||||||
return MAKE_COLOR(r, g, b);
|
return XVT_MAKE_COLOR(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
real TVariant::as_real() const
|
real TVariant::as_real() const
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
TVariant& operator=(const long n) { set(n); return *this; }
|
TVariant& operator=(const long n) { set(n); return *this; }
|
||||||
TVariant& operator=(const TDate& d) { set(d); return *this; }
|
TVariant& operator=(const TDate& d) { set(d); return *this; }
|
||||||
TVariant& operator=(bool b) { set(long(b)); return *this; }
|
TVariant& operator=(bool b) { set(long(b)); return *this; }
|
||||||
|
TVariant& operator+=(const TVariant& var) { return add(var); }
|
||||||
|
|
||||||
const TString& as_string() const;
|
const TString& as_string() const;
|
||||||
bool as_string(TString& str) const;
|
bool as_string(TString& str) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user