Riportata la versione 98.01.01pl000 sul main trunk

git-svn-id: svn://10.65.10.50/trunk@6152 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1998-02-09 11:54:26 +00:00
parent e3e9298d28
commit ba17e909b2
6 changed files with 43 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#include <filetext.h>
#include <utility.h>
#include <tabutil.h>
//////////////////////////////////////// TTracciato_Campo ////////////////////////////////////////
TTracciato_campo::TTracciato_campo(int position, int length, int decimal, const char align, const char filler)
@ -149,15 +150,23 @@ TTracciato_record* TFile_text::t_rec(const char* type) const
return (TTracciato_record*)_tracciati_record.objptr(type);
}
TTracciato_record* TFile_text::t_rec(int mainfile) const
TTracciato_record* TFile_text::t_rec(int mainfile, const char * tabname) const
{
if (tabname)
mainfile=(tabname[0] != '%') ? LF_TAB: LF_TABCOM;
TTracciato_record *trrd;
TAssoc_array &tr= ((TFile_text *)this)->_tracciati_record;
tr.restart();
while (trrd=(TTracciato_record *)tr.get())
{
if (trrd->relation() && trrd->relation()->lfile().num()==mainfile)
break;
if (tabname)
{
TTable & tab=(TTable & )trrd->relation()->lfile();
if (tabname == tab.name() )
break;
} else
break;
}
return trrd;
}
@ -561,6 +570,23 @@ bool TFile_text::autoload(TRecord_text& rec, int mainfile)
return FALSE;
}
// Carica tutti i dati del tracciato record (anche header o footer)
// nel record_text
bool TFile_text::autoload(TRecord_text& rec, const char * tabname)
{
TTracciato_record* tr = t_rec(tabname);
if (tr)
{
// esiste il tracciato e posso fare l'autoload
TCursor cur(tr->relation());
rec.set_type(tr->type());
return _autoload(rec,cur,*tr);
}
//CHECK (FALSE,"Il tracciato record non esiste");
return FALSE;
}
//Carica tutti i dati nel tracciato record (valido anche per header e footer) nel record_text
bool TFile_text::autoload(TRecord_text& rec, TCursor& cur , const TString* tipo)
{

View File

@ -214,7 +214,7 @@ public:
TTracciato_record* t_rec(const char* type) const ;
// @cmember ritorna il tracciato record relativo alla relazione del file passato
// NB: si assume che ogni tracciato sia relativo ad una relazione diversa
TTracciato_record* t_rec(int mainfile) const ;
TTracciato_record* t_rec(int mainfile, const char* tab=NULL) const ;
const int items_tr() const {return _tracciati_record.items();}//ritorna il numero di tracciati record nel file
TAssoc_array& tracciati() {return _tracciati_record;}//ritorna un riferimento all'assoc_array dei tracciati record
// @cmember caricamento automatico del record_text dalla relazione
@ -223,6 +223,8 @@ public:
bool autoload(TCursor& cur, const TString* tipo = NULL) ;
// @cmember caricamento automatico del record_text passato dalla relazione di file principale mainfile definita sul tracciato
bool autoload(TRecord_text& rec, int mainfile);
// @cmember caricamento automatico del record_text passato dalla relazione
bool autoload(TRecord_text& rec, const char * tabname);
// @cmember caricamento automatico del record_text corrente dalla relazione di file principale mainfile definita sul tracciato
void autoload(int mainfile) {autoload(*_current, mainfile);}
int write(TRecord_text & rec);//scrive su file di testo il record

View File

@ -2180,7 +2180,9 @@ int TSystemisamfile::update(
dir.eox() = 0L;
}
if (toconvert && dir.eox() > 0L)
TFilename fname(filename());
if (toconvert && (dir.eox() > 0L || fexist(fname)))
{
TRecnotype ni = 0L;
isfdptr i0;
@ -2196,7 +2198,6 @@ int TSystemisamfile::update(
}
i0->fhnd=DB_open((const char*)tmpfname,0, TRUE);
if (i0->fhnd < 0 ) err=get_error(i0->fhnd);
TFilename fname(filename());
TString s(80), fld_name, fld_val;
s.format("Aggiornamento archivio %s", (const char*) fname);
TProgind p(nitems ? nitems : 1, s, TRUE, TRUE, 70);

View File

@ -700,6 +700,7 @@ void TPrint_application::set_row (
int size = 0, dec = 0, strind = 0;
char ch, align = 'l';
CHECK (strlen(frmt) <120, "Te c'hai grossa crisi: la stringa di formato non può essere più lunga di 120 chars");
// let the poor programmer use format() at will
strcpy (fmt, frmt);
_print_defined = TRUE;
@ -1456,7 +1457,8 @@ bool TPrint_application::print_one (
if (!(printer().print(*pr)))
break;
}
if (_auto_ff && last /* _maxrox */ < printer().formlen ())
//if (_auto_ff && last /* _maxrox */ < printer().formlen ())
if (_auto_ff && printer().rows_left() > 0)
printer().formfeed ();
delete pos;

View File

@ -197,7 +197,7 @@ TSheet_control::TSheet_control(
rct.top, rct.left, rct.bottom-rct.top,
XI_ATR_ENABLED | XI_ATR_VISIBLE,
NORMAL_COLOR, NORMAL_BACK_COLOR, // normal
DISABLED_COLOR, DISABLED_BACK_COLOR, // disabled
NORMAL_COLOR, DISABLED_BACK_COLOR, // disabled
FOCUS_COLOR, // active
0);
@ -743,7 +743,7 @@ bool TSheet_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
if (_disabled[rec])
{
// xiev->v.cell_request.color = DISABLED_COLOR; // Uniforme coi TField_control
xiev->v.cell_request.color = NORMAL_COLOR;
xiev->v.cell_request.back_color = DISABLED_BACK_COLOR;
}
else

View File

@ -166,13 +166,15 @@ void init_global_vars()
// @func Dealloca le variabili globali
void free_global_vars()
{
{
#ifndef _DEMO_
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
if (_login_status == 2)
rpc_UserLogout();
else
HL_LOGOUT();
#endif
#endif
#endif // _DEMO_
if (openf != NULL)
{