date.cpp Sostituzione di TDate y(*this);set_day(1);set_month(1);

con la piu' meglio TDate(1, 1, year());
isam.h       Tolti #include inutili
maskfld.cpp  Migliorato riconoscimento fiel tabelle in ricerca
object.h     Tolte due righe vuote
progind.h    Aumentato da 10 a 60 il default della lunghezza della barra
tabapp.cpp   Fatta meglio la gestione del nome della maschera base
tabapp.h     Cambiato il metodo get_name
validate.cpp Semplificato un messaggio d'errore


git-svn-id: svn://10.65.10.50/trunk@5106 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-08-26 13:56:55 +00:00
parent 285a207a12
commit f30aef235b
8 changed files with 38 additions and 49 deletions

View File

@ -389,9 +389,7 @@ int TDate::year() const
int TDate::week() const
{
TDate y(*this);
y.set_day(1);
y.set_month(1);
const TDate y(1, 1, year());
return (int) ((date2julian()-y.date2julian())/7 )+1;
}

View File

@ -5,10 +5,6 @@
#include <sysfld.h>
#endif
#ifndef __ARRAY_H
#include <array.h>
#endif
#ifndef __ASSOC_H
#include <assoc.h>
#endif
@ -29,10 +25,6 @@
#include <date.h>
#endif
#ifndef __STRINGS_H
#include <strings.h>
#endif
#ifndef __FILES_H
#include <files.h>
#endif

View File

@ -2341,7 +2341,7 @@ KEY TBrowse::run()
if (_insert[0] != 'G')
{
const TString& maskname = field().mask().source_file();
if (maskname.compare("batb", 4, TRUE) == 0 && field().in_key(0))
if (maskname.mid(2,2).compare("tb", 2, TRUE) == 0 && field().in_key(0))
{
const char* tabname = _cursor->file().name();
if (maskname.mid(4, 3).compare(tabname, 3, TRUE) == 0)

View File

@ -121,8 +121,6 @@ public:
inline ostream& operator <<(
ostream& out, // @parm Indica l'output sul quale stampare l'oggetto
const TObject& obj) // @parm Oggetto da stampare
{
obj.print_on(out);
return out;
@ -157,8 +155,6 @@ inline istream& operator >>(
inline bool operator ==(
const TSortable& a, // @parm Primo oggetto da confrontare
const TSortable& b) // @parm Secondo oggetto da confrontare
// @comm Controlla se i due oggetti passati come parametro sono uguali
// utilizzando il criterio di comparazione previsto per l'oggetto.
{

View File

@ -108,7 +108,7 @@ public:
void addstatus(long l)
{ setstatus(_status+l); }
// @cmember Costruttore
TProgind(long max, const char* txt = NULL, bool cancel = TRUE, bool bar = TRUE, int div = 10);
TProgind(long max, const char* txt = NULL, bool cancel = TRUE, bool bar = TRUE, int div = 60);
// @cmember Distruttore
virtual ~TProgind()
{}

View File

@ -57,31 +57,34 @@ bool Tab_application::protected_record(TRectype& rec)
return rec.get_bool(FPC);
}
TString Tab_application::mask_name()
TString& Tab_application::get_mask_name(TString& t) const
{
TString16 t(_tabname);
if (t[0] == '%') t.ltrim(1);
TString16 m; m << "batb" << t;
return m.upper();
t = _tabname;
if (t[0] == '%')
t.ltrim(1);
t.insert("batb", 0);
t.upper();
return t;
}
TMask * Tab_application::set_mask(TMask * _m)
TMask* Tab_application::set_mask(TMask* m)
{
if (_m!=NULL)
{
// imposta la maschera come maschera della applicazione
if (_msk!=NULL)
delete _msk;
_msk=_m;
} else {
// alloca la maschera standard come maschera della applicazione
_msk = new TMask((const char *)mask_name()) ;
}
return _msk;
if (_msk != NULL)
delete _msk;
if (m != NULL)
{
// imposta la maschera come maschera della applicazione
_msk = m;
}
else
{
// alloca la maschera standard come maschera della applicazione
TFilename name;
get_mask_name(name);
_msk = new TMask(name);
}
return _msk;
}
bool Tab_application::user_create()
@ -93,7 +96,6 @@ bool Tab_application::user_create()
_tabname.upper();
_rel = new TRelation(_tabname);
set_mask();
const int campi = _msk->fields();
@ -107,7 +109,9 @@ bool Tab_application::user_create()
}
}
TFilename rpt(mask_name()); rpt << ".rpt";
TFilename rpt;
get_mask_name(rpt);
rpt.ext("rpt");
if (fexist(rpt))
enable_menu_item(M_FILE_PRINT);

View File

@ -50,11 +50,11 @@ protected:
virtual bool user_destroy() ;
// @cmember Chiama il programma di stampa
virtual void print();
// Nuovi membri:
// Nuovi membri:
// @cmember Ritorna il nome della maschera associata
virtual TString mask_name();
virtual TString& get_mask_name(TString& name) const;
// @cmember imposta la maschera (se non indicata, usa le convenzioni di default) ed eventualmente disalloca quella usata in precedenza
virtual TMask * set_mask(TMask * mask=NULL);
virtual TMask* set_mask(TMask* mask = NULL);
// @access Public Member

View File

@ -1,17 +1,15 @@
#include <stdlib.h>
#include <ctype.h>
#include <applicat.h>
#include <expr.h>
#include <isam.h>
#include <mask.h>
#include <utility.h>
#include <prefix.h>
#include <validate.h>
#include <defmask.h>
#include <nditte.h>
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
HIDDEN const TArray* _parms;
@ -281,8 +279,9 @@ HIDDEN bool _xt_pi_val(TMask_field& f, KEY key)
const int s3 = c.get_int("UFFIVA3");
if (pi != s1 && pi != s2 && pi != s3)
{
const char* ui = format("%03d", s1);
if (f.yesno_box("Ufficio IVA della partita IVA non congruente: correggere in %s?", ui))
TString16 ui; ui.format("%03d", s1);
if (f.yesno_box("Ufficio IVA della partita IVA non congruente: correggere in %s?",
(const char*)ui))
{
value.overwrite(ui, 7);
f.set(value);
@ -464,7 +463,7 @@ HIDDEN bool _mtcheck_val(TMask_field& f, KEY)
TLocalisamfile d(LF_NDITTE);
d.zero();
d.put(NDT_CODDITTA, main_app().get_firm());
d.put(NDT_CODDITTA, prefix().get_codditta());
d.read();
if (d.bad()) return TRUE;
if (d.get_char(NDT_FREQVIVA) == 'M') return TRUE;