Patch level : aga 2.0 413

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
vedi precedente


git-svn-id: svn://10.65.10.50/trunk@10858 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2003-02-25 15:22:52 +00:00
parent 31753bf353
commit a579d70664
21 changed files with 1309 additions and 471 deletions

View File

@ -703,7 +703,7 @@ END
BOOLEAN CHK_AGIU2_VARDEN
BEGIN
PROMPT 29 10 "Variata denominazione"
PROMPT 31 10 "Variata denominazione"
FIELD LF_ANAGGIU->VARDEN
HELP "Indicare se e' variata la denominazione della persona giuridica"
END

File diff suppressed because it is too large Load Diff

View File

@ -113,15 +113,15 @@ int CG1700_application::stampa_intestazione_ditta()
get_dati_ditta();
codice_ditta << get_firm();
set_header (r, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta,
set_header (r, FR("Ditta %s %s %s %s %s %s"), (const char*)codice_ditta,
(const char*)_ragsoc, (const char*)_viafis,
(const char*)_cap, (const char*)_comunefis,
(const char*)_provfis);
r++;
printer().setdate(_data);
riga = "Data @> Pag. @#";
riga = FR("Data @> Pag. @#");
riga.right_just(125);
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
riga.overwrite (format (FR("Partita iva %s Codice fiscale %s"), (const char*)_paiva, (const char*)_cofi));
set_header (r, "%s", (const char*) riga);
r++;
@ -136,15 +136,13 @@ void CG1700_application::preprocess_header()
reset_header();
r = stampa_intestazione_ditta();
set_header(r, "ELENCO CAUSALI");
set_header(r, TR("ELENCO CAUSALI"));
r++;
riga.fill('-');
set_header(r++, (const char*) riga);
//riga = "";
//set_header(r, (const char*) riga);
set_header(r++, "@5gDescrizione@30gTipo Codice@55gDescrizione@80gDes Reg. All. Mod Ges Num Data Cau Op Val Fat");
set_header(r++, "Cod. Causale@30gDoc. Conto@51gD/A Conto @80gAgg IVA IVA 770 Cesp Sal Doc Doc Rif Int Int Rit");
set_header(r++, FR("@5gDescrizione@30gTipo Codice@55gDescrizione@80gDes Reg. All. Mod Ges Num Data Cau Op Val Fat"));
set_header(r++, FR("Cod. Causale@30gDoc. Conto@51gD/A Conto @80gAgg IVA IVA 770 Cesp Sal Doc Doc Rif Int Int Rit"));
set_header(r++, (const char*) riga);
}
@ -156,10 +154,10 @@ bool CG1700_application::preprocess_print(int file, int counter)
reset_print();
if (current_cursor()->items() == 0)
{
warning_box ("Non ci sono causali. La stampa e' annullata");
warning_box (TR("Non ci sono causali. La stampa e' annullata"));
return FALSE;
}
set_wait_message("Stampa in corso");
set_wait_message(TR("Stampa in corso"));
break;
case LF_RCAUSALI:
break;
@ -318,7 +316,7 @@ bool CG1700_application::user_destroy()
int cg1700(int argc, char* argv[])
{
CG1700_application a;
a.run(argc, argv, "Stampa causali");
a.run(argc, argv, TR("Stampa causali"));
return 0;
}

View File

@ -33,7 +33,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 = NORMAL_BACK_COLOR;
COLOR REQUIRED_BACK_COLOR = MAKE_COLOR(255,255,216);
bool CAMPI_SCAVATI = TRUE;
bool AUTOSELECT = FALSE;
@ -2369,4 +2369,4 @@ TListbox_control::TListbox_control(WINDOW win, short cid,
TListbox_control::~TListbox_control()
{
delete _ddl;
}
}

View File

@ -1997,7 +1997,7 @@ int TSystemisamfile::update(
TTrec oldrec;
oldrec.get(num());
const int lenr = wrec.len();
int lenr = wrec.len();
if (lenr != 0)
{
@ -2029,6 +2029,31 @@ int TSystemisamfile::update(
}
}
const int oldfields = oldrec.fields();
int wfields = wrec.fields();
int newfields = wfields;
TToken_string def;
for (int j = 0; j < oldfields; j++)
{
def = oldrec.fielddef(j);
if (def.get(0)[0] == '_')
{
if (newfields < MaxFields)
wrec.update_fielddef(++newfields, def);
else
if(!yesnofatal_box("Il campo %s non verra' preservato, devo continuare",
(const char *) def.get(0)))
return NOERR;
}
}
if (wfields < newfields)
{
wrec.set_fields(newfields);
wrec.rehash();
lenr = wrec.len();
}
TFilename fname;
if (toconvert)
fname = filename();
@ -2062,8 +2087,8 @@ int TSystemisamfile::update(
return err;
}
TString s(80);
s.format("Aggiornamento archivio %s\nTempo stimato alla fine del processo: ", (const char*) fname);
TString s(256);
s.format("Aggiornamento archivio %s", (const char*) fname);
const TRecnotype nitems = items();
TProgind p(nitems > 0 ? nitems : 1, s, FALSE, TRUE, 70);
@ -2122,13 +2147,13 @@ int TSystemisamfile::update(
if (err != NOERR)
err=get_error(err);
setstatus(err);
/* Obsoleto con le nuove barre
if (tick)
{
const clock_t elapsed_ticks = clock() - start_time;
const clock_t total_ticks = elapsed_ticks * nitems / ni;
const clock_t estimated_ticks = total_ticks - elapsed_ticks;
long secs = estimated_ticks / CLOCKS_PER_SEC;
unsigned long secs = estimated_ticks / CLOCKS_PER_SEC;
CHECK(secs >= 0, "Bad time estimation");
const int hours = int(secs / 3600L);
secs %= 3600L;
@ -2139,6 +2164,7 @@ int TSystemisamfile::update(
s << format("%02d:%02d:%02ld", hours, mins, secs);
p.set_text(s);
}
*/
}
close();
prefix().close_isamfile(ishandle);
@ -2463,18 +2489,13 @@ int TSystemisamfile::load(
{
s1.rtrim(1);
s1.ltrim(1);
}
if (curr().type((const TString&) fld[j]) == _memofld)
{
TString s2 = s1;
s1 = esc(s2);
s1 = esc(s2);
}
put((const TString&) fld[j], s1);
}
}

View File

@ -3649,38 +3649,38 @@ const char* TDate_field::win2raw(
bool ok = TRUE;
TDate g(TODAY);
s.upper();
if (s == "IERI")
if (s[0] == 'I') // "IERI"
{
--g;
} else
if (s == "DOMANI")
if (s[0] == 'D') // "DOMANI"
{
++g;
} else
if (s == "POSDOMANI")
if (s.starts_with("PO")) // "POSDOMANI"
{
g += 2;
} else
if (s == "ALTROIERI")
if (s[0] == 'A') // s == "ALTROIERI"
{
g -= 2;
} else
if (s == "PRIMO")
if (s[0] == 'P') // s == "PRIMO"
{
g.set_month(1);
g.set_day(1);
} else
if (s == "NATALE")
if (s[0] == 'N') // s == "NATALE"
{
g.set_month(12);
g.set_day(25);
} else
if (s == "ULTIMO")
if (s[0] == 'U') //s == "ULTIMO"
{
g.set_month(12);
g.set_day(31);
} else
if (s != "OGGI")
if (s[0] != 'O') // s != "OGGI"
ok = FALSE;
if (ok)
s = g.string();

View File

@ -1613,6 +1613,7 @@ public:
void set_header(const char* head);
void set_row_height(int rh);
TTree_field(TMask* m) : TWindowed_field(m) { }
virtual ~TTree_field() { }
};
@ -1637,4 +1638,4 @@ public:
virtual ~TGolem_client_field();
};
#endif // __MASKFLD_H
#endif // __MASKFLD_H

View File

@ -1007,7 +1007,6 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
static char tmp[16];
static clock_t digit_timer = 0;
BOOLEAN& refused = xiev->refused;
@ -1110,9 +1109,6 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
xiev->v.cell_request.color, rec, col);
if (xiev->v.cell_request.back_color == 0 && f->required())
xiev->v.cell_request.back_color = REQUIRED_BACK_COLOR;
}
@ -3206,4 +3202,4 @@ void TSheet_field::set_userget(SHEET_USERGETPUT handler)
void TSheet_field::set_userput(SHEET_USERGETPUT handler)
{
_userput = handler;
}
}

View File

@ -712,7 +712,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
msg << (size / 1024) << " K";
else
msg << size << ' ';
msg << "bytes.\nTempo residuo stimato: ";
msg << "bytes.";
TProgind pi(size, msg, TRUE, TRUE);
long total = 0;
@ -729,7 +729,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
bool tick = pi.setstatus(total);
if (pi.iscancelled())
break;
/* Obsoleto con le nuove barre
if (tick)
{
const double estimated_ticks = double(size - total) * double(clock() - start) / total;
@ -746,6 +746,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
msg << tempo;
pi.set_text(msg);
}
*/
}
}
ok = pi.isfinished();

566
include/odbc_loc.cpp Executable file
View File

@ -0,0 +1,566 @@
#include <wx/wx.h>
#include <wx/db.h>
#include <wx/mstream.h>
#include <codeb.h>
///////////////////////////////////////////////////////////
// TDataBase
///////////////////////////////////////////////////////////
class TDataBase
{
wxDbConnectInf m_ci;
wxDb* m_db;
public:
bool Open(const wxString& dsn, const wxString& user,
const wxString& password, const wxString& path);
bool IsOpen() const;
void Close();
wxDb& DataBase() { return *m_db; }
TDataBase();
virtual ~TDataBase();
};
bool TDataBase::Open(const wxString& dsn, const wxString& user,
const wxString& password, const wxString& path)
{
Close();
m_ci.SetDsn(dsn);
m_ci.SetUserID(user);
m_ci.SetPassword(password);
m_ci.SetDefaultDir(path);
if (m_ci.AllocHenv())
{
m_db = ::wxDbGetConnection(&m_ci, false); // Forward only?
if (m_db == NULL)
m_ci.FreeHenv();
}
return IsOpen();
}
void TDataBase::Close()
{
if (m_db)
{
m_db->SetSqlLogging(sqlLogOFF);
::wxDbFreeConnection(m_db);
m_db = NULL;
m_ci.FreeHenv();
}
}
bool TDataBase::IsOpen() const
{
return m_db != NULL;
}
TDataBase::TDataBase(), m_db(NULL)
{
m_ci.Henv = 0;
DeleteContents(true);
}
TDataBase::~TDataBase()
{
Close();
}
///////////////////////////////////////////////////////////
// TDataBaseList
///////////////////////////////////////////////////////////
class TDataBaseList : public wxHashTable
{
wxString m_strUser, m_strPassword;
protected:
wxString& User();
wxString& Password();
public:
TDataBase& db(const wxString& path);
TDataBaseList() : wxHashTable(wxKEY_STRING) { }
};
static DataBaseList theDataBaseList;
wxString& TDataBaseList::User()
{
if (m_strUser.IsEmpty())
{
// TBI Read user and password
}
return m_strUser;
}
wxString& TDataBaseList::Password()
{
if (m_strPassword.Isempty())
User(); // Initialize both User and Password
return m_strPassword;
}
wxString& TDataBaseList::Dsn(const wxString& dbpath)
{
wxString study;
long firm = -1;
for (int i = dbpath.GetLength()-1; i >= 0; i--)
if (dbpath[i] == '\\' || dbpath[i] == '/')
{
firm = atol(dbpath.Mid(i+1));
break;
}
for (int j = i-1; j >= 0; j--)
if (dbpath[j] == '\\' || dbpath[j] == '/')
{
study = dbpath.Mid(j+1, i-j);
break;
}
wxString dsn = study;
if (firm > 0)
dsn << firm;
return dsn;
}
TDataBase& TDataBaseList::db(const wxString& dbpath)
{
wxString dsn = Dsn(dbpath);
TDataBase* d = (TDataBase*)Get(dsn);
if (d == NULL)
{
d = new TDataBase;
Put(dsn, d);
bool ok = d->Open(dsn, User(), Password(), dbpath);
if (!ok)
{
wxString msg = wxString::Format("L'utente %s non è abilitato all'uso del database %s\n"
"corrispondente agli archivi in %s",
User(), dsn, dbpath);
wxMessageBox(msg, "Errore");
exit(0);
}
}
return *d;
}
/*--------------------------------------------------------------------------
inizializzazione di CodeBase e delle variabili necessarie
questa funzione deve essere chiamata SOLO una volta all'interno
di ciascun eseguibile
--------------------------------------------------------------------------*/
void DB_init(void)
{
}
/*--------------------------------------------------------------------------
reset di CodeBase
questa funzione dovrebbe essere chiamata prima di uscire da un eseguibile
per una questione di correttezza formale. Non usandola comunque non acca-
de niente di drammatico
--------------------------------------------------------------------------*/
void DB_exit(void)
{
::wxDbCloseConnections();
}
/*-------------------------------------------------------------------------
apertura del file 'filename'. Il parametro mode consente se != 0 l'apertura
esclusiva. Il parametro index consente se == 0 l'apertura senza indici.
Ritorna l'handle del file aperto oppure -1 in caso di errore
--------------------------------------------------------------------------*/
int DB_open(const char *filename,int mode,int index)
{
return -1;
}
/*-------------------------------------------------------------------------
chiusura del database inviduato da handle
torna -1 se il database non puo essere chiuso, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_close(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
torna il puntatore al buffer del record del database individuato da
handle. In caso di errore torna (char *) 0
--------------------------------------------------------------------------*/
char *DB_getrecord(int handle)
{
return NULL;
}
/*-------------------------------------------------------------------------
torna la lunghezza del record
--------------------------------------------------------------------------*/
int DB_reclen(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna la lunghezza della chiave corrente
--------------------------------------------------------------------------*/
int DB_keylen(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
torna il numero del record attuale
--------------------------------------------------------------------------*/
long int DB_recno(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna il numero complessivo dei records presenti nell'archivio
--------------------------------------------------------------------------*/
long int DB_reccount(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
seleziona un indice sul database specificato
torna -1 se errore, altrimenti 0
--------------------------------------------------------------------------*/
int DB_tagselect(int handle,int index_no)
{
return -1;
}
/*-------------------------------------------------------------------------
torna il numero dell'indice selezionato
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_tagget(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
si posiziona sul primo record
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_first(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
si posiziona sull'ultimorecord
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_last(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip avanti di un record
--------------------------------------------------------------------------*/
int DB_next(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip indietro di un record
--------------------------------------------------------------------------*/
int DB_prev(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip di n records
--------------------------------------------------------------------------*/
int DB_skip(int handle,long int recno)
{
return -1;
}
/*-------------------------------------------------------------------------
locka il record attuale
--------------------------------------------------------------------------*/
int DB_lock(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
slocka il record attuale
--------------------------------------------------------------------------*/
int DB_unlock(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
cerca la chiave, torna r4after se not found ma si e' posizionato sul record
successivo, se torna r4eof e' su eof
--------------------------------------------------------------------------*/
int DB_seek(int handle,char *key)
{
return -1;
}
/*-------------------------------------------------------------------------
torna 1 se eof, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_eof(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna 1 se tof, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_bof(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
legge un record per numero record
--------------------------------------------------------------------------*/
int DB_go(int handle,long recno)
{
return -1;
}
/*-------------------------------------------------------------------------
cancella il record attuale. Non cancella le chiavi.
--------------------------------------------------------------------------*/
int DB_delete(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
ripristina il record attuale
--------------------------------------------------------------------------*/
int DB_recall(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
--------------------------------------------------------------------------*/
int DB_flush(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
riscrive il record attuale
--------------------------------------------------------------------------*/
int DB_rewrite(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
appende il record attuale
--------------------------------------------------------------------------*/
int DB_add(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
Blocca in modo esclusivo il file dati ed indice
--------------------------------------------------------------------------*/
int DB_lockfile(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
Compatta il file dati
--------------------------------------------------------------------------*/
int DB_packfile(short vis, const char * filename, long eod)
{
return 0;
}
/*-------------------------------------------------------------------------
Compatta il file memo
--------------------------------------------------------------------------*/
int DB_packmemo(short vis, const char * filename)
{
return 0;
}
/*-------------------------------------------------------------------------
Elimina i record duplicati
--------------------------------------------------------------------------*/
int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
{
return -1;
}
/*-------------------------------------------------------------------------
Compatta gli indici
--------------------------------------------------------------------------*/
int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool ask)
{
return 0;
}
/*-------------------------------------------------------------------------
costruisce il file filename
--------------------------------------------------------------------------*/
int DB_build(const char * filename, RecDes *r)
{
return -1;
}
/*-------------------------------------------------------------------------
reperisce il tracciato record e la stringa di definizione delle chiavi
Stringa di definizione chiavi:
expression1|unique1$expression2|unique2$expression3|unique3
--------------------------------------------------------------------------*/
int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys)
{
return -1;
}
/*-------------------------------------------------------------------------
ritorna l'ultimo errore
--------------------------------------------------------------------------*/
int DB_get_error(void)
{
return 0;
}
/*-------------------------------------------------------------------------
Azzera la viarabile globale d'errore
--------------------------------------------------------------------------*/
void DB_zero_error(void)
{
}
/*-------------------------------------------------------------------------
Si posiziona sull'indice attivo alla chiave indicata, restituisce
la prima chiave che trova >= a from. (TCursor)
--------------------------------------------------------------------------*/
int DB_index_seek(int handle, char* from)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna il numero di record corrispondente alla chiave corrente
--------------------------------------------------------------------------*/
long DB_index_recno(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Si posiziona sulla chiave successiva dell'indice corrente
--------------------------------------------------------------------------*/
long DB_index_next(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Restituisce la chiave corrente
--------------------------------------------------------------------------*/
char* DB_index_getkey(int handle)
{
return NULL;
}
/*-------------------------------------------------------------------------
Restituisce vero se l'indice e' alla fine
--------------------------------------------------------------------------*/
int DB_index_eof(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Blocca il record indicato
--------------------------------------------------------------------------*/
int DB_lock_rec(int handle,long nrec)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna vero(non zero) se il file dati od indice sono stati bloccati
in modo esclusivo dalla presente applicazione, non da altri programmi!!!
--------------------------------------------------------------------------*/
int DB_file_locked(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna vero se il record nrec e' bloccato dalla presente applicazione,
non da altri programmi!!!
--------------------------------------------------------------------------*/
int DB_rec_locked(int handle,long nrec)
{
return 0;
}
/*-------------------------------------------------------------------------
restituisce la configurazione della libreria
--------------------------------------------------------------------------*/
long DB_getconf()
{
return 0;
}
/*-------------------------------------------------------------------------
Restituisce il numero di versione scritto sull'header dell'indice
--------------------------------------------------------------------------*/
long DB_changed(int handle)
{
return 0;
}
char* DB_memoptr( const int handle, const char * fieldname )
{
return NULL;
}
int DB_memowrite( const int handle, const char * fieldname, const char * data )
{
return NULL;
}

419
include/odbc_nul.cpp Executable file
View File

@ -0,0 +1,419 @@
#include <codeb.h>
#define MAXLEN 137 /* Lunghezza massima chiave */
/*--------------------------------------------------------------------------
inizializzazione di CodeBase e delle variabili necessarie
questa funzione deve essere chiamata SOLO una volta all'interno
di ciascun eseguibile
--------------------------------------------------------------------------*/
void DB_init(void)
{
}
/*--------------------------------------------------------------------------
reset di CodeBase
questa funzione dovrebbe essere chiamata prima di uscire da un eseguibile
per una questione di correttezza formale. Non usandola comunque non acca-
de niente di drammatico
--------------------------------------------------------------------------*/
void DB_exit(void)
{
}
/*-------------------------------------------------------------------------
apertura del file 'filename'. Il parametro mode consente se != 0 l'apertura
esclusiva. Il parametro index consente se == 0 l'apertura senza indici.
Ritorna l'handle del file aperto oppure -1 in caso di errore
--------------------------------------------------------------------------*/
int DB_open(const char *filename,int mode,int index)
{
return -1;
}
/*-------------------------------------------------------------------------
chiusura del database inviduato da handle
torna -1 se il database non puo essere chiuso, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_close(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
torna il puntatore al buffer del record del database individuato da
handle. In caso di errore torna (char *) 0
--------------------------------------------------------------------------*/
char *DB_getrecord(int handle)
{
return NULL;
}
/*-------------------------------------------------------------------------
torna la lunghezza del record
--------------------------------------------------------------------------*/
int DB_reclen(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna la lunghezza della chiave corrente
--------------------------------------------------------------------------*/
int DB_keylen(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
torna il numero del record attuale
--------------------------------------------------------------------------*/
long int DB_recno(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna il numero complessivo dei records presenti nell'archivio
--------------------------------------------------------------------------*/
long int DB_reccount(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
seleziona un indice sul database specificato
torna -1 se errore, altrimenti 0
--------------------------------------------------------------------------*/
int DB_tagselect(int handle,int index_no)
{
return -1;
}
/*-------------------------------------------------------------------------
torna il numero dell'indice selezionato
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_tagget(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
si posiziona sul primo record
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_first(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
si posiziona sull'ultimorecord
torna -1 se errore
--------------------------------------------------------------------------*/
int DB_last(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip avanti di un record
--------------------------------------------------------------------------*/
int DB_next(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip indietro di un record
--------------------------------------------------------------------------*/
int DB_prev(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
skip di n records
--------------------------------------------------------------------------*/
int DB_skip(int handle,long int recno)
{
return -1;
}
/*-------------------------------------------------------------------------
locka il record attuale
--------------------------------------------------------------------------*/
int DB_lock(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
slocka il record attuale
--------------------------------------------------------------------------*/
int DB_unlock(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
cerca la chiave, torna r4after se not found ma si e' posizionato sul record
successivo, se torna r4eof e' su eof
--------------------------------------------------------------------------*/
int DB_seek(int handle,char *key)
{
return r4eof;
}
/*-------------------------------------------------------------------------
torna 1 se eof, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_eof(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
torna 1 se tof, 0 altrimenti
--------------------------------------------------------------------------*/
int DB_bof(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
legge un record per numero record
--------------------------------------------------------------------------*/
int DB_go(int handle,long recno)
{
return -1;
}
/*-------------------------------------------------------------------------
cancella il record attuale. Non cancella le chiavi.
--------------------------------------------------------------------------*/
int DB_delete(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
ripristina il record attuale
--------------------------------------------------------------------------*/
int DB_recall(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
--------------------------------------------------------------------------*/
int DB_flush(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
riscrive il record attuale
--------------------------------------------------------------------------*/
int DB_rewrite(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
appende il record attuale
--------------------------------------------------------------------------*/
int DB_add(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
Blocca in modo esclusivo il file dati ed indice
--------------------------------------------------------------------------*/
int DB_lockfile(int handle)
{
return -1;
}
/*-------------------------------------------------------------------------
Compatta il file dati
--------------------------------------------------------------------------*/
int DB_packfile(short vis, const char * filename, long eod)
{
return 0;
}
/*-------------------------------------------------------------------------
Compatta il file memo
--------------------------------------------------------------------------*/
int DB_packmemo(short vis, const char * filename)
{
return 0;
}
/*-------------------------------------------------------------------------
Elimina i record duplicati
--------------------------------------------------------------------------*/
int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
{
return -1;
}
/*-------------------------------------------------------------------------
Compatta gli indici
--------------------------------------------------------------------------*/
int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool ask)
{
return 0;
}
/*-------------------------------------------------------------------------
costruisce il file filename
--------------------------------------------------------------------------*/
int DB_build(const char * filename, RecDes *r)
{
return -1;
}
/*-------------------------------------------------------------------------
reperisce il tracciato record e la stringa di definizione delle chiavi
Stringa di definizione chiavi:
expression1|unique1$expression2|unique2$expression3|unique3
--------------------------------------------------------------------------*/
int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys)
{
return -1
}
/*-------------------------------------------------------------------------
ritorna l'ultimo errore
--------------------------------------------------------------------------*/
int DB_get_error(void)
{
return 0
}
/*-------------------------------------------------------------------------
Azzera la viarabile globale d'errore
--------------------------------------------------------------------------*/
void DB_zero_error(void)
{
}
/*-------------------------------------------------------------------------
Si posiziona sull'indice attivo alla chiave indicata, restituisce
la prima chiave che trova >= a from. (TCursor)
--------------------------------------------------------------------------*/
int DB_index_seek(int handle, char* from)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna il numero di record corrispondente alla chiave corrente
--------------------------------------------------------------------------*/
long DB_index_recno(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Si posiziona sulla chiave successiva dell'indice corrente
--------------------------------------------------------------------------*/
long DB_index_next(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Restituisce la chiave corrente
--------------------------------------------------------------------------*/
char* DB_index_getkey(int handle)
{
return NULL;
}
/*-------------------------------------------------------------------------
Restituisce vero se l'indice e' alla fine
--------------------------------------------------------------------------*/
int DB_index_eof(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Blocca il record indicato
--------------------------------------------------------------------------*/
int DB_lock_rec(int handle,long nrec)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna vero(non zero) se il file dati od indice sono stati bloccati
in modo esclusivo dalla presente applicazione, non da altri programmi!!!
--------------------------------------------------------------------------*/
int DB_file_locked(int handle)
{
return 0;
}
/*-------------------------------------------------------------------------
Ritorna vero se il record nrec e' bloccato dalla presente applicazione,
non da altri programmi!!!
--------------------------------------------------------------------------*/
int DB_rec_locked(int handle,long nrec)
{
return 0;
}
/*-------------------------------------------------------------------------
restituisce la configurazione della libreria
--------------------------------------------------------------------------*/
long DB_getconf()
{
return 0;
}
/*-------------------------------------------------------------------------
Restituisce il numero di versione scritto sull'header dell'indice
--------------------------------------------------------------------------*/
long DB_changed(int handle)
{
return 0;
}
char* DB_memoptr( const int handle, const char * fieldname )
{
return NULL;
}
int DB_memowrite( const int handle, const char * fieldname, const char * data )
{
return NULL;
}

View File

@ -26,7 +26,7 @@ word TIndwin::measure_text(TToken_string& s, word& maxlen) const
// Certified 70%
TIndwin::TIndwin(long max, const char* txt, bool cancel, bool bar, int div)
: _text(NULL), _cancel(NULL), _bar(0),
: _text(NULL), _cancel(NULL), _progress(NULL), _bar(0),
_status(0L), _max(max), _flags(0x0)
{
if (_max <= 0)
@ -36,28 +36,31 @@ TIndwin::TIndwin(long max, const char* txt, bool cancel, bool bar, int div)
word maxlen = div;
const word lines = measure_text(testo, maxlen);
int hor = maxlen+3; if (hor > 78) hor = 78;
int ver = lines+1;
ver += bar ? 1 : 0;
ver += cancel ? 2 : 0;
const int hor = min(maxlen+3, 78);
const int ver = lines+1 + (bar ? 2 : 0) + (cancel ? 2: 0);
set_win(create_interface(TASK_WIN, -1, -1, hor, ver, TR("Attesa"), this, FALSE));
set_win(create_interface(TASK_WIN, -1, -1, hor, ver, TR("Elaborazione in corso"), this, FALSE));
_text = new TMultiline_control(win(), DLG_NULL, 1, 0, hor-2, lines+1, 512, "CD", "");
_text->set_read_only();
set_text(testo);
if (bar)
{
RCT r; _text->get_rect(r);
_bar = r.bottom + CHARY;
if (CAMPI_SCAVATI)
_progress = new TText_control(win(), DLG_NULL, 1, lines+3, hor-2, 1, "", "");
}
if (cancel)
_cancel = new TPushbutton_control(win(), DLG_CANCEL, -11, -1, 12, 2, "", TR("Annulla"), BMP_CANCEL);
_cancel = new TPushbutton_control(win(), DLG_CANCEL, -11, -1, 12, 2, "", "", BMP_CANCEL);
open_modal();
do_events();
_start_time = clock();
}
// @doc EXTERNAL
@ -91,8 +94,9 @@ TIndwin::~TIndwin()
if (is_open())
close_modal();
if (_text) delete _text;
if (_cancel) delete _cancel;
if (_progress) delete _progress;
if (_text) delete _text;
}
bool TIndwin::can_be_closed() const
@ -118,8 +122,8 @@ RCT* TIndwin::get_bar_rct(RCT& r) const
xvt_vobj_get_client_rect(win(), &r);
r.left += CHARX;
r.right -= CHARX;
r.top = (int)_bar;
r.bottom = r.top + 3*CHARY/2;
r.top = _bar;
r.bottom = r.top + ROWY; // 3*CHARY/2;
return &r;
}
@ -132,53 +136,51 @@ void TIndwin::update_bar()
}
// Percentuale raggiunta finora
const double prc = (double)_status/_max;
const double prc = (double)_status / (double)_max;
WINDOW w = win();
// Rettangolo contenente l'intera barra
RCT r; get_bar_rct(r);
RCT b = r;
const WINDOW w = win();
if (CAMPI_SCAVATI)
{
COLOR cBar = COLOR_DKBLUE, cText = COLOR_WHITE;
XVT_COLOR_COMPONENT* xcc = (XVT_COLOR_COMPONENT*)xvt_vobj_get_attr(NULL_WIN, ATTR_APP_CTL_COLORS);
if (xcc)
{
for (int c = 0; xcc[c].type != XVT_COLOR_NULL; c++)
{
if (xcc[c].type == XVT_COLOR_CAPTIONLT)
cBar = xcc[c].color;
if (xcc[c].type == XVT_COLOR_CAPTIONTEXT)
cText = xcc[c].color;
}
xvt_mem_free((char*)xcc);
}
// Rettangolo scavato
xi_draw_3d_rect(w, &r, TRUE, 2,
MASK_LIGHT_COLOR, BTN_BACK_COLOR, MASK_DARK_COLOR);
MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR);
b.left += 2; b.right -= 2;
b.top += 2; b.bottom -= 2;
b.right = b.left + int((b.right-b.left)*prc);
b.right = b.left + int((b.right-b.left)*prc + 0.5);
set_brush(cBar, PAT_SOLID);
xvt_dwin_draw_rect(w, &b);
set_pen(BTN_BACK_COLOR);
const int nStep = 2*(b.bottom-b.top)/3;
for (int x = b.left+nStep; x < b.right; x += nStep)
{
for (int i = 0; i < 1; i++) // for (int i = 0; i < 2; i++)
{
PNT pt = { b.top, x+i };
xvt_dwin_draw_set_pos(w, pt);
pt.v = b.bottom;
xvt_dwin_draw_line(w, pt);
}
}
set_color(cText, cBar);
const int lasti = (b.bottom-b.top)/2;
for (int i = 0; i <= lasti; i++)
{
set_pen(blend_colors(FOCUS_BACK_COLOR, MASK_BACK_COLOR, i * 100 / lasti));
PNT pt = { b.top+i, b.left };
xvt_dwin_draw_set_pos(w, pt);
pt.h = b.right;
xvt_dwin_draw_line(w, pt);
pt.h = b.left;
pt.v = b.bottom-i-1;
xvt_dwin_draw_set_pos(w, pt);
pt.h = b.right;
xvt_dwin_draw_line(w, pt);
}
if (prc > 0)
{
const unsigned long elapsed_time = (clock() - _start_time)/1000;
const unsigned long total_time = (unsigned long)(elapsed_time / prc);
unsigned long ss = total_time - elapsed_time;
const unsigned long hh = ss / 3600;
ss -= hh*3600;
const unsigned long mm = ss / 60;
ss -= mm *60;
TString80 n;
n.format("%d%% - Tempo residuo stimato %02lu:%02lu:%02lu", int(prc*100.0+0.5), hh, mm, ss);
_progress->set_caption(n);
}
}
else
{
@ -190,10 +192,10 @@ void TIndwin::update_bar()
b.left = b.right; b.right = r.right;
xi_draw_3d_rect(w, &b, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5));
xvt_dwin_draw_text(w, r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1);
}
char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5));
xvt_dwin_draw_text(w, r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1);
check_stop();
}

View File

@ -36,8 +36,13 @@ class TIndwin : public TWindow
TField_control* _text;
// @cmember:(INTERNAL) Bottone "Annulla"
TControl* _cancel;
// @cmember:(INTERNAL) Testo della percentuale
TControl* _progress;
// @cmember:(INTERNAL) Movimento della barra e percentuale
WINDOW _bar;
int _bar;
// @cmember:(INTERNAL) ora inizio elaborazione
unsigned long _start_time;
// @cmember:(INTERNAL) Flag che indica quali operazioni sono state effettuate
byte _flags;

View File

@ -68,9 +68,10 @@ typedef unsigned char bool;
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
// @doc EXTERNAL

View File

@ -834,6 +834,7 @@ public:
void set_row_height(int rh);
TTree_window(int x, int y, int dx, int dy,
WINDOW parent, TTree_field* owner);
virtual ~TTree_window() { }
@ -941,7 +942,7 @@ bool TTree_window::callback_draw_node(TTree& node, void* jolly, word when)
q.h -= TABX*CHARX - 3*CHARX/2;
xvt_dwin_draw_line(win, q);
q.v = (by+1)*rh;
xvt_dwin_draw_line(win, q);
TImage* bmp = node.image(is_selected);
@ -1415,7 +1416,6 @@ void TTree_field::set_row_height(int rh)
tree_win().set_row_height(rh);
}
TField_window* TTree_field::create_window(int x, int y, int dx, int dy, WINDOW parent)
{
return new TTree_window(x, y, dx, dy, parent, this);

View File

@ -2265,8 +2265,6 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
_righe_iva->add_omaggi(r, conto, ALL_DECIMALS, perc);
else
_righe_iva->add(r, conto, ALL_DECIMALS, perc);
}
r.put(RDOC_CODIVA, codiva2); //Restore
}

View File

@ -2361,8 +2361,6 @@ bool TDocumento_mask::datacambio_handler( TMask_field& f, KEY key )
}
bool TDocumento_mask::codval_handler( TMask_field& f, KEY key )
{
if (key == K_TAB && f.focusdirty())
{

View File

@ -229,13 +229,27 @@ void OsWin32_DrawBitmap(unsigned int hBitmap, unsigned int hDC,
}
}
void OsWin32_DrawDottedRect(unsigned int hDC, int left, int top, int right, int bottom)
{
LOGBRUSH lBrush; lBrush.lbHatch = 0; lBrush.lbStyle = BS_SOLID;
lBrush.lbColor = ::GetTextColor((HDC)hDC);
HPEN hPen = ::ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lBrush, 0, NULL);
HGDIOBJ hOldPen = ::SelectObject((HDC)hDC, hPen);
HGDIOBJ hBrush = ::GetStockObject(HOLLOW_BRUSH);
HGDIOBJ hOldBrush = ::SelectObject((HDC)hDC, hBrush);
::Rectangle((HDC)hDC, left, top, right, bottom);
::SelectObject((HDC)hDC, hOldBrush);
::SelectObject((HDC)hDC, hOldPen);
::DeleteObject(hPen);
}
void OsWin32_Beep(int severity)
{
switch (severity)
{
case 0: MessageBeep(MB_OK); break;
case 1: MessageBeep(MB_ICONEXCLAMATION); break;
default: MessageBeep(MB_ICONSTOP); break;
case 0: ::MessageBeep(MB_OK); break;
case 1: ::MessageBeep(MB_ICONEXCLAMATION); break;
default: ::MessageBeep(MB_ICONSTOP); break;
}
}

View File

@ -4,7 +4,9 @@ void* OsWin32_ConvertFromNativePrinterInfo(void* hGlobal, unsigned int& nSize);
void* OsWin32_ConvertToNativePrinterInfo(void* data, unsigned int nSize);
void OsWin32_DrawBitmap(unsigned int hBitmap, unsigned int hDC,
int xd, int yd, int wd, int hd, int xs, int ys, int ws, int hs);
void OsWin32_DrawDottedRect(unsigned int hDC, int left, int top, int right, int bottom);
void OsWin32_DrawSmallIcon(unsigned int hIcon, unsigned int hDC, int x, int y);
int OsWin32_EnumerateFamilies(unsigned int hDC, char** families, int max_count);
int OsWin32_EnumerateSizes(unsigned int hDC, const char* name, long* sizes, short* scalable, int max_count);
void OsWin32_SetCaptionStyle(unsigned int handle, bool set);
@ -14,4 +16,4 @@ void OsWin32_StretchBlt(unsigned int hDst, int xd, int yd, int wd, int hd,
unsigned int hSrc, int xs, int ys, int ws, int hs);
void OsWin32_UpdateWindow(unsigned int handle);
int OsWin32_Help(unsigned int handle, const char* hlp, unsigned int cmd, const char* topic);
int OsWin32_Help(unsigned int handle, const char* hlp, unsigned int cmd, const char* topic);

View File

@ -485,7 +485,6 @@ void TDC::SetClippingBox(const RCT* pRct)
_dc->DestroyClippingRegion();
_clip.left = _clip.top = 0;
_clip.right = _clip.bottom = 32000;
}
}
@ -1741,6 +1740,33 @@ void xvt_dwin_draw_rect(WINDOW win, RCT *rctp)
dc.DrawRectangle(rct);
}
void xvt_dwin_draw_dotted_rect(WINDOW win, RCT *rctp)
{
#ifdef WIN32
CAST_DC(win, dc);
OsWin32_DrawDottedRect(dc.GetHDC(), rctp->left, rctp->top, rctp->right, rctp->bottom);
#else
DRAW_CTOOLS dct;
xvt_dwin_get_draw_ctools(win, &dt);
CPEN pen;
pen.width = 1;
pen.pat = PAT_SOLID;
pen.style = P_DOT;
pen.color = dct.fore_color;
xvt_dwin_set_cpen(win, &pen);
CBRUSH brush;
brush.color = dct.back_color;
brush.pat = PAT_HOLLOW;
xvt_dwin_set_cbrush(win, &pen);
xvt_dwin_draw_rect(win, rctp);
xvt_dwin_set_draw_ctools(win, &dct);
#endif
}
void xvt_dwin_draw_set_pos(WINDOW win, PNT pnt)
{
CAST_TDC(win, dc);

View File

@ -72,6 +72,7 @@ void xvt_dwin_draw_oval(WINDOW Win, RCT* r);
void xvt_dwin_draw_pie(WINDOW win, RCT *rctp, int start_x, int start_y, int stop_x, int stop_y);
void xvt_dwin_draw_polygon(WINDOW win, PNT *lpnts, int npnts);
void xvt_dwin_draw_rect(WINDOW win, RCT *rctp);
void xvt_dwin_draw_dotted_rect(WINDOW win, RCT *rctp); // Added by Guy
void xvt_dwin_draw_set_pos(WINDOW win, PNT pnt);
void xvt_dwin_draw_text(WINDOW win, int x, int y, const char *s, int len);
RCT* xvt_dwin_get_clip(WINDOW win, RCT* rct);
@ -160,6 +161,7 @@ void xvt_menu_set_item_enabled(WINDOW win, MENU_TAG tag, BOOLEAN enable);
void xvt_menu_set_item_title(WINDOW win, MENU_TAG tag, char* text);
void xvt_menu_set_tree(WINDOW win, MENU_ITEM* tree);
void xvt_menu_update(WINDOW win);
// Added by Guy
typedef const char* TRANSLATE_CALLBACK(const char* ita);
void xvt_menu_translate_tree(WINDOW win, TRANSLATE_CALLBACK tc);