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:
alex 2008-03-20 17:11:59 +00:00
parent 88f78c69b0
commit 8e9fb3fce8
31 changed files with 302 additions and 107 deletions

View File

@ -71,11 +71,11 @@ TInfo_mask::TInfo_mask()
int year = 2007, release = 3, tag = 1, patch = 1;
TString16 versione = "2007.03";
TString16 strpatch = "01.001";
TString16 strpatch = "01.0001";
if (main_app().get_version_info(year, release, tag, patch))
{
versione.format("%d.%02d", year, release);
strpatch.format("%02d.%03d", tag, patch);
strpatch.format("%02d.%04d", tag, patch);
}
TString arg;
@ -665,7 +665,7 @@ void TApplication::run(
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, '.');
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();
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);
return valid;
@ -729,7 +729,7 @@ bool TApplication::has_module(int module, int checktype) const
#endif
// Testa bit di attivazione dell'utente
if (ok && checktype != CHK_DONGLE)
if (ok && checktype != CHK_DONGLE && module != EEAUT)
ok = _user_aut[module];
return ok;
}

View File

@ -102,10 +102,10 @@ public:
virtual void destroy();
// @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
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
bool remove(const char* key);

View File

@ -32,6 +32,7 @@
#define ATT_ATTLAVDIP "ATTLAVDIP"
#define ATT_ART74_4 "ART74_4"
#define ATT_TIPOATT "TIPOATT"
#define ATT_CODATECO "CODATECO"
#endif

View File

@ -23,7 +23,6 @@ BEGIN
PROMPT -15 -1 "~PDF"
PICTURE BMP_PDF
MESSAGE EXIT,80
FLAGS "D"
END
BUTTON DLG_ARCHIVE 10 2
@ -31,7 +30,6 @@ BEGIN
PROMPT -25 -1 "~Archivia"
PICTURE BMP_ARCHIVE
MESSAGE EXIT,65
FLAGS "D"
END
BUTTON DLG_EDIT 10 2
@ -46,7 +44,6 @@ BEGIN
PROMPT -45 -1 "~Mail"
PICTURE BMP_EMAIL
MESSAGE EXIT,77
FLAGS "DH"
END
BUTTON DLG_CANCEL 10 2

View File

@ -34,6 +34,8 @@
#define CLI_FAX "FAX"
#define CLI_PTELEX "PTELEX"
#define CLI_TELEX "TELEX"
#define CLI_BYMAIL "BYMAIL"
#define CLI_DOCMAIL "DOCMAIL"
#define CLI_MAIL "MAIL"
#define CLI_DATANASC "DATANASC"
#define CLI_STATONASC "STATONASC"

View File

@ -1,11 +1,13 @@
#include <colmask.h>
#include <colors.h>
#include <config.h>
#include <colmask.h>
#include <colors.h>
#include <config.h>
#include <diction.h>
COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue)
{
COLOR def = XVT_MAKE_COLOR(red, green, blue);
#ifndef DBG
// Se nel colore non compare l'indice cerca di calcolarlo
const unsigned char color_index = (unsigned char)(def >> 12);
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;
}
@ -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)
{
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();
TSheet_field& s = cm.sfield(101);

View File

@ -19,7 +19,7 @@ extern "C"
#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_DARK_COLOR = COLOR_GRAY;
COLOR BTN_BACK_COLOR = COLOR_LTGRAY;
@ -32,7 +32,7 @@ COLOR DISABLED_COLOR = COLOR_DKGRAY;
COLOR DISABLED_BACK_COLOR = MASK_BACK_COLOR;
COLOR FOCUS_COLOR = NORMAL_COLOR;
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 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)
color = COLOR_BLACK;
else
color = MAKE_COLOR(r, g, b);
color = XVT_MAKE_COLOR(r, g, b);
}
while (*t && *t != ']') t++;
}

View File

@ -36,8 +36,10 @@ protected:
// @access Public Member
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;}
// @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
int sign() const ;
// @cmember Trasforma il fraction in intero (operator int era troppo pericoloso)

28
include/imbarcazioni.h Executable file
View 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

View File

@ -1614,7 +1614,7 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create, bool
else
{
n.tempdir();
n << SLASH << radix;
n.add(radix);
}
n.ext("dbf");
}
@ -4415,4 +4415,4 @@ TRecnotype TRecfield::ptr() const
while(wp-- > (unsigned char*) _p)
r = (r << 8) + *wp;
return n ? -r : r;
}
}

View File

@ -3414,7 +3414,7 @@ void TEdit_field::set_background()
switch (status)
{
case 1:
if (NORMAL_BACK_COLOR != REQUIRED_BACK_COLOR)
if (color_distance(NORMAL_BACK_COLOR, REQUIRED_BACK_COLOR) != 0)
c = REQUIRED_BACK_COLOR;
break;
case 2:
@ -3447,10 +3447,10 @@ void TEdit_field::set_read_only(bool r)
if (ok)
{
set_background();
if (_browse && _browse->is_browse())
if (_browse != NULL && _browse->is_browse())
{
TToken_string out_ids(((TBrowse *)_browse)->get_output_fields());
TMask & m = mask();
TToken_string out_ids(((TBrowse*)_browse)->get_output_fields());
TMask& m = mask();
FOR_EACH_TOKEN(out_ids, fld)
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 (len < size())
if (len > 0 && len < size())
{
if (isdigit(s[0]) && real::is_natural(s))
s.right_just(size(), '0');
}
const char * w;
for (w = (const char *) s; *w == '0'; w++) ;
const char* w;
for (w = (const char*)s; *w == '0'; w++) ;
if (*w == '\0')
s.cut(0);
}

View File

@ -628,7 +628,7 @@ class TEditable_field : public TLoadable_field
// @cmember Identificatore della funzione di validazione
int _func;
// @cmember Parametri da passare alla funzione di validazione
TArray _parms;
TString_array _parms;
};
TValidation_data* _validate;

17
include/mercaticoop.h Executable file
View 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

View File

@ -71,7 +71,8 @@ protected:
//
// skstream
//
class skstream : public iostream {
class skstream : public iostream
{
public:
// constants
enum service
@ -1017,6 +1018,8 @@ bool TSocketClient::HttpSoap(CONNID id, const char* cmd)
return ok;
}
static const char* const eol = "\r\n";
bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization)
{
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);
if (conn == NULL)
return ok;
const char* const eol = "\r\n";
char peer[MAX_PATH];
conn->GetSocket()->getpeername(peer, sizeof(peer));
TString buf(4096);
buf << "POST " << remote << " HTTP/1.0" << eol
buf << "POST " << remote << " HTTP/1.1" << eol
<< "Host: " << peer << eol
<< "User-Agent: Campo" << eol
<< "Content-Type: text/plain" << eol
<< "Content-Length: " << fsize(local) << eol;
@ -1095,7 +1101,7 @@ bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* loca
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;
if (param && *param)

View File

@ -566,6 +566,10 @@ const char *real::string (
__tmp_real.round (dec);
else
__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);
char* s = tmp.get_buffer();
@ -581,6 +585,8 @@ const char *real::string (
}
if (len > tmp.len())
tmp.right_just(len, pad);
if (patch_negative)
tmp.overwrite("-");
return s;
}

View File

@ -462,13 +462,30 @@ const TVariant& TRecordset::get(const char* column_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
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);
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;
}
@ -485,8 +502,17 @@ bool TRecordset::set_var(const char* name, const TVariant& var, bool 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);
_varnames.add(name);
}
ok = true;
}
}
@ -689,6 +715,11 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
TWait_cursor hourglass;
TString_array files;
TFilename name = path.name();
const bool wild = (name.find('*') >= 0) || (name.find('?') >= 0);
if (!wild)
name = "*";
// Leggo i files in custom
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);
path = custom;
path.add("*");
path.add(name);
path.ext(ext);
}
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();
}
@ -1124,6 +1158,7 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
return;
int logicnum = table2logic(tok);
const TString table(tok);
if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG
logicnum = LF_TAB;
@ -1131,10 +1166,11 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
_relation = new TRelation(tok);
else
_relation = new TRelation(logicnum);
add_column_info(tok, _relation->curr());
pop();
add_column_info(table, _relation->curr());
int key = 1; // key number
pop();
if (tok.starts_with("KE"))
{
pop();
@ -1169,6 +1205,21 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
TRectype rec_start(_relation->curr());
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)
{
pop();
@ -1189,6 +1240,16 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
_cursor->setregion(rec_start, rec_stop);
if (!filter.empty())
_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
{
FOR_EACH_ARRAY_ITEM(_column, i, obj)

View File

@ -1448,7 +1448,8 @@ int TCursor::test(TIsamop op, TReclock lockop) const
break;
else
{
if (((TCursor *)this)->items() == 0)
//if (((TCursor *)this)->items() == 0)
if (_totrec == 0)
{
err = _isemptyfile;
break;
@ -1476,9 +1477,22 @@ int TCursor::test(TIsamop op, TReclock lockop) const
TRecnotype TCursor::read(TIsamop op, TReclock lockop)
{
int err = test(op, lockop);
TLocalisamfile& curfile = file();
if (changed())
{
const TRectype savecurr = curfile.curr();
update();
curfile.curr() = savecurr;
}
int err = test(op, lockop);
const TRecnotype curpos = curfile.recno();
TString match;
if (err == NOERR)
match = curfile.curr().key(_nkey);
if (changed())
update();
@ -1501,7 +1515,7 @@ TRecnotype TCursor::read(TIsamop op, TReclock lockop)
_pos = -1;
if (pages > 1)
{
const TString match(curfile.curr().key(_nkey));
// const TString match(curfile.curr().key(_nkey));
bool found = FALSE;
FOR_EACH_ARRAY_ROW(_fpkey, p , s)

View File

@ -304,7 +304,7 @@ static void set_col_attr(TXmlItem& item, const char* attr, COLOR col, COLOR def
{
if (color_distance(col, def) != 0)
{
TString16 str;
TString8 str;
str.format("#%06X", col & 0xFFFFFF);
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);
if (str.not_empty())
{
real n(str); n *=CENTO ;
real n(str); n *= CENTO;
def = (short)n.integer();
}
return def;
@ -1517,7 +1517,7 @@ void TReport_field::print(TBook& book) const
break;
case 'T':
print_rect(book);
if (!_picture.blank())
if (_picture.full())
{
book.set_font(print_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 :
{
const TString& str = formatted_text();
if (!str.blank())
if (str.full())
{
book.set_font(print_font());
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 (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();
if (rf != NULL)
@ -2322,7 +2322,16 @@ bool TReport::get_report_field(const TString& name, TVariant& var) const
var = long(_book_page);
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)
{
const int index = atoi(str + 9);
@ -2339,18 +2348,14 @@ bool TReport::get_record_field(const TString& name, TVariant& var) const
bool found = false;
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
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
if (!found)
{
var = recordset()->get(str);
var = recordset()->get(name);
if (!var.is_null())
found = true;
}
@ -3103,7 +3108,7 @@ bool TReport::archive()
TReport::TReport()
: _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);
_prescript.set_description("PRESCRIPT");

View File

@ -461,7 +461,7 @@ class TReport : public TAlex_virtual_machine
TString_array _params;
TRecordset* _recordset;
TReport_expr_cache _expressions;
word _rep_page, _book_page;
word _rep_page, _book_page, _rep_copy, _rep_copies;
bool _use_printer_font;
int _orientation;
TString_array _allegati;
@ -566,6 +566,7 @@ public:
// Used by TReport_printer
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; }
virtual word last_printed_page() const { return 0; }

View File

@ -340,8 +340,8 @@ void TPrint_preview_window::update()
const int lpi = _book->lpi();
for (int i = 1; lpi > 0; i++)
{
set_pen(i%lpi ? MAKE_COLOR(232,232,255) : MAKE_COLOR(255,192,255));
const short y = short(i * res.y / lpi);
set_pen(i%lpi ? XVT_MAKE_COLOR(232,232,255) : XVT_MAKE_COLOR(255,192,255));
const short y = (short) i * res.y / lpi;
if (y > size.y)
break;
line(0, y, (short)size.x, y);
@ -349,7 +349,7 @@ void TPrint_preview_window::update()
const int cpi = _book->cpi();
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);
if (x > size.x)
break;
@ -1183,7 +1183,7 @@ void TBook::print_doc(TWindow& win, const TFilename& name)
advanced_draw_text_line(win, name, page, 'C', 'T');
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);
if (img != NULL)
@ -1853,7 +1853,7 @@ bool TBook::main_loop()
_pageto = pages();
_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++)
{
@ -1877,11 +1877,11 @@ static BOOLEAN main_loop_callback(long jolly)
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 (ok)
{
if (pages() <= 0)
return false;
if (pagefrom == 0)
{
TPrinter& p = printer();
@ -1912,9 +1912,7 @@ bool TBook::print(size_t pagefrom, size_t pageto, size_t copies)
}
_pdf_file.cut(0);
ok = xvt_print_start_thread(main_loop_callback, (long)this) != 0;
}
return ok;
return xvt_print_start_thread(main_loop_callback, (long)this) != 0;
}
bool TBook::export_pdf(const TFilename& filename)

View File

@ -23,9 +23,10 @@ class TBook : public TObject
char _horizontal_alignment, _vertical_alignment;
TReport_image_cache _images;
size_t _pagefrom, _pageto, _copies;
TPoint _max_frame; // Massimo rettangolo scritto sul file di output
size_t _pagefrom, _pageto;
TPoint _max_frame;
word _copies;
protected:
PRINT_RCD* _rcd;
TWindow* _printwin;
@ -74,6 +75,7 @@ public:
TPoint page_res() const;
size_t page() const { return _page; }
size_t pages() const { return _pages; }
virtual int lpi() const { return 6; }
virtual int cpi() const { return 10; }
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 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 archive(const char* repname = NULL);
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
virtual bool archive(const char* repname = NULL);
virtual bool preview();
virtual bool export_pdf(const TFilename& fname);
@ -129,10 +131,8 @@ public:
virtual int cpi() const;
virtual int logical_page_width() const { return _logical_page_width; }
virtual int logical_page_height() const { return _logical_page_height; }
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
virtual bool archive(const char* repname = NULL);
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
virtual bool archive(const char* repname = NULL);
TReport_book(const char* name = NULL);
};

View File

@ -36,7 +36,7 @@ bool TAS400_report::set_recordset(TRecordset* rs)
b->set_pos(x*100, 0);
b->set_size(tabstop*100, 100);
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);
}
@ -48,7 +48,7 @@ bool TAS400_report::set_recordset(TRecordset* rs)
b->set_pos(keypos*100, 0);
b->set_size(keylen*100, 100);
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);
}

View File

@ -21,5 +21,6 @@
#define RMI_TIPOC "TIPOC"
#define RMI_RIGAIMP "RIGAIMP"
#define RMI_RIGAIVA "RIGAIVA"
#define RMI_NAVP "NAVP"
#endif

29
include/socicoop.h Executable file
View 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

View File

@ -40,7 +40,7 @@ KEY spotlite_ask_name(TFilename& pdf)
msk.enable(DLG_ARCHIVE, can_arc && gnp);
msk.enable(DLG_EMAIL, can_arc);
msk.show(DLG_EMAIL, can_arc && dongle().active(EEAUT));
pdf.tempdir();
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
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;
TToken_string attach(pdf, ';');
bool ui = true;
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;

View File

@ -350,7 +350,9 @@ bool TSQLite::parse_select_from(const char* szSql)
if (table[i] <= ' ' || table[i] == ';')
{ table.cut(i); break; }
}
const int logicnum = table2logic(table);
const int logicnum = (table == "MAG") ? LF_MAG : table2logic(table);
if (logicnum > 0)
import(logicnum);
}

View File

@ -85,13 +85,14 @@ bool TText_recordset::load_file(const TFilename& n)
int TText_recordset::find_column(const char* column) const
{
int n = 0;
if (column && *column)
int n = -1;
if (column && *column && *column != '#')
{
if (real::is_natural(column))
n = atoi(column);
else
{
n = 0;
for (const char* c = column; isalpha(*c); c++)
{
n *= 26;
@ -567,15 +568,32 @@ const TVariant& TAS400_recordset::get(unsigned int column) const
const TVariant& TAS400_recordset::get(const char* column) const
{
int c = -1;
if (column && column[1] != '\0')
const TArray* info = (const TArray*)_trc.objptr(rec_type());
if (info)
{
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);
return TText_recordset::get(c);
return TText_recordset::get(column);
}
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)

View File

@ -9,13 +9,18 @@
#include <nditte.h>
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
HIDDEN const TArray* _parms;
HIDDEN const TString_array* _parms;
HIDDEN int get_val_param_count()
{ return _parms->items(); }
HIDDEN const char* get_val_param(int i)
{ return i >= 0 && i < _parms->items() ? (const char*)((const TString&)(*_parms)[i]) : ""; }
HIDDEN const TString& get_val_param(int 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)
{ return atoi(get_val_param(i)); }
@ -172,7 +177,7 @@ HIDDEN bool _pi_val(TMask_field& f, KEY)
if (m.query_mode())
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();
bool ok = pi_check (stato, pi);
if (!ok)
@ -383,9 +388,9 @@ HIDDEN bool _xt_cf_val(TMask_field& f, KEY key)
TMask& m = f.mask();
TMask_field& fld_sex = m.field(atoi(get_val_param(1)));
TMask_field& fld_dat = m.field(atoi(get_val_param(2)));
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
TMask_field& fld_sex = m.field(get_int_val_param(1));
TMask_field& fld_dat = m.field(get_int_val_param(2));
TMask_field& fld_com = m.field(get_int_val_param(3));
const char sesso = fld_sex.get()[0];
TString16 data = fld_dat.get();
@ -578,7 +583,7 @@ HIDDEN bool _numcalc_val(TMask_field& f, KEY k)
if (k != K_TAB) return true;
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);
if (s[0] != '#')
@ -638,7 +643,7 @@ HIDDEN bool _chkfld_val(TMask_field& f, KEY 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)
{
@ -666,7 +671,7 @@ HIDDEN bool _zerofill_val(TMask_field& f, KEY 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();
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);
int id[8];
for (int i = 0; i < 8; i++)
id[i] = atoi(get_val_param(i));
id[i] = get_int_val_param(i);
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);
int id[5];
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])
{
@ -1102,7 +1107,7 @@ bool validate(
int fn, // @parm Numero della funzione da effettuare
TMask_field& f, // @parm Identificatore del campo da controllare
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;
return (fn >= 0 && fn < MAX_FUNC) ? _global_val_func[fn](f, k) : true;

View File

@ -5,7 +5,7 @@
#include <maskfld.h>
#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 cf_check (const char* stato, const char* cf);

View File

@ -132,7 +132,7 @@ COLOR TVariant::as_color() const
unsigned char r = XVT_COLOR_GET_RED(rgb);
unsigned char g = XVT_COLOR_GET_GREEN(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

View File

@ -49,6 +49,7 @@ public:
TVariant& operator=(const long n) { set(n); return *this; }
TVariant& operator=(const TDate& d) { set(d); return *this; }
TVariant& operator=(bool b) { set(long(b)); return *this; }
TVariant& operator+=(const TVariant& var) { return add(var); }
const TString& as_string() const;
bool as_string(TString& str) const;