Patch level : AGA 02.00 314

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Riportata la versione Partners 2.0 patch 314


git-svn-id: svn://10.65.10.50/trunk@10444 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2002-07-30 14:11:47 +00:00
parent fadd8a73e2
commit f029de3450
29 changed files with 200 additions and 335 deletions

View File

@ -2566,16 +2566,16 @@ int main(int argc, char** argv)
{ {
TApplication::check_parameters(argc, argv); TApplication::check_parameters(argc, argv);
if (user().blank())
{
char name[16];
if (aga_get_user_name(name, 16))
user() = name;
}
if (user().blank()) if (user().blank())
{ {
TConfig prawin(CONFIG_INSTALL, "Main"); TConfig prawin(CONFIG_INSTALL, "Main");
user() = prawin.get("User"); user() = prawin.get("User");
if (user().blank() || user() == dongle().administrator())
{
char name[32];
if (aga_get_user_name(name, 32))
user() = name;
}
} }
TFilename menu = (argc < 2) ? MEN_FILE : argv[1]; TFilename menu = (argc < 2) ? MEN_FILE : argv[1];

View File

@ -17,11 +17,11 @@ int main(int argc,char** argv)
case 3: case 3:
ba1400(argc,argv); break; // Set users ba1400(argc,argv); break; // Set users
case 4: case 4:
ba1500(argc,argv); break; ba1500(argc,argv); break; // Activate modules
case 5: case 5:
ba1600(argc,argv); break; ba1600(argc,argv); break; // Disks generation
case 6: case 6:
ba1700(argc,argv); break; ba1700(argc,argv); break; // Install modules
case 7: case 7:
ba1800(argc,argv); break; ba1800(argc,argv); break;
case 8: case 8:

View File

@ -914,7 +914,7 @@ void TManutenzione_app::update_dir()
if (flags < 10000L && size > 0L && d.len() > 0) if (flags < 10000L && size > 0L && d.len() > 0)
{ {
TSystemisamfile b(i); TSystemisamfile b(i);
int err = b.is_valid(); int err = b.is_valid(TRUE);
if (err == _istrcerr && d.eod() == 0 && if (err == _istrcerr && d.eod() == 0 &&
yesno_box("Il tracciato record del file %d e' incoerente:\n" yesno_box("Il tracciato record del file %d e' incoerente:\n"
"Si desidera eliminare il file vuoto %s?", i, d.filename())) "Si desidera eliminare il file vuoto %s?", i, d.filename()))
@ -1131,7 +1131,7 @@ void TManutenzione_app::convert_dir()
else s << "della ditta " << atol (pref) << "."; else s << "della ditta " << atol (pref) << ".";
s << " Memoria libera: " << long(os_get_free_memory()/1024) << " Kbytes."; s << " Memoria libera: " << long(os_get_free_memory()/1024) << " Kbytes.";
TProgind p(update_items ? update_items : 1, s, FALSE, TRUE, 70); TProgind p(update_items ? update_items : 1, s, FALSE, TRUE);
p.setstatus(1); p.setstatus(1);
for (int i = 2; i <= update_items; i++) for (int i = 2; i <= update_items; i++)
@ -1148,7 +1148,7 @@ void TManutenzione_app::convert_dir()
{ {
TSystemisamfile b(i); TSystemisamfile b(i);
const int module = abs((int)ds.flags()); const int module = abs((int)ds.flags());
int err = b.is_valid(); int err = b.is_valid(TRUE);
if (err == -60 || err == -64) err=NOERR; // verif. if (err == -60 || err == -64) err=NOERR; // verif.
d.get(i, _nolock, _nordir, _sysdirop); d.get(i, _nolock, _nordir, _sysdirop);
if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm()))) if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))

View File

@ -633,7 +633,7 @@ bool TSet_users::user_create()
sf.set_notify(k_notify); sf.set_notify(k_notify);
#ifdef XVAGA #ifdef XVAGA
const char* menuname = "bacampo.men"; const char* menuname = "bamenu.men";
#else #else
const char* menuname = "baprassi.men"; const char* menuname = "baprassi.men";
#endif #endif

View File

@ -1166,7 +1166,7 @@ bool TInstaller_mask::on_key(KEY key)
TInstaller_mask::TInstaller_mask() TInstaller_mask::TInstaller_mask()
: TArray_sheet(0, 0, 0, 0, "Installazione", : TArray_sheet(0, 0, 0, 0, "Installazione",
"@1|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento", "@1C|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento",
0x18, 3) 0x18, 3)
{ {
_curr_mask = this; _curr_mask = this;

View File

@ -35,7 +35,7 @@ HIDDEN int str2isamfile(const TString& str)
if (logic < get_isamfiles()) if (logic < get_isamfiles())
{ {
TBaseisamfile file(logic); TBaseisamfile file(logic);
if (file.is_valid() == NOERR) if (file.is_valid(FALSE) == NOERR)
logic_num = logic; logic_num = logic;
} }
} }

View File

@ -2,7 +2,6 @@
#include <isam.h> #include <isam.h>
#include <progind.h> #include <progind.h>
#include <prefix.h> #include <prefix.h>
#include <utility.h>
// prototipi // prototipi
#include "bainsta.h" #include "bainsta.h"
#include "bainst.h" #include "bainst.h"
@ -39,8 +38,6 @@ int TSystemtempfile::load(
if (fl == NULL) if (fl == NULL)
{ {
error_box("Non riesco ad aprire il file %s",from); error_box("Non riesco ad aprire il file %s",from);
clearerr(fl);
setstatus(2);
return 2; return 2;
} }
TRecnotype r = 0, e = 0, nitems = 0, nread = 0; TRecnotype r = 0, e = 0, nitems = 0, nread = 0;
@ -58,10 +55,24 @@ int TSystemtempfile::load(
if (ditte.read() == NOERR) if (ditte.read() == NOERR)
attprev = ditte.get("CODATTPREV"); attprev = ditte.get("CODATTPREV");
} }
if (fl == NULL)
{
clearerr(fl);
setstatus(err);
return err;
}
char w[80];
while ((fgets(w, 80, fl) != NULL))
{
if (strncmp(w, "[Data]", 6) == 0)
{
nitems = ftell(fl);
break;
}
}
fseek(fl, 0L, SEEK_END); fseek(fl, 0L, SEEK_END);
nitems = ftell(fl); nitems = ftell(fl) - nitems;
fclose(fl); fclose(fl);
TScanner f(from); TScanner f(from);
//open(); //open();
@ -69,7 +80,7 @@ int TSystemtempfile::load(
TToken_string s(1024, fs); TToken_string s(1024, fs);
bool fixedlen = (fs == '\0'); bool fixedlen = (fs == '\0');
int nflds = curr().items(); int nflds = curr().items();
TString_array fld(nflds); TArray fld(nflds);
int len[MaxFields]; int len[MaxFields];
TString sfd(3); TString sfd(3);
TString s1(64); TString s1(64);
@ -77,54 +88,50 @@ int TSystemtempfile::load(
if (f.paragraph("Header")) if (f.paragraph("Header"))
{ {
int equal; f.equal();
TString key; const long level = atol(f.line());
//rimosso il controllo sul livello archivi;tanto la conversione la fa lo stesso
// if (level > get_std_level())
// error_box("L'archivio %s e' stato generato con gli archivi di livello %ld%/%ld.\n Il livello attuale e' %ld/%ld.\n Convertire gli archivi e ripetere l' operazione.",
// from, level/100, level%100, get_std_level()/100, get_std_level()%100);
nflds = 0; nflds = 0;
while ((equal = f.line().find('=')) > 0) TToken_string s2(f.line());
int p = s2.find('=');
if (p > 0)
{ {
key = f.token().left(equal); s1 = s2.left(p);
key.trim(); s2.ltrim(p+1);
if (key == "Version") }
else s1.cut(0);
while (s1 == "Fields")
{
for (const char * fd = s2.get(); fd != NULL; fd = s2.get())
{ {
const long level = atol(f.token().mid(equal+1)); TToken_string wfd(fd, ',');
if (level > prefix().filelevel()) fld.add(new TString(wfd.get()));
error_box("L'archivio %s e' stato generato con gli archivi di livello %ld%/%ld.\n Il livello attuale e' %ld/%ld.\n Convertire gli archivi e ripetere l' operazione.", len[nflds] = wfd.get_int();
from, level/100, level%100, get_std_level()/100, get_std_level()%100); nflds++;
// lcf = getlcf(level); }
} else s2 = f.line();
if (key == "File") p = s2.find('=');
if (p > 0)
{ {
const int logic = atoi(f.token().mid(equal+1)); s1 = s2.left(p);
if (logic != num()) s2.ltrim(p+1);
error_box("L'archivio %s e' stato generato dal file %d", }
from, logic); else s1.cut(0);
} else
if (key == "Fields")
{
TToken_string riga = f.token().mid(equal+1);
TToken_string wfd(32, ',');
FOR_EACH_TOKEN(riga, fd)
{
wfd = fd; wfd.strip_spaces();
fld.add(wfd.get(0));
len[nflds] = wfd.get_int();
nflds++;
}
}
} }
} }
else
if (nflds == 0 || fld.items() == 0) {
{
nflds = curr().items();
for (int j = 0; j < nflds; j++) for (int j = 0; j < nflds; j++)
{ {
fld.add(curr().fieldname(j), j); fld.add(TString(curr().fieldname(j)), j);
const TString & wfld = (const TString & ) fld[j]; const TString & wfld = (const TString & ) fld[j];
len[j] = (curr().type(wfld) == _datefld) ? 10 : curr().length(wfld); len[j] = (curr().type(wfld) == _datefld) ? 10 : curr().length(wfld);
} }
} }
if (!f.paragraph("Data")) if (!f.paragraph("Data"))
{ {
error_box("Formato dei dati non valido"); error_box("Formato dei dati non valido");
@ -155,7 +162,7 @@ int TSystemtempfile::load(
} }
if ((r + e) % 50 == 0) if ((r + e) % 50 == 0)
{ {
s1.format("Imp. archivio %d\n%6ld records %6ld errori - %3d", _logicnum, r, e, last); s1.format("Imp. archivio %s\n%6ld records %6ld errori - %3d", filename(), r, e, last);
p.set_text(s1); p.set_text(s1);
} }
p.setstatus(nread + 1); p.setstatus(nread + 1);
@ -183,29 +190,21 @@ int TSystemtempfile::load(
s2++; s2++;
s2[strlen(s2) - 1] = '\0'; s2[strlen(s2) - 1] = '\0';
} }
if (curr().type((const TString&) fld[j]) == _memofld)
s1 = esc(s2);
else
s1 = s2;
put((const TString&) fld[j], s2); put((const TString&) fld[j], s2);
} }
} }
int err = write(); if (write() == NOERR) r++;
if (err == _isreinsert)
err = rewrite();
if (err == NOERR)
r++;
else else
{ {
error_box("Errore di scrittura alla riga %ld", r+e+1); #ifdef DBG
yesnofatal_box("Numero linea relativa all'errore: %ld",r+e+1);
#endif
e++; e++;
last = status(); last = status();
break;
} }
s = f.line(); s = f.line();
} }
s1.format("Imp. archivio %d\n%6ld records %6ld errori - %3d", _logicnum, r, e, last); s1.format("Imp. archivio %s\n%6ld records %6ld errori - %3d", filename(), r, e, last);
p.set_text(s1); p.set_text(s1);
//close(); //close();
setstatus(err); setstatus(err);
@ -259,15 +258,12 @@ int TSystemtempfile::dump(
len[j] = (t == _datefld) ? 10 : curr().length(wfld); len[j] = (t == _datefld) ? 10 : curr().length(wfld);
} }
TRecnotype i = 0; TRecnotype i = 0;
const TRecnotype nitems = items(); const TRecnotype nitems = items();
s.format("Esportazione archivio %s", filename());
s.format("Esportazione archivio %s", filename());
TProgind p(nitems, s, TRUE, TRUE, 70); TProgind p(nitems, s, TRUE, TRUE, 70);
TString s1,sfld; TString s1;
fprintf(f, "[Header]\nVersion=%ld\nFile=%d", fprintf(f, "[Header]\nVersion=%ld", prefix().filelevel());
prefix().filelevel(), num());
for (int k = 0; k < nflds; k++) for (int k = 0; k < nflds; k++)
{ {
if ((k % 10) == 0) fprintf(f, "\nFields="); if ((k % 10) == 0) fprintf(f, "\nFields=");
@ -295,17 +291,7 @@ int TSystemtempfile::dump(
s1 = ""; s1 = "";
if (j && fs) s1 << fs; if (j && fs) s1 << fs;
if (fd) s1 << fd; if (fd) s1 << fd;
sfld = get((const TString&)fld[j]); s1 << get((const TString&)fld[j]);
if (curr().type((const TString&) fld[j]) == _memofld)
{
int p = 0;
while ((p = sfld.find('\n', 0)) >= 0)
{
sfld.overwrite("\\", p);
sfld.insert("n", p+1);
}
}
s1 << sfld;
if (fd) s1 << fd; if (fd) s1 << fd;
} }
s << s1; s << s1;
@ -336,18 +322,8 @@ int TSystemtempfile::dump(
s1 = ""; s1 = "";
if (j && fs) s1 << fs; if (j && fs) s1 << fs;
if (fd) s1 << fd; if (fd) s1 << fd;
s1 = get((const TString&)fld[j]); s1 << get((const TString&)fld[j]);
if (curr().type((const TString&) fld[j]) == _memofld) if (fd) s1 << fd;
{
int p = 0;
while ((p = sfld.find('\n', 0)) >= 0)
{
sfld.overwrite("\\", p);
sfld.insert("n", p+1);
}
}
s1 << sfld;
if (fd) s1 << fd;
} }
s << s1; s << s1;
} }
@ -393,7 +369,7 @@ bool TStd_filename::check(bool verbose,const char * n)
bool TInstallmodule_app::create() bool TInstallmodule_app::create()
{ {
TScanner scanner(AUT_FILE); TScanner scanner("campo.aut");
bool ok = FALSE; bool ok = FALSE;
for (int aut = 0; aut<=module_number(); aut++) for (int aut = 0; aut<=module_number(); aut++)
@ -568,11 +544,11 @@ int main(int argc,char** argv)
else if (mod == "mg") else if (mod == "mg")
r=bainst32(argc, argv);// pre/post installazione magazzino: r=bainst32(argc, argv);// pre/post installazione magazzino:
else if (mod == "ef") else if (mod == "ef")
r=bainst34(argc, argv);// pre/post installazione effetti: r=bainst34(argc, argv);// pre/post installazione effetti:
else if (mod == "sv")
r=bainst38(argc, argv);// pre/post installazione statistiche:
else if (mod == "db") else if (mod == "db")
r=bainst35(argc, argv);// pre/post installazione distinta base: r=bainst35(argc, argv);// pre/post installazione distinta base:
else if (mod == "sv")
r=bainst38(argc, argv);// pre/post installazione statistiche:
else if (mod == "mr") else if (mod == "mr")
r=bainst39(argc, argv);// pre/post installazione MRP r=bainst39(argc, argv);// pre/post installazione MRP
else else

View File

@ -18,7 +18,7 @@ public:
virtual ~TInstall_CE () {} virtual ~TInstall_CE () {}
}; };
bool TInstall_CE ::install_com(bool in_lire) bool TInstall_CE::install_com(bool in_lire)
{ {
const char* tab[5] = {"cac","cat","cgr","tmc","clm"}; const char* tab[5] = {"cac","cat","cgr","tmc","clm"};
if (in_lire) if (in_lire)
@ -30,8 +30,8 @@ bool TInstall_CE ::install_com(bool in_lire)
for (int i=0; i<5; i++) for (int i=0; i<5; i++)
{ {
str = tab[i]; str << ".txt"; str = tab[i]; str << ".txt";
txtfile.check(FALSE, str); if (txtfile.check(TRUE, str))
tabcom.load(txtfile); tabcom.load(txtfile);
} }
return TRUE; return TRUE;
} }

View File

@ -1,6 +1,7 @@
#include <applicat.h> #include <applicat.h>
#include <mask.h> #include <mask.h>
#include <isam.h> #include <isam.h>
#include <tabutil.h>
#include <utility.h> #include <utility.h>
#include "bainst.h" #include "bainst.h"
#include "bainst17.h" #include "bainst17.h"
@ -8,33 +9,30 @@
class TInstall_AT : public TInstallmodule_app class TInstall_AT : public TInstallmodule_app
{ {
protected: protected:
virtual bool load_default_data() const ;
virtual int module_number() const {return 17;} virtual int module_number() const {return 17;}
virtual bool preload_mask() ; virtual bool preload_mask() ;
virtual bool install_firm() ; //
bool post_installer() ; bool post_installer() ;
public: public:
virtual ~TInstall_AT () {} virtual ~TInstall_AT () {}
}; };
bool TInstall_AT ::install_firm() bool TInstall_AT ::load_default_data() const
{ {
bool ok=TRUE; if (prefix().get_codditta() <= 0)
set_firm(1); // provvisorio .... return TRUE;
TStd_filename txtfile("svtab.txt"); TTable ido("IDO");
if (txtfile.check(TRUE)) const bool empty = ido.first() != NOERR;
{
TSystemisamfile tabditta(LF_TAB); return empty;
tabditta.load(txtfile);
}
return ok;
} }
bool TInstall_AT ::post_installer() bool TInstall_AT ::post_installer()
{ {
#ifdef XVAGA #ifdef XVAGA
const char* menuname = "bacampo.men"; const char* menuname = "bamenu.men";
#else #else
const char* menuname = "baprassi.men"; const char* menuname = "baprassi.men";
#endif #endif

View File

@ -152,12 +152,6 @@ TMask* TPrimanota_application::load_mask(int n)
m->set_handler(SK_CAMBIO, cambio_handler); m->set_handler(SK_CAMBIO, cambio_handler);
m->set_handler(SK_TOTDOCVAL, totdocval_handler); m->set_handler(SK_TOTDOCVAL, totdocval_handler);
if (easydoc_installed())
{
m->show(F_EASYDOC);
m->set_handler(F_EASYDOC, easydoc_handler);
}
TSheet_field& cg = (TSheet_field&)m->field(F_SHEETCG); TSheet_field& cg = (TSheet_field&)m->field(F_SHEETCG);
cg.set_notify(cg_notify); cg.set_notify(cg_notify);
TMask& cgm = cg.sheet_mask(); TMask& cgm = cg.sheet_mask();
@ -1197,9 +1191,6 @@ bool TPrimanota_application::remove()
} }
link_cesp(m, "Remove"); link_cesp(m, "Remove");
link_intra(m, "Remove"); link_intra(m, "Remove");
if (easydoc_connected())
run_easydoc("Elimina");
} }
return ok; return ok;
} }

View File

@ -90,8 +90,6 @@ class TPrimanota_application : public TRelation_application
TAssoc_array _colori; // Colori delle righe TAssoc_array _colori; // Colori delle righe
TFilename _EasyDocPath; // Path eseguibile EasyDoc
static bool showpartite_handler(TMask_field& f, KEY k); static bool showpartite_handler(TMask_field& f, KEY k);
static bool speserimb_handler(TMask_field& f, KEY k); static bool speserimb_handler(TMask_field& f, KEY k);
static bool altrespese_handler(TMask_field& f, KEY k); static bool altrespese_handler(TMask_field& f, KEY k);
@ -157,7 +155,6 @@ class TPrimanota_application : public TRelation_application
static bool pag_notify(TSheet_field& s, int r, KEY key); static bool pag_notify(TSheet_field& s, int r, KEY key);
static bool pag_sheet_handler(TMask_field& f, KEY key); static bool pag_sheet_handler(TMask_field& f, KEY key);
static bool easydoc_handler(TMask_field& f, KEY k);
void reset_sheet_row(TSheet_field& s, int n); void reset_sheet_row(TSheet_field& s, int n);
int crea_somma_spese(TImporto& imp); int crea_somma_spese(TImporto& imp);
@ -309,10 +306,6 @@ public:
TString_array& pag_rows() { return _pag_rows; } TString_array& pag_rows() { return _pag_rows; }
TImporto get_cgs_imp(int n); TImporto get_cgs_imp(int n);
bool easydoc_installed();
bool easydoc_connected();
bool run_easydoc(const char* azione) const;
TPrimanota_application(); TPrimanota_application();
virtual ~TPrimanota_application() { } virtual ~TPrimanota_application() { }
}; };

View File

@ -393,126 +393,3 @@ bool TPrimanota_application::prorata_handler(TMask_field& f, KEY k)
return TRUE; return TRUE;
} }
///////////////////////////////////////////////////////////
// Gestione EasyDoc
///////////////////////////////////////////////////////////
bool TPrimanota_application::easydoc_installed()
{
// check autorization
if (!has_module(AIAUT))
{
_EasyDocPath = " ";
return FALSE;
return os_get_image_editor_path(_EasyDocPath);
}
// Il documento attuale e' connesso a easydoc?
bool TPrimanota_application::easydoc_connected()
{
return !_EasyDocPath.blank();
}
bool TPrimanota_application::run_easydoc(const char* azione) const
{
const TMask& m = curr_mask();
TString cmdline = _EasyDocPath;
TFilename ininame;
if (azione && *azione)
{
// linea comando EasyDoc
ininame.tempdir();
ininame.add("easydoc.ini");
cmdline << ' ' << ininame;
// path dei dati della ditta
TFilename dati_dir = get_firm_dir();
// completa path relativo,
// ma che male c'era a registrarlo sempre assoluto??
if (dati_dir.is_relative_path())
{
TFilename modulename(argv(0));
modulename = modulename.path();
modulename.add(dati_dir);
dati_dir = modulename;
}
// rimuove barre e controbarre per dargli un aspetto decente
dati_dir.replace('/','\\');
for (int pos = dati_dir.find("\\\\"); pos >= 0; pos = dati_dir.find("\\\\"))
dati_dir[pos] = ' ';
dati_dir.strip_spaces();
// nome archivio
TFilename archivio(dati_dir);
archivio.add("easydoc.mdb");
// drive di archiviazione
TString drv_di_arch;
if (dati_dir[1] == ':')
drv_di_arch = dati_dir.left(2);
// directory di archiviazione
TString dir_di_arch(dati_dir);
if (dir_di_arch[1] == ':')
dir_di_arch.ltrim(2);
dir_di_arch << SLASH;
// prepara sempre sezione "EASYDOC"
TConfig ini(ininame, "EASYDOC");
ini.set("Azione", azione);
ini.set("Archivio", archivio);
ini.set("Cartella", "Movimenti primanota");
ini.set("Campo0", m.get(F_NUMREG));
ini.set("Campo1", m.get(F_DATAREG));
ini.set("Descrizione", m.get(F_DESCR));
// prepara la sezione "DefinizioneDoc1" (se non esiste l'archivio mdb)
if (!archivio.exist())
{
ini.set_paragraph("DefinizioneDoc1");
ini.set("Archivio", archivio);
ini.set("NomeDoc", "Movimenti primanota");
ini.set("DirDiArchiviazione", dir_di_arch);
ini.set("DriveDiArchiviazione", drv_di_arch);
ini.set("DirDocumento", "eddoc");
ini.set("Campo0", "Numero registrazione");
ini.set("Tipo0", "Numero");
ini.set("Campo1", "Data registrazione");
ini.set("Tipo1", "Data");
}
}
TExternal_app app(cmdline);
bool ok = app.run(FALSE, FALSE) == 0;
if (ininame.not_empty())
::remove(ininame);
return ok;
}
bool TPrimanota_application::easydoc_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
const TMask& m = f.mask();
if (m.insert_mode())
app().run_easydoc("Scan");
else
{
if (m.edit_mode())
{
if (app().easydoc_connected())
app().run_easydoc("Visualizza");
else
app().run_easydoc("Scan");
}
else
app().run_easydoc("");
}
}
return TRUE;
}

View File

@ -53,12 +53,13 @@ bool TCopia_archivi::copyfile(int logicnum, long from, long to)
if (from > 0) set_firm(from); if (from > 0) set_firm(from);
else else
prefix().set("com"); prefix().set("com");
TSystemisamfile file(logicnum);
TFilename t; t.tempdir(); t << "/tr" << logicnum; TFilename t; t.tempdir(); t << "/tr" << logicnum;
TSystemisamfile file(logicnum);
if (file.dump(t) != NOERR) if (file.dump(t) != NOERR)
return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status()); return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status());
set_firm(to); set_firm(to);
TFilename s; s.tempdir(); s << "/sv" << logicnum; TFilename s; s.tempdir(); s << "/sv" << logicnum;

View File

@ -581,14 +581,14 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.focusdirty())
{ {
app().begin_wait();
TWait_cursor hourglass;
app().reset_choices(f.mask()); app().reset_choices(f.mask());
app().set_year(f.get()); app().set_year(f.get());
app().build_nomiditte(); app().build_nomiditte();
app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ? app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ?
(wht)atoi(f.mask().get(CG43_RDB_VERS)) : (wht)atoi(f.mask().get(CG43_RDB_VERS)) :
all); all);
app().end_wait();
} }
return TRUE; return TRUE;
} }
@ -731,13 +731,12 @@ bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key)
const bool change = (app()._month != 13 && m == 13) || (app()._month == 13 && m != 13); const bool change = (app()._month != 13 && m == 13) || (app()._month == 13 && m != 13);
if (change) if (change)
{ {
app().begin_wait(); TWait_cursor hourglass;
app().reset_choices(f.mask()); app().reset_choices(f.mask());
app().set_month(m); app().set_month(m);
app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ? app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ?
(wht)atoi(f.mask().get(CG43_RDB_VERS)) : (wht)atoi(f.mask().get(CG43_RDB_VERS)) :
all); all);
app().end_wait();
} }
} }
return TRUE; return TRUE;

View File

@ -863,11 +863,10 @@ bool TStampa_registri_app::year_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.focusdirty())
{ {
app().begin_wait(); TWait_cursor hourglass;
app().set_year(atoi(f.get())); app().set_year(atoi(f.get()));
app().build_nomiditte(); app().build_nomiditte();
app().build_ditte_sheet(); app().build_ditte_sheet();
app().end_wait();
} }
return TRUE; return TRUE;
} }

View File

@ -143,11 +143,11 @@ bool VersAcc_app::ch_year_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.focusdirty())
{ {
app().begin_wait(); TWait_cursor hourglass;
app()._year = atoi(f.get()); app()._year = atoi(f.get());
app().build_nomiditte(); app().build_nomiditte();
app().build_ditte_sheet(); app().build_ditte_sheet();
app().end_wait();
} }
return TRUE; return TRUE;
} }
@ -625,4 +625,4 @@ int cg4800(int argc, char* argv[])
VersAcc_app app; VersAcc_app app;
app.run(argc, argv, "Creazione versam. acconti dicembre"); app.run(argc, argv, "Creazione versam. acconti dicembre");
return 0; return 0;
} }

View File

@ -246,12 +246,11 @@ bool LiqAcc_app::ch_year_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.focusdirty())
{ {
app().begin_wait(); TWait_cursor hourglass;
app()._year = atoi(f.get()); app()._year = atoi(f.get());
app().build_nomiditte(); app().build_nomiditte();
app().build_ditte_sheet(); app().build_ditte_sheet();
app().reset_fields(); app().reset_fields();
app().end_wait();
} }
return TRUE; return TRUE;
} }

View File

@ -106,9 +106,6 @@ bool Visliq_app::destroy()
delete _del_tipo; delete _del_tipo;
delete _del_mese; delete _del_mese;
delete _del_ditta; delete _del_ditta;
delete _lim_r;
delete _lam_r;
delete _del_r;
delete _lim; delete _lim;
delete _lam; delete _lam;
delete _del; delete _del;

View File

@ -51,11 +51,10 @@ bool TRipristino_liq::ch_year_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.focusdirty())
{ {
app().begin_wait(); TWait_cursor hourglass;
app().set_year(f.get()); app().set_year(f.get());
app().build_nomiditte(); app().build_nomiditte();
app().build_ditte_sheet(); app().build_ditte_sheet();
app().end_wait();
} }
return TRUE; return TRUE;
} }

View File

@ -64,7 +64,7 @@ Item_05 = "Clienti/Fornitori", "cg0 -1", "F"
Item_06 = "Agenti", "pr0 -4", "" Item_06 = "Agenti", "pr0 -4", ""
Item_07 = "Cambi giornalieri", "ba3 -0 cam", "" Item_07 = "Cambi giornalieri", "ba3 -0 cam", ""
Item_08 = "Esercizi", "cg0 -5 esc", "F" Item_08 = "Esercizi", "cg0 -5 esc", "F"
Item_09 = "Commesse", "ba3 -0 cms", "" Item_09 = "CDC/Commesse", "ba3 -0 cms", ""
Item_10 = "Fasi commesse", "ba3 -0 fsc", "" Item_10 = "Fasi commesse", "ba3 -0 fsc", ""
[CGMENU_008] [CGMENU_008]
@ -78,6 +78,8 @@ Item_03 = "Causali", "cg1 -6", "F"
Item_04 = "Clienti/Fornitori", "cg1 -1", "F" Item_04 = "Clienti/Fornitori", "cg1 -1", "F"
Item_05 = "Cambi giornalieri", "ba3 -1 cam", "" Item_05 = "Cambi giornalieri", "ba3 -1 cam", ""
Item_06 = "IV direttiva CEE", "ba3 -7 D", "" Item_06 = "IV direttiva CEE", "ba3 -7 D", ""
Item_07 = "CDC/Commesse", "ba3 -1 cms", ""
Item_08 = "Fasi commesse", "ba3 -1 fsc", ""
[CGMENU_009] [CGMENU_009]
Caption = "Prima nota" Caption = "Prima nota"

View File

@ -441,7 +441,7 @@ TDistinta_expr::TDistinta_expr()
#define TREE_SEPARATOR '~' #define TREE_SEPARATOR '~'
const TRectype* TDistinta_tree::_curr = NULL; const TRectype* TDistinta_tree::_curr = NULL;
TToken_string TDistinta_tree::_tmp(80, TREE_SEPARATOR);
bool TDistinta_tree::isola_codice(TString& code) const bool TDistinta_tree::isola_codice(TString& code) const
@ -455,8 +455,8 @@ bool TDistinta_tree::isola_codice(TString& code) const
bool TDistinta_tree::father_code(TCodice_articolo& code) const bool TDistinta_tree::father_code(TCodice_articolo& code) const
{ {
const int it = _path.items(); const int it = _path.items();
_path.get(it - 2, _tmp); _path.get(it - 2, (TString &)_tmp);
isola_codice(_tmp); isola_codice((TString &)_tmp);
code = _tmp; code = _tmp;
return code.not_empty(); return code.not_empty();
} }
@ -464,7 +464,7 @@ bool TDistinta_tree::father_code(TCodice_articolo& code) const
bool TDistinta_tree::father_giaclev(TString& code, int levnum) const bool TDistinta_tree::father_giaclev(TString& code, int levnum) const
{ {
const int it = _path.items(); const int it = _path.items();
_path.get(it - 2, _tmp); _path.get(it - 2, (TString &) _tmp);
_tmp.get(1, code); _tmp.get(1, code);
if (levnum>0) if (levnum>0)
code = livgiac().unpack_grpcode(code, levnum).trim(); code = livgiac().unpack_grpcode(code, levnum).trim();
@ -473,15 +473,15 @@ bool TDistinta_tree::father_giaclev(TString& code, int levnum) const
bool TDistinta_tree::path_code(TCodice_articolo& code, const TToken_string &path) const bool TDistinta_tree::path_code(TCodice_articolo& code, const TToken_string &path) const
{ {
path.get(-2, _tmp); path.get(-2, (TString &)_tmp);
isola_codice(_tmp); isola_codice((TToken_string &)_tmp);
code = _tmp; code = _tmp;
return code.not_empty(); return code.not_empty();
} }
bool TDistinta_tree::path_giaclev(TString& code, int levnum, const TToken_string &path) const bool TDistinta_tree::path_giaclev(TString& code, int levnum, const TToken_string &path) const
{ {
path.get(-2, _tmp); path.get(-2, (TString &)_tmp);
_tmp.get(1, code); _tmp.get(1, code);
if (levnum>0) if (levnum>0)
code = livgiac().unpack_grpcode(code, levnum).trim(); code = livgiac().unpack_grpcode(code, levnum).trim();
@ -490,20 +490,20 @@ bool TDistinta_tree::path_giaclev(TString& code, int levnum, const TToken_string
int TDistinta_tree::curr_comp(TString& code) const int TDistinta_tree::curr_comp(TString& code) const
{ {
_path.get(-2, _tmp); _path.get(-2, (TString &)_tmp);
_tmp.get(2, code); _tmp.get(2, code);
return atoi(code); return atoi(code);
} }
long TDistinta_tree::curr_sort() const long TDistinta_tree::curr_sort() const
{ {
_path.get(-2, _tmp); _path.get(-2, (TString &)_tmp);
return _tmp.get_long(3); return ((TToken_string &)_tmp).get_long(3);
} }
const char* TDistinta_tree::curr_um(TCodice_um& code) const const char* TDistinta_tree::curr_um(TCodice_um& code) const
{ {
_path.get(-2, _tmp); _path.get(-2, (TString &)_tmp);
_tmp.get(4, code); _tmp.get(4, code);
return code; return code;
} }
@ -522,8 +522,8 @@ real TDistinta_tree::last_qta(bool vis_ghost) const
{ {
for (int i = from ; i >= 0; i--) for (int i = from ; i >= 0; i--)
{ {
_path.get(i, _tmp); _path.get(i, (TString &)_tmp);
if (_tmp.get_char(6) != 'G') if (((TToken_string &)_tmp).get_char(6) != 'G')
{ {
from = i + 1; from = i + 1;
break; break;
@ -535,7 +535,7 @@ real TDistinta_tree::last_qta(bool vis_ghost) const
for (int i = 0; i <= last; i++) for (int i = 0; i <= last; i++)
{ {
_path.get(i, _tmp); _path.get(i, (TString &) _tmp);
_tmp.get(5, val); _tmp.get(5, val);
_tmp.get(0, art); _tmp.get(0, art);
_tmp.get(4, um); _tmp.get(4, um);
@ -587,7 +587,7 @@ real TDistinta_tree::curr_qta() const
TQuantita qta; TQuantita qta;
for (int i = 0; i <= last; i++) for (int i = 0; i <= last; i++)
{ {
_path.get(i, _tmp); _path.get(i, (TString &) _tmp);
_tmp.get(5, val); _tmp.get(5, val);
// if (i < last) // if (i < last)
_tmp.get(0, art); _tmp.get(0, art);
@ -631,8 +631,8 @@ real TDistinta_tree::curr_qta() const
char TDistinta_tree::path_type(const TToken_string & path) const char TDistinta_tree::path_type(const TToken_string & path) const
{ {
path.get(-2, _tmp); path.get(-2, (TString &)_tmp);
char ap = _tmp.get_char(6); char ap = ((TToken_string &) _tmp).get_char(6);
return ap; return ap;
} }
@ -643,8 +643,8 @@ int TDistinta_tree::path_depth(const TToken_string & path) const
{ {
for (int i = depth; i > 0; i--) for (int i = depth; i > 0; i--)
{ {
path.get(i, _tmp); path.get(i, (TString &)_tmp);
char ap = _tmp.get_char(6); char ap = ((TToken_string &)_tmp).get_char(6);
if (ap == 'G') depth--; if (ap == 'G') depth--;
} }
} }
@ -715,7 +715,7 @@ TObject* TDistinta_tree::curr_node() const
const TString& TDistinta_tree::describe(const TCodice_articolo& codart) const const TString& TDistinta_tree::describe(const TCodice_articolo& codart) const
{ {
static TString80 descr; TString & descr = get_tmp_string();
describe(codart, descr); describe(codart, descr);
return descr; return descr;
} }
@ -894,12 +894,12 @@ bool TDistinta_tree::is_cyclic(const TToken_string& path) const
const int last = path.items()-1; const int last = path.items()-1;
if (last > 0) if (last > 0)
{ {
path.get(-2, _tmp); path.get(-2, (TString &)_tmp);
TCodice_articolo mycod; _tmp.get(0, mycod); mycod.trim(); TCodice_articolo mycod; _tmp.get(0, mycod); mycod.trim();
for (int i = last-1; i >= 0; i--) for (int i = last-1; i >= 0; i--)
{ {
path.get(i, _tmp); path.get(i, (TString &)_tmp);
isola_codice(_tmp); isola_codice((TToken_string &)_tmp);
if (_tmp == mycod) if (_tmp == mycod)
{ {
cyclic = TRUE; cyclic = TRUE;
@ -1393,7 +1393,7 @@ const TString& TDistinta_tree::get_string(const char* var)
} }
if (strcmp(var, "_RADICE")==0) if (strcmp(var, "_RADICE")==0)
{ {
static TString80 _codice; TString & _codice = get_tmp_string();
_codice = _root; _codice = _root;
isola_codice(_codice); isola_codice(_codice);
return _codice; return _codice;
@ -1695,8 +1695,8 @@ TCodgiac_livelli &TDistinta_tree::livgiac() const
} }
TDistinta_tree::TDistinta_tree() TDistinta_tree::TDistinta_tree()
: _sort(0), _max_depth(0), _ignore_ghost(FALSE), : _sort(0), _max_depth(0), _ignore_ghost(FALSE),
// _vars("VAR", "B0"), _mag(LF_ANAMAG, "DESCR"), _lav("LAV"), _livgiac(NULL),_qta_on_descr(FALSE),_descr_sep('-'),
_livgiac(NULL),_qta_on_descr(FALSE),_descr_sep('-') _tmp(80, TREE_SEPARATOR)
{ {
memset(_livgiac_on_descr, 0, sizeof(_livgiac_on_descr)); memset(_livgiac_on_descr, 0, sizeof(_livgiac_on_descr));
} }
@ -1780,7 +1780,7 @@ void TRiga_esplosione::init(const TDistinta_tree& tree, bool vis_ghost)
const char * TRiga_esplosione::father(const char * types) const char * TRiga_esplosione::father(const char * types)
{ {
static TString _tmp_path; TString & _tmp_path = get_tmp_string();
_tmp_path = _path; _tmp_path = _path;
while (TRUE) while (TRUE)

View File

@ -247,7 +247,7 @@ class TDistinta_tree : public TBidirectional_tree
TCodgiac_livelli *_livgiac; TCodgiac_livelli *_livgiac;
static const TRectype* _curr; static const TRectype* _curr;
static TToken_string _tmp; TToken_string _tmp;
TStack _stack; TStack _stack;
TAssoc_array _globals; TAssoc_array _globals;

View File

@ -1559,10 +1559,9 @@ bool TStampaDoc_application::tipocf_handler(TMask_field& f, KEY key)
{ {
if (f.to_check(key) && key == K_TAB) if (f.to_check(key) && key == K_TAB)
{ {
app().begin_wait(); TWait_cursor hourglass;
app().reset_choices(f.mask()); app().reset_choices(f.mask());
app().build_clifo_list(f.get()[0]); app().build_clifo_list(f.get()[0]);
app().end_wait();
} }
return TRUE; return TRUE;
} }

View File

@ -132,6 +132,8 @@ Item_09 = "Lingue", "ba3 -1 %lng", ""
Item_10 = "Divise", "ba3 -1 %val", "" Item_10 = "Divise", "ba3 -1 %val", ""
Item_11 = "Cambi giornalieri", "ba3 -1 CAM", "F" Item_11 = "Cambi giornalieri", "ba3 -1 CAM", "F"
Item_12 = "Esercizi", "ba3 -1 esc", "F" Item_12 = "Esercizi", "ba3 -1 esc", "F"
Item_13 = "CDC/Commesse", "ba3 -1 cms", "F"
Item_14 = "Fasi commesse", "ba3 -1 fsc", "F"
[ACQVEN_011] [ACQVEN_011]
Caption = "Stampa tabelle magazzino" Caption = "Stampa tabelle magazzino"

View File

@ -442,7 +442,7 @@ public:
virtual ~TAgenti_cache() { } virtual ~TAgenti_cache() { }
}; };
HIDDEN TAgenti_cache _agenti; HIDDEN TAgenti_cache * _agenti = NULL;
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Documento per vendite // Documento per vendite
@ -2307,8 +2307,10 @@ TOccasionale & TDocumento::occas() const
} }
const TAgente & TDocumento::agente() const const TAgente & TDocumento::agente() const
{ {
return _agenti.agente(get(DOC_CODAG)); if (_agenti == NULL)
_agenti = new TAgenti_cache;
return _agenti->agente(get(DOC_CODAG));
} }
TDocumento & TDocumento::copy(const TDocumento & d) TDocumento & TDocumento::copy(const TDocumento & d)

View File

@ -732,7 +732,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st
if (spesa) if (spesa)
{ {
const bool tipo_rit = _row->spesa().tipo_ritenuta(); const bool tipo_rit = _row->spesa().tipo_ritenuta() != 0;
if (tipo_rit != '\0') if (tipo_rit != '\0')
{ {

View File

@ -1522,8 +1522,8 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data )
send_cb = TRUE; send_cb = TRUE;
break; break;
case LM_CB_SELECT: case LM_CB_SELECT:
{ {
if ( lm_cb_data->row == 255 && lm_cb_data->column == 255 ) if ( lm_cb_data->row == 255 && lm_cb_data->column == 255 )
{ {
xiev.type = XIE_SELECT; xiev.type = XIE_SELECT;
xiev.v.select.xi_obj = lm_obj; xiev.v.select.xi_obj = lm_obj;
@ -1551,8 +1551,11 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data )
else else
{ {
XI_OBJ row_obj; XI_OBJ row_obj;
XI_MAKE_ROW( &row_obj, lm_obj, lm_cb_data->row ); XI_MAKE_ROW( &row_obj, lm_obj, lm_cb_data->row );
if (row_obj.parent == NULL)
xvt_debug_printf("AGA: lost parent");
xiev.type = XIE_SELECT; xiev.type = XIE_SELECT;
xiev.v.select.xi_obj = &row_obj; xiev.v.select.xi_obj = &row_obj;
xiev.v.select.selected = lm_cb_data->v.select.selected; xiev.v.select.selected = lm_cb_data->v.select.selected;

View File

@ -318,6 +318,9 @@ static unsigned long ComputeCRC(const char* strFile)
static void AddFileToZip(const wxString& strPrefix, const wxString& strFile, static void AddFileToZip(const wxString& strPrefix, const wxString& strFile,
wxFFileOutputStream& fout, wxFFileOutputStream& fdir) wxFFileOutputStream& fout, wxFFileOutputStream& fdir)
{ {
if (!wxFileExists(strFile))
return;
wxString strPath, strName, strExt; wxString strPath, strName, strExt;
wxSplitPath(strFile, &strPath, &strName, &strExt); wxSplitPath(strFile, &strPath, &strName, &strExt);
@ -334,25 +337,27 @@ static void AddFileToZip(const wxString& strPrefix, const wxString& strFile,
const unsigned long dwLocalSignature = 0x04034B50; const unsigned long dwLocalSignature = 0x04034B50;
fout.Write(&dwLocalSignature, sizeof(dwLocalSignature)); // Scrivo PK34 fout.Write(&dwLocalSignature, sizeof(dwLocalSignature)); // Scrivo PK34
ZipLocalFileHeader zlfh; memset(&zlfh, 0, sizeof(zlfh)); ZipLocalFileHeader zlfh; memset(&zlfh, 0, sizeof(zlfh));
zlfh.nVersionNeeded = 0x10; // You need at least pkunzip 1.0 zlfh.nVersionNeeded = 20; // You need at least pkunzip 2.0
zlfh.nFlags = 0x0002; // Deep Hacking ???
zlfh.nMethod = 8; // Implode zlfh.nMethod = 8; // Implode
zlfh.nNameLength = strRelName.Length(); zlfh.nNameLength = strRelName.Length();
fout.Write(&zlfh, sizeof(zlfh)); // Scrivo header azzerato fout.Write(&zlfh, sizeof(zlfh)); // Scrivo header azzerato
fout.Write((const char*)strRelName, zlfh.nNameLength); // Scrivo nome file fout.Write((const char*)strRelName, zlfh.nNameLength); // Scrivo nome file
const off_t nDataStart = fout.TellO(); // Memorizzo posizione dati compressi const off_t nDataStart = fout.TellO(); // Memorizzo posizione dati compressi
if (wxFileExists(strFile)) const int nMagicOffset = -4; // Deep hacking :-)
{ {
wxFFileInputStream fin(strFile); wxFFileInputStream fin(strFile);
AgaZlibOutputStream zout(fout, zlfh.nMethod); AgaZlibOutputStream zout(fout, 9);
zout.Write(fin); // Scrivo file compresso zout.Write(fin); // Scrivo file compresso
zlfh.dwUncompressedSize = fin.TellI(); zlfh.dwUncompressedSize = fin.TellI();
} }
const int nMagicOffset = -5; // Deep hacking :-)
fout.SeekO(nMagicOffset, wxFromEnd); fout.SeekO(nMagicOffset, wxFromEnd);
zlfh.dwCompressedSize = fout.TellO() - nDataStart; zlfh.dwCompressedSize = fout.TellO();
zlfh.dwCompressedSize -= nDataStart;
zlfh.dwCRC = ComputeCRC(strFile); zlfh.dwCRC = ComputeCRC(strFile);
const time_t tMod = ::wxFileModificationTime(strFile); const time_t tMod = ::wxFileModificationTime(strFile);
@ -365,11 +370,11 @@ static void AddFileToZip(const wxString& strPrefix, const wxString& strFile,
fout.SeekO(nStartPos+sizeof(dwLocalSignature), wxFromStart); fout.SeekO(nStartPos+sizeof(dwLocalSignature), wxFromStart);
fout.Write(&zlfh, sizeof(zlfh)); fout.Write(&zlfh, sizeof(zlfh));
fout.Write((const char*)strRelName, strRelName.Length()); // fout.Write((const char*)strRelName, strRelName.Length());
// Deep Hacking Here! // Deep Hacking Here!
const wxByte pkHeader = 0x2b; // const wxByte pkHeader = 0x85;
fout.Write(&pkHeader, 1); // fout.Write(&pkHeader, 1);
fout.SeekO(nMagicOffset, wxFromEnd); fout.SeekO(nMagicOffset, wxFromEnd);
@ -436,12 +441,13 @@ bool aga_zip(const char* srcfiles, const char* zipfile)
wxStringList aFiles; wxStringList aFiles;
AddFilesToList(strBase, strMask, aFiles); AddFilesToList(strBase, strMask, aFiles);
return AddFilesToZip(strBase, aFiles, zipfile); return AddFilesToZip(strBase, aFiles, zipfile);
} }
bool aga_zip_filelist(const char* filelist, const char* zipfile) bool aga_zip_filelist(const char* filelist, const char* zipfile)
{ {
wxStringList aFiles; wxStringList aFiles;
ifstream fin(filelist); ifstream fin(filelist);
while (!fin.eof()) while (!fin.eof())
{ {

View File

@ -17,7 +17,6 @@
// Funzione di utilita' // Funzione di utilita'
MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m); MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m);
#ifdef WIN32 #ifdef WIN32
#include "oswin32.h" #include "oswin32.h"
#endif #endif
@ -233,7 +232,7 @@ void TwxCaret::Toggle()
xvt_dwin_set_cpen(_owner, &pen); xvt_dwin_set_cpen(_owner, &pen);
xvt_dwin_set_draw_mode(_owner, M_COPY); xvt_dwin_set_draw_mode(_owner, M_COPY);
xvt_dwin_draw_set_pos(_owner, _pos); xvt_dwin_draw_set_pos(_owner, _pos);
PNT p = _pos; p.v -= _size.y; PNT p = _pos; p.v -= _size.y-1;
xvt_dwin_set_clip(_owner, NULL); // Non si mai! xvt_dwin_set_clip(_owner, NULL); // Non si mai!
xvt_dwin_draw_line(_owner, p); xvt_dwin_draw_line(_owner, p);
@ -675,6 +674,8 @@ void TwxWindow::DoXvtEvent(EVENT& e)
void TwxWindow::OnChar(wxKeyEvent& event) void TwxWindow::OnChar(wxKeyEvent& event)
{ {
static bool bDot2Comma = FALSE;
EVENT e; memset(&e, 0, sizeof(EVENT)); EVENT e; memset(&e, 0, sizeof(EVENT));
e.type = E_CHAR; e.type = E_CHAR;
int k = event.GetKeyCode(); int k = event.GetKeyCode();
@ -683,9 +684,22 @@ void TwxWindow::OnChar(wxKeyEvent& event)
{ {
case WXK_ALT: case WXK_ALT:
case WXK_MENU: case WXK_MENU:
case WXK_NUMPAD0:
case WXK_NUMPAD1:
case WXK_NUMPAD2:
case WXK_NUMPAD3:
case WXK_NUMPAD4:
case WXK_NUMPAD5:
case WXK_NUMPAD6:
case WXK_NUMPAD7:
case WXK_NUMPAD8:
case WXK_NUMPAD9:
event.Skip();
return;
case WXK_NUMPAD_DECIMAL: // ??? Non arriva mai case WXK_NUMPAD_DECIMAL: // ??? Non arriva mai
case WXK_DECIMAL: // ??? Arriva sia '.' sia WXK_DECIMAL=340 case WXK_DECIMAL: // ??? Arriva sia '.' sia WXK_DECIMAL=340
event.Skip(); event.Skip();
bDot2Comma = TRUE;
return; return;
case WXK_DOWN : k = K_DOWN; break; case WXK_DOWN : k = K_DOWN; break;
case WXK_LEFT : k = K_LEFT; break; case WXK_LEFT : k = K_LEFT; break;
@ -697,6 +711,13 @@ void TwxWindow::OnChar(wxKeyEvent& event)
if (event.ShiftDown()) if (event.ShiftDown())
k = K_BTAB; k = K_BTAB;
break; break;
case '.':
if (bDot2Comma)
{
k = ',';
bDot2Comma = FALSE;
}
break;
default: default:
if (k >= WXK_F1 && k <= WXK_F24) if (k >= WXK_F1 && k <= WXK_F24)
k = K_F1 + k - WXK_F1; k = K_F1 + k - WXK_F1;
@ -1762,12 +1783,11 @@ void xvt_dwin_draw_line(WINDOW win, PNT pnt)
void xvt_dwin_update(WINDOW win) void xvt_dwin_update(WINDOW win)
{ {
/* // "sembra" che non serva ad un fico secco, ma serve!
#ifdef WIN32 #ifdef WIN32
CAST_TWIN(win, w); CAST_TWIN(win, w);
OsWin32_UpdateWindow(w.GetHWND()); // "sembra" che non serva ad un fico secco OsWin32_UpdateWindow(w.GetHWND());
#endif #endif
*/
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -2148,7 +2168,7 @@ XVT_IMAGE xvt_image_read(const char* filenamep)
XVT_IMAGE xvt_image_read_bmp(const char *filenamep) XVT_IMAGE xvt_image_read_bmp(const char *filenamep)
{ {
return xvt_image_read(filenamep); return xvt_image_read(filenamep); // Very clever!
} }
void xvt_image_set_clut(XVT_IMAGE image, short index, COLOR color) void xvt_image_set_clut(XVT_IMAGE image, short index, COLOR color)
@ -2668,7 +2688,9 @@ void xvt_sbar_set_range(WINDOW win, SCROLL_TYPE t, int min, int max)
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
void xvt_scr_beep(void) void xvt_scr_beep(void)
{ wxBell(); } {
wxBell();
}
WINDOW xvt_scr_get_focus_topwin(void) WINDOW xvt_scr_get_focus_topwin(void)
{ {