Patch level : 10.0

Files correlati     : tutti
Ricompilazione Demo : [ ]
Commento            :
Rimodernata finestra di esportazione stampe


git-svn-id: svn://10.65.10.50/trunk@17451 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-10-22 14:17:48 +00:00
parent 82d40fdce9
commit f87648c9ec
12 changed files with 93 additions and 137 deletions

@ -202,7 +202,7 @@ long TApplication::handler(WINDOW win, EVENT* ep)
case M_HELP_CONTENTS:
{
TFilename n = "campo";
TString16 module = name(); module.cut(2);
TString4 module; module.strncpy(name(), 2);
if (module != "ba")
n.insert(module);
@ -538,7 +538,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.2008.10.00.0000.2018";
const char* const VERSIONANDPATCH = "Don't cry for me Argentina.2082.10.00.0118.2210";
TToken_string vep(VERSIONANDPATCH, '.');
year = vep.get_int(1);
@ -547,9 +547,8 @@ 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 >= 2008 && release > 0 && tag >= 0 && patch >= 0 &&
bool valid = year >= 2082 && release > 0 && tag >= 0 && patch >= 0 &&
checksum == (year + release + tag + patch);
return valid;
}

@ -1,6 +1,6 @@
#include <bagn003.h>
PAGE "Esportazione" -1 -1 66 6
PAGE "Esportazione" -1 -1 66 5
GROUPBOX DLG_NULL 64 4
BEGIN
@ -18,6 +18,10 @@ BEGIN
PROMPT 2 3 "File "
END
ENDPAGE
TOOLBAR "" 0 0 0 2
BUTTON DLG_PDF 10 2
BEGIN
PROMPT -15 -1 "~PDF"

@ -849,7 +849,7 @@ int DB_build(const char * filename, RecDes *r)
field_info[i].dec=0;
if (ff == NULL || *ff == '\0')
ff = (char *) filename;
ff = filename;
else
ff++;
do_key(ff,r,tag_info, r->NKeys);
@ -862,11 +862,10 @@ int DB_build(const char * filename, RecDes *r)
{
FILE* fp;
char xx[81];
strcpy(xx,(char*)filename);
strcpy(xx,filename);
strcat(xx,".cgp");
if ((fp=fopen(xx,"w"))!=NULL)
fp=fopen(xx,"w");
if (fp != NULL)
{
int j;
for (j=0; tag_info[j].name ; j++)
@ -906,7 +905,7 @@ int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys)
if (data_file != NULL)
{
field_info = d4fieldInfo(data_file);
index_file = d4index(data_file,"" /*(char*)filename */);
index_file = d4index(data_file,"");
if (index_file == NULL)
{
char msg[256];
@ -933,29 +932,17 @@ int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys)
r->Fd[i].Dec = (unsigned char)field_info[i].dec;
switch(field_info[i].type)
{
case r4str:
if (r->Fd[i].Len > 1)
r->Fd[i].TypeF = _alfafld;
else
r->Fd[i].TypeF = _charfld;
break;
case r4log:
r->Fd[i].TypeF = _boolfld;
break;
case r4date:
r->Fd[i].TypeF = _datefld;
break;
case r4memo:
r->Fd[i].TypeF = _memofld;
break;
case r4num:
if (r->Fd[i].Dec > 0)
r->Fd[i].TypeF = _realfld;
else
r->Fd[i].TypeF = r->Fd[i].Len < 6 ? _intfld : _longfld;
break;
default:
break;
case r4str : r->Fd[i].TypeF = r->Fd[i].Len > 1 ? _alfafld : _charfld; break;
case r4log : r->Fd[i].TypeF = _boolfld; break;
case r4date: r->Fd[i].TypeF = _datefld; break;
case r4memo: r->Fd[i].TypeF = _memofld; break;
case r4num :
if (r->Fd[i].Dec > 0)
r->Fd[i].TypeF = _realfld;
else
r->Fd[i].TypeF = r->Fd[i].Len < 6 ? _intfld : _longfld;
break;
default: r->Fd[i].TypeF = _alfafld; break; // Considero stringhe tutte le cose sconosciute
}
}
@ -1009,7 +996,7 @@ void DB_zero_error(void)
la prima chiave che trova >= a from. (TCusrsor)
--------------------------------------------------------------------------*/
int DB_index_seek(int handle, char* from)
int DB_index_seek(int handle, const char* from)
{
TAG4 *t;

@ -53,7 +53,7 @@ extern "C" {
int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys);
int DB_get_error(void);
void DB_zero_error(void);
int DB_index_seek(int handle, char* from);
int DB_index_seek(int handle, const char* from);
long DB_index_recno(int handle);
long DB_index_next(int handle);
char* DB_index_getkey(int handle);

@ -926,14 +926,15 @@ const TString_array& TDongle::info() const
TScanner scanner("campo.aut");
for (int aut = 0; ; aut++)
{
const TString row(scanner.line());
const TString& row = scanner.line();
if (row.blank())
break;
TString tok(row.left(3));
const TString name(row.mid(3));
TToken_string* tok = new TToken_string;
tok->strncpy(row, 3);
const TString& name = row.mid(3);
if (name.full())
tok << dictionary_translate(name);
*tok << dictionary_translate(name);
((TString_array&)_info).add(tok);
}
}

@ -56,9 +56,7 @@ TODBC_connections::~TODBC_connections()
///////////////////////////////////////////////////////////
XVT_ODBC TODBC_recordset::connection() const
{
return _connections.get(_dsn, _usr, _pwd, _dir);
}
{ return _connections.get(_dsn, _usr, _pwd, _dir); }
bool TODBC_recordset::connect(const char* dsn, const char* usr, const char* pwd, const char* dir)
{
@ -67,8 +65,13 @@ bool TODBC_recordset::connect(const char* dsn, const char* usr, const char* pwd,
}
const TString& TODBC_recordset::query_text() const
{ return _sql; }
const TString& TODBC_recordset::driver_version() const
{
return _sql;
TString& tmp = get_tmp_string(50);
xvt_odbc_driver(connection(), tmp.get_buffer(), tmp.size());
return tmp;
}
void TODBC_recordset::reset()

@ -29,6 +29,7 @@ public:
virtual TRecnotype current_row() const;
virtual void requery();
virtual const TString& query_text() const;
virtual const TString& driver_version() const;
virtual const TVariant& get(unsigned int c) const;
virtual const TVariant& get(const char* name) const;

@ -1030,18 +1030,25 @@ void TPrefix::set(
CCloseRecDir(COMDIR);
}
char* prfx = (char*)CGetPref(); // Safe non-const cast for PathSt cprefix
if (strcmp(name, "DEF") == 0)
{
const char* prfx = CGetPref();
xvt_fsys_parse_pathname(prfx, NULL, NULL, _prefix.get_buffer(), NULL, NULL);
}
else
{
_prefix = name;
if (*name)
xvt_fsys_build_pathname(prfx, NULL, __ptprf, name, NULL, NULL);
else
*prfx = '\0';
if (_prefix.full())
{
const TString saved_prf = __ptprf; // Salvo __ptprf che viene cambiato da CGetPref
char* prfx = (char*)CGetPref(); // Safe non const cast for StPath cprefix
xvt_fsys_build_pathname(prfx, NULL, saved_prf, _prefix, NULL, NULL);
}
else
{
char* prfx = (char*)CGetPref(); // Safe non const cast for StPath cprefix
*prfx = '\0';
}
}
if (!test(_prefix))
@ -1146,11 +1153,11 @@ bool TPrefix::set_studio(const char* study, long ditta)
{
TFilename dirtest(study);
if (!dirtest.exist() || dirtest.find(' ') >= 0)
return FALSE;
return false;
dirtest.add("com/dir.gen");
if (!dirtest.exist())
return FALSE;
return false;
// Chiudi tutti i files!
_manager.close_all();
@ -1243,15 +1250,15 @@ const char* firm2dir(long codditta)
{
case -2: // Dati generali campione
case -1: // Dati di studio
firm = ""; break;
firm.cut(0); break;
case 0: // Dati comuni
firm = "com"; break;
default: // Dati ditta
firm.format("%05lda", codditta); break;
}
TString& path = get_tmp_string(256);
xvt_fsys_build_pathname(path.get_buffer(), NULL, __ptprf, firm, NULL, NULL);
TString& path = get_tmp_string(_MAX_PATH);
xvt_fsys_build_pathname(path.get_buffer(), "", __ptprf, firm, NULL, NULL);
return path;
}

@ -4,6 +4,12 @@ BEGIN
PICTURE BMP_PRINT
END
BUTTON DLG_SETPRINT 2 2
BEGIN
PROMPT 1 1 "Imposta"
PICTURE BMP_SETPRINT
END
BUTTON DLG_INFO 2 2
BEGIN
PROMPT 2 1 "Info"

@ -125,8 +125,7 @@ bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, lon
if (pdev != _pdev)
{
TWait_cursor hourglass;
if (_pcd != NULL)
xvt_print_destroy(_pcd);
xvt_print_destroy(_pcd);
_pcd = xvt_print_create_by_name(&_pcd_size, pdev);
_pdev = pdev;
fill_font_list();
@ -266,38 +265,36 @@ void printer_destroy()
// usata da viswin e printwin
class TPrint_intersector : public TString_array
{
const char* _fink;
const char* _fink;
char check_intersection(int x, int y, char ch);
void h_line(int x1, int y1, int len);
void v_line(int x1, int y1, int len);
char check_intersection(int x, int y, char ch);
void h_line(int x1, int y1, int len);
void v_line(int x1, int y1, int len);
// caratteri fincazione: l'ho fatto perche' e' inline
char f_topleft() const { return _fink[0]; }
char f_topmiddle() const { return _fink[1]; }
char f_topright() const { return _fink[2]; }
char f_botleft() const { return _fink[3]; }
char f_botmiddle() const { return _fink[4]; }
char f_botright() const { return _fink[5]; }
char f_centerleft() const { return _fink[6]; }
char f_centermiddle() const { return _fink[7]; }
char f_centerright() const { return _fink[8]; }
char f_horizontal() const { return _fink[9]; }
char f_vertical() const { return _fink[10]; }
// caratteri fincazione: l'ho fatto perche' e' inline
char f_topleft() const { return _fink[0]; }
char f_topmiddle() const { return _fink[1]; }
char f_topright() const { return _fink[2]; }
char f_botleft() const { return _fink[3]; }
char f_botmiddle() const { return _fink[4]; }
char f_botright() const { return _fink[5]; }
char f_centerleft() const { return _fink[6]; }
char f_centermiddle() const { return _fink[7]; }
char f_centerright() const { return _fink[8]; }
char f_horizontal() const { return _fink[9]; }
char f_vertical() const { return _fink[10]; }
public:
// aggiunge un elemento grafico
void add(TGraphic_shape s, int x1, int y1, int x2, int y2);
// aggiunge alla stringa passata i necessari caratteri, leggendo
// dalla pagina interna
const char* get_chars(int line) const;
// sbianca tutto
void clear();
TPrint_intersector(const char* fink, int pagesize) : TString_array(pagesize) , _fink(fink)
{}
virtual ~TPrint_intersector() {}
public:
// aggiunge un elemento grafico
void add(TGraphic_shape s, int x1, int y1, int x2, int y2);
// aggiunge alla stringa passata i necessari caratteri, leggendo
// dalla pagina interna
const char* get_chars(int line) const;
// sbianca tutto
void clear();
TPrint_intersector(const char* fink, int pagesize) : TString_array(pagesize) , _fink(fink) {}
virtual ~TPrint_intersector() {}
};
char TPrint_intersector::check_intersection(int x, int y, char ch)
@ -338,14 +335,12 @@ void TPrint_intersector::h_line(int x1, int y1, int len)
{
if (objptr(y1) == NULL)
{
TString* ss = new TString(256);
ss->spaces();
TString* ss = new TString(256, ' ');
TArray::add(ss, y1);
}
TString& s = row(y1);
int i;
for (i = x1; i < x1+len; i++)
s[i] = f_horizontal();
for (i = x1; i < x1+len; i++)
@ -359,8 +354,7 @@ void TPrint_intersector::v_line(int x1, int y1, int len)
{
if (objptr(i) == NULL)
{
TString* ss = new TString(256);
ss->spaces();
TString* ss = new TString(256, ' ');
TArray::add(ss, i);
}
row(i)[x1] = f_vertical();

@ -695,52 +695,6 @@ TPreview_mask::TPreview_mask(TBook* book) : _book(book)
{
read_mask("bagn008", 0, -1);
set_handlers();
/* Roba obsoleta con le moderne toolbar
int pos = id2pos(DLG_FINDREC);
if (pos >= 0 && id2pos(DLG_FIRSTREC) >= 0) //se e' un bottone pentapartito...
{
TButton_field& f_find = (TButton_field &)fld(pos);
RCT rct_base; f_find.get_rect(rct_base);
const int bwidth = (rct_base.right - rct_base.left);
const int bheight = (rct_base.bottom - rct_base.top);
if (bwidth > 3*bheight/2) // Controllo se ho gia' ridimensionato i bottoni in precedenza
{
int bx = bwidth / 3;
int by = bheight / 2;
RCT r = rct_base; r.left += bx-2; r.right -= bx-2;
f_find.set_rect(r); // Ridimensiona il bottone centrale di ricerca
bx += 5; by += 3; // Aggiusta dimensioni bottoni sussidiari
pos = id2pos(DLG_FIRSTREC);
if (pos >= 0)
{
r = rct_base; r.top = r.bottom - by; r.right = r.left + bx;
fld(pos).set_rect(r);
}
pos = id2pos(DLG_PREVREC);
if (pos >= 0)
{
r = rct_base; r.bottom = r.top + by; r.right = r.left + bx;
fld(pos).set_rect(r);
}
pos = id2pos(DLG_NEXTREC);
if (pos >= 0)
{
r = rct_base; r.bottom = r.top + by; r.left = r.right - bx;
fld(pos).set_rect(r);
}
pos = id2pos(DLG_LASTREC);
if (pos >= 0)
{
r = rct_base; r.top = r.bottom - by; r.left = r.right - bx;
fld(pos).set_rect(r);
}
}
}
*/
}
///////////////////////////////////////////////////////////

@ -573,7 +573,7 @@ void TSQL_recordset::set(const char* sql)
const TString& TSQL_recordset::driver_version() const
{
TString& tmp = get_tmp_string();
tmp << "SQLITE " << SQLITE_VERSION;
tmp << "SQLite " << sqlite3_libversion();
return tmp;
}