Corretti filtri dei cursori e Trecord_array
Aggiunto STRICT prima di include windows.h Corretta distruzione della TPrinter Corretta traduzione in lettere dei numeri reali Corretta visualizazzione immagini in anteprima di stampa Cambiati i nomi die campi relativi al conto nelle partite e nelle scadenze git-svn-id: svn://10.65.10.50/trunk@1282 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d0483278e1
commit
f9397998d5
@ -3,6 +3,7 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -14,6 +15,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -256,7 +258,7 @@ bool TApplication::remove_menu(MENU_TAG id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TApplication::TApplication() : _printer(NULL), _savefirm(0), _create_ok(FALSE)
|
TApplication::TApplication() : _savefirm(0), _create_ok(FALSE)
|
||||||
, _bar(TASK_MENUBAR)
|
, _bar(TASK_MENUBAR)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -264,23 +266,6 @@ TApplication::TApplication() : _printer(NULL), _savefirm(0), _create_ok(FALSE)
|
|||||||
TApplication::~TApplication()
|
TApplication::~TApplication()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
TPrinter* TApplication::set_printer(TPrinter* p)
|
|
||||||
{
|
|
||||||
TPrinter* printer = _printer;
|
|
||||||
_printer = p;
|
|
||||||
return printer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TPrinter& TApplication::printer()
|
|
||||||
{
|
|
||||||
if (_printer == NULL)
|
|
||||||
_printer = new TPrinter;
|
|
||||||
return *_printer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TApplication::create()
|
bool TApplication::create()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -303,7 +288,7 @@ void TApplication::terminate()
|
|||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
const word WM_WAKEUP = RegisterWindowMessage("WAKEUP");
|
const word WM_WAKEUP = RegisterWindowMessage("WAKEUP");
|
||||||
const HTASK ht = GetCurrentTask();
|
const HTASK ht = GetCurrentTask();
|
||||||
SendMessage(HWND_BROADCAST, WM_WAKEUP, ht, 0L);
|
SendMessage(HWND_BROADCAST, WM_WAKEUP, (unsigned int)ht, 0L);
|
||||||
|
|
||||||
if (fexist("prassi.hlp"))
|
if (fexist("prassi.hlp"))
|
||||||
{
|
{
|
||||||
@ -311,20 +296,14 @@ void TApplication::terminate()
|
|||||||
WinHelp(hwnd, "prassi.hlp", HELP_QUIT, 0L);
|
WinHelp(hwnd, "prassi.hlp", HELP_QUIT, 0L);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_printer != NULL) // Distruzione dell'eventuale stampante
|
|
||||||
{
|
|
||||||
if (_printer->isopen())
|
|
||||||
_printer->close();
|
|
||||||
delete _printer;
|
|
||||||
_printer = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
do_events();
|
do_events();
|
||||||
|
|
||||||
if (use_files())
|
if (use_files())
|
||||||
free_global_vars(); // Distruzione variabili globali
|
free_global_vars(); // Distruzione variabili globali
|
||||||
|
|
||||||
|
printer_destroy();
|
||||||
|
|
||||||
customize_controls(FALSE); // Rilascio eventuali DLL
|
customize_controls(FALSE); // Rilascio eventuali DLL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __PRINTER_H
|
#ifndef __STRINGS_H
|
||||||
#include <printer.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @C
|
// @C
|
||||||
@ -30,7 +30,6 @@ class TApplication
|
|||||||
TBit_array _user_aut;
|
TBit_array _user_aut;
|
||||||
|
|
||||||
TString80 _name, _title;
|
TString80 _name, _title;
|
||||||
TPrinter* _printer;
|
|
||||||
|
|
||||||
long _savefirm;
|
long _savefirm;
|
||||||
bool _create_ok; // Succesfully created
|
bool _create_ok; // Succesfully created
|
||||||
@ -87,9 +86,6 @@ public:
|
|||||||
void set_title(const char* t) { _title = t; }
|
void set_title(const char* t) { _title = t; }
|
||||||
const TString& title() const { return _title; }
|
const TString& title() const { return _title; }
|
||||||
|
|
||||||
TPrinter* set_printer(TPrinter* p);
|
|
||||||
TPrinter& printer();
|
|
||||||
|
|
||||||
static void check_parameters(int & argc, char *argv[]);
|
static void check_parameters(int & argc, char *argv[]);
|
||||||
|
|
||||||
bool has_module(int module, int checktype = CHK_ALL) const;
|
bool has_module(int module, int checktype = CHK_ALL) const;
|
||||||
|
@ -127,18 +127,16 @@ Se si utilizza spiegarne dettagliatamente il motivo.
|
|||||||
int lockmode; /* tipo di lock effettuato sul record */
|
int lockmode; /* tipo di lock effettuato sul record */
|
||||||
int dirflg; /* flag per file comuni */
|
int dirflg; /* flag per file comuni */
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode);
|
CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode);
|
||||||
|
|
||||||
if (TESTLOCK(fdir[dirflg].IOR))
|
if (TESTLOCK(fdir[dirflg].IOR))
|
||||||
message_box("Sono in attesa della directory n.ro %d", logicname);
|
message_box("Sono in attesa della directory n.ro %d", logicname);
|
||||||
}
|
} while TESTLOCK(fdir[dirflg].IOR) ;
|
||||||
while TESTLOCK(fdir[dirflg].IOR) ;
|
|
||||||
strcpy(filed->SysName, CAddPref(filed->SysName)) ;
|
strcpy(filed->SysName, CAddPref(filed->SysName)) ;
|
||||||
} ;
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@(#) CCloseFile FILES
|
@(#) CCloseFile FILES
|
||||||
@ -1533,10 +1531,10 @@ Se si utilizza spiegarne dettagliatamente il motivo.
|
|||||||
@(FN)
|
@(FN)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *CAddPref(name)
|
char *CAddPref(name)
|
||||||
char *name; /* nome file */
|
char *name; /* nome file */
|
||||||
|
|
||||||
{
|
{
|
||||||
static PathSt s;
|
static PathSt s;
|
||||||
|
|
||||||
if (*name == '$')
|
if (*name == '$')
|
||||||
@ -1552,7 +1550,7 @@ Se si utilizza spiegarne dettagliatamente il motivo.
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy(s, name);
|
sprintf(s, "%s%s", __ptprf, name);
|
||||||
return(s);
|
return(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <keys.h>
|
#include <keys.h>
|
||||||
#else
|
#else
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <date.h>
|
||||||
|
#include <scanner.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <scanner.h>
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,7 @@ extern "C"
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <window.h>
|
#include <window.h>
|
||||||
|
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <toolhelp.h>
|
#include <toolhelp.h>
|
||||||
#endif
|
#endif
|
||||||
@ -16,6 +17,7 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
|
#include <window.h>
|
||||||
|
|
||||||
bool TExternal_app::can_run() const
|
bool TExternal_app::can_run() const
|
||||||
{
|
{
|
||||||
@ -67,7 +69,7 @@ int TExternal_app::run(bool async, bool utente)
|
|||||||
if (te.hInst == (HINSTANCE)_exitcode) child = te.hTask;
|
if (te.hInst == (HINSTANCE)_exitcode) child = te.hTask;
|
||||||
CHECK(child, "Can't find child task");
|
CHECK(child, "Can't find child task");
|
||||||
|
|
||||||
main_app().wait_for(child);
|
main_app().wait_for((word)child);
|
||||||
for (byte i = 0; main_app().waiting(); i++)
|
for (byte i = 0; main_app().waiting(); i++)
|
||||||
{
|
{
|
||||||
if (i == 0 && TaskFindHandle(&te, child) == FALSE)
|
if (i == 0 && TaskFindHandle(&te, child) == FALSE)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
@ -667,7 +668,7 @@ bool TForm_date::read()
|
|||||||
{
|
{
|
||||||
bool ok = TForm_string::read();
|
bool ok = TForm_string::read();
|
||||||
if (ok && !get()[0] && automagic())
|
if (ok && !get()[0] && automagic())
|
||||||
set(main_app().printer().getdate());
|
set(printer().getdate());
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1122,7 +1123,7 @@ bool TGraphic_section::update()
|
|||||||
{
|
{
|
||||||
_back.cut(0);
|
_back.cut(0);
|
||||||
const bool ok = TPrint_section::update();
|
const bool ok = TPrint_section::update();
|
||||||
main_app().printer().setbackground(_back);
|
printer().setbackground(_back);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1244,7 +1245,7 @@ word TForm::set_background(word p, bool u)
|
|||||||
{
|
{
|
||||||
TPrint_section& graph = section('G', p);
|
TPrint_section& graph = section('G', p);
|
||||||
graph.update();
|
graph.update();
|
||||||
len = main_app().printer().formlen();
|
len = printer().formlen();
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@ -1252,8 +1253,8 @@ word TForm::set_background(word p, bool u)
|
|||||||
|
|
||||||
word TForm::set_header(word p, bool u)
|
word TForm::set_header(word p, bool u)
|
||||||
{
|
{
|
||||||
TPrinter& printer = main_app().printer();
|
TPrinter& pr = printer();
|
||||||
printer.resetheader();
|
pr.resetheader();
|
||||||
|
|
||||||
TPrint_section& head = section('H', p);
|
TPrint_section& head = section('H', p);
|
||||||
|
|
||||||
@ -1261,11 +1262,11 @@ word TForm::set_header(word p, bool u)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
head.reset();
|
head.reset();
|
||||||
printer.headerlen(head.height());
|
pr.headerlen(head.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (word j = 0; j < head.height(); j++)
|
for (word j = 0; j < head.height(); j++)
|
||||||
printer.setheaderline(j, head.row(j));
|
pr.setheaderline(j, head.row(j));
|
||||||
|
|
||||||
return head.height();
|
return head.height();
|
||||||
}
|
}
|
||||||
@ -1279,9 +1280,9 @@ word TForm::set_body(word p, bool u)
|
|||||||
|
|
||||||
if (u)
|
if (u)
|
||||||
{
|
{
|
||||||
TPrinter& printer = main_app().printer();
|
TPrinter& pr = printer();
|
||||||
for (word j = 0; j < body.height(); j++)
|
for (word j = 0; j < body.height(); j++)
|
||||||
printer.print(body.row(j));
|
pr.print(body.row(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
return body.height();
|
return body.height();
|
||||||
@ -1289,8 +1290,8 @@ word TForm::set_body(word p, bool u)
|
|||||||
|
|
||||||
word TForm::set_footer(word p, bool u)
|
word TForm::set_footer(word p, bool u)
|
||||||
{
|
{
|
||||||
TPrinter& printer = main_app().printer();
|
TPrinter& pr = printer();
|
||||||
printer.resetfooter();
|
pr.resetfooter();
|
||||||
|
|
||||||
TPrint_section& foot = section('F', p);
|
TPrint_section& foot = section('F', p);
|
||||||
|
|
||||||
@ -1298,11 +1299,11 @@ word TForm::set_footer(word p, bool u)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
foot.reset();
|
foot.reset();
|
||||||
printer.footerlen(foot.height());
|
pr.footerlen(foot.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (word j = 0; j < foot.height(); j++)
|
for (word j = 0; j < foot.height(); j++)
|
||||||
printer.setfooterline(j, foot.row(j));
|
pr.setfooterline(j, foot.row(j));
|
||||||
|
|
||||||
return foot.height();
|
return foot.height();
|
||||||
}
|
}
|
||||||
@ -1342,17 +1343,17 @@ bool TForm::print(long from, long to)
|
|||||||
{
|
{
|
||||||
_form = this; // Setta il form corrente
|
_form = this; // Setta il form corrente
|
||||||
|
|
||||||
TPrinter& printer = main_app().printer(); // Setta handlers
|
TPrinter& pr = printer(); // Setta handlers
|
||||||
printer.setheaderhandler(header_handler);
|
pr.setheaderhandler(header_handler);
|
||||||
printer.setfooterhandler(footer_handler);
|
pr.setfooterhandler(footer_handler);
|
||||||
printer.formlen(height());
|
pr.formlen(height());
|
||||||
const bool was_open = printer.isopen();
|
const bool was_open = pr.isopen();
|
||||||
|
|
||||||
_lastpage = FALSE; // non e' l'ultima pagina
|
_lastpage = FALSE; // non e' l'ultima pagina
|
||||||
|
|
||||||
set_background(1, TRUE);
|
set_background(1, TRUE);
|
||||||
|
|
||||||
if (!was_open && !printer.open())
|
if (!was_open && !pr.open())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
do_events();
|
do_events();
|
||||||
|
|
||||||
@ -1365,11 +1366,11 @@ bool TForm::print(long from, long to)
|
|||||||
if (from < 0) to = from;
|
if (from < 0) to = from;
|
||||||
else if (_cursor) *_cursor = i;
|
else if (_cursor) *_cursor = i;
|
||||||
|
|
||||||
const word h = set_body(page(printer), FALSE);
|
const word h = set_body(page(pr), FALSE);
|
||||||
if (h > printer.rows_left())
|
if (h > pr.rows_left())
|
||||||
printer.formfeed();
|
pr.formfeed();
|
||||||
|
|
||||||
set_body(page(printer), TRUE);
|
set_body(page(pr), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > records())
|
if (i > records())
|
||||||
@ -1380,16 +1381,16 @@ bool TForm::print(long from, long to)
|
|||||||
set_background(0, TRUE);
|
set_background(0, TRUE);
|
||||||
set_header(0, TRUE);
|
set_header(0, TRUE);
|
||||||
set_body(0, TRUE);
|
set_body(0, TRUE);
|
||||||
printer.formfeed();
|
pr.formfeed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!was_open)
|
if (!was_open)
|
||||||
printer.close();
|
pr.close();
|
||||||
|
|
||||||
_form = NULL; // resetta handlers
|
_form = NULL; // resetta handlers
|
||||||
printer.setheaderhandler(NULL);
|
pr.setheaderhandler(NULL);
|
||||||
printer.setfooterhandler(NULL);
|
pr.setfooterhandler(NULL);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -1404,10 +1405,14 @@ void TForm::print_section(ostream& out, char s) const
|
|||||||
const char* name;
|
const char* name;
|
||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
case 'F': name = "FOOTER"; break;
|
case 'F':
|
||||||
case 'G': name = "GRAPHICS"; break;
|
name = "FOOTER"; break;
|
||||||
case 'H': name = "HEADER"; break;
|
case 'G':
|
||||||
default : name = "BODY"; break;
|
name = "GRAPHICS"; break;
|
||||||
|
case 'H':
|
||||||
|
name = "HEADER"; break;
|
||||||
|
default :
|
||||||
|
name = "BODY"; break;
|
||||||
}
|
}
|
||||||
out << "SECTION " << name << ' ' << int(t);
|
out << "SECTION " << name << ' ' << int(t);
|
||||||
out << *sec;
|
out << *sec;
|
||||||
@ -1451,7 +1456,7 @@ word TForm::height()
|
|||||||
h += section('F', 1).height();
|
h += section('F', 1).height();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
h = main_app().printer().formlen();
|
h = printer().formlen();
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
116
include/isam.cpp
116
include/isam.cpp
@ -31,7 +31,7 @@
|
|||||||
#define NOT_LINKED(i,f) CHECKS(i != NULL, "Record senza tracciato: impossibile eseguire ", f)
|
#define NOT_LINKED(i,f) CHECKS(i != NULL, "Record senza tracciato: impossibile eseguire ", f)
|
||||||
#define NOT_OPEN() CHECKS(_isamfile != NULL, "File chiuso: ", (const char*)name())
|
#define NOT_OPEN() CHECKS(_isamfile != NULL, "File chiuso: ", (const char*)name())
|
||||||
|
|
||||||
HIDDEN TString256 _isam_string;
|
HIDDEN char _isam_string[257];
|
||||||
|
|
||||||
HIDDEN void UNKNOWN_FIELD(int num, const char* name)
|
HIDDEN void UNKNOWN_FIELD(int num, const char* name)
|
||||||
{ yesnofatal_box("Il campo '%s' non appartiene al file %d", name, num); }
|
{ yesnofatal_box("Il campo '%s' non appartiene al file %d", name, num); }
|
||||||
@ -208,7 +208,7 @@ long TBaseisamfile::items() const
|
|||||||
|
|
||||||
const char* TBaseisamfile::name() const
|
const char* TBaseisamfile::name() const
|
||||||
{
|
{
|
||||||
_isam_string.format("%d", num());
|
sprintf(_isam_string, "%d", num());
|
||||||
return _isam_string;
|
return _isam_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ const char* TBaseisamfile::filename() const
|
|||||||
{
|
{
|
||||||
TDir d;
|
TDir d;
|
||||||
d.get(num());
|
d.get(num());
|
||||||
_isam_string = d.name();
|
strcpy(_isam_string, d.name());
|
||||||
return _isam_string;
|
return _isam_string;
|
||||||
}
|
}
|
||||||
return _isamfile->d->SysName;
|
return _isamfile->d->SysName;
|
||||||
@ -230,7 +230,7 @@ const char* TBaseisamfile::description() const
|
|||||||
{
|
{
|
||||||
TDir d;
|
TDir d;
|
||||||
d.get(num());
|
d.get(num());
|
||||||
_isam_string = d.des();
|
strcpy(_isam_string, d.des());
|
||||||
return _isam_string;
|
return _isam_string;
|
||||||
}
|
}
|
||||||
return _isamfile->d->Des;
|
return _isamfile->d->Des;
|
||||||
@ -1438,10 +1438,13 @@ void TBaseisamfile::recover()
|
|||||||
isdef * fh = filehnd();
|
isdef * fh = filehnd();
|
||||||
const TRecnotype nitems = fh->i.Base[0].PEOX;
|
const TRecnotype nitems = fh->i.Base[0].PEOX;
|
||||||
|
|
||||||
CHECKD(getkey() == 1, "La chiave corrente non e' 1 ma ", getkey());
|
|
||||||
TFilename fn = filename();
|
TFilename fn = filename();
|
||||||
|
|
||||||
fn = fn.name();
|
fn = fn.name();
|
||||||
|
|
||||||
|
if (getkey() != 1)
|
||||||
|
fatal_box("La chiave per il recover dell'archivio %s deve essere 1 non %d",
|
||||||
|
(const char *)fn, getkey());
|
||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
if (yesno_box("La dimensione dell'archivio %s e' errata. Cerco di recuperarlo?", (const char *)fn))
|
if (yesno_box("La dimensione dell'archivio %s e' errata. Cerco di recuperarlo?", (const char *)fn))
|
||||||
{
|
{
|
||||||
@ -1695,13 +1698,35 @@ const char* TRectype::fieldname(int i) const
|
|||||||
return i >= 0 && i < rd->NFields ? rd->Fd[i].Name : NULL;
|
return i >= 0 && i < rd->NFields ? rd->Fd[i].Name : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* TRectype::get_str(const char* fieldname) const
|
||||||
|
{
|
||||||
|
RecDes* rd = rec_des();
|
||||||
|
|
||||||
|
if (CFieldType((char*) fieldname, rd) == _datefld)
|
||||||
|
{
|
||||||
|
const TRecfield f((TRectype&)*this, fieldname);
|
||||||
|
strcpy(_isam_string, (const char*) f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (CGetFieldBuff((char*) fieldname, rd, _rec, _isam_string) == -1)
|
||||||
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
|
|
||||||
|
return _isam_string;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
|
|
||||||
|
const TString& TRectype::get(const char* fieldname) const
|
||||||
|
{
|
||||||
|
static TFixed_string tmp(_isam_string, sizeof(_isam_string));
|
||||||
|
get_str(fieldname);
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
int TRectype::get_int(const char* fieldname) const
|
int TRectype::get_int(const char* fieldname) const
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_int");
|
// NOT_LINKED(_i, "get_int");
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
return atoi(_isam_string);
|
return atoi(_isam_string);
|
||||||
}
|
}
|
||||||
@ -1710,7 +1735,7 @@ int TRectype::get_int(const char* fieldname) const
|
|||||||
long TRectype::get_long(const char* fieldname) const
|
long TRectype::get_long(const char* fieldname) const
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_long");
|
// NOT_LINKED(_i, "get_long");
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
return atol(_isam_string);
|
return atol(_isam_string);
|
||||||
}
|
}
|
||||||
@ -1720,7 +1745,7 @@ word TRectype::get_word(const char* fieldname) const
|
|||||||
|
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_word");
|
// NOT_LINKED(_i, "get_word");
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
return (word)atoi(_isam_string);
|
return (word)atoi(_isam_string);
|
||||||
}
|
}
|
||||||
@ -1729,7 +1754,7 @@ real TRectype::get_real(const char* fieldname) const
|
|||||||
|
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_real");
|
// NOT_LINKED(_i, "get_real");
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
real r(_isam_string);
|
real r(_isam_string);
|
||||||
return r;
|
return r;
|
||||||
@ -1741,7 +1766,7 @@ char TRectype::get_char(const char* fieldname) const
|
|||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_char");
|
// NOT_LINKED(_i, "get_char");
|
||||||
|
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
return *_isam_string;
|
return *_isam_string;
|
||||||
}
|
}
|
||||||
@ -1751,11 +1776,18 @@ bool TRectype::get_bool(const char* fieldname) const
|
|||||||
|
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "get_bool");
|
// NOT_LINKED(_i, "get_bool");
|
||||||
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, (char*)(const char*)_isam_string) == -1)
|
if (CGetFieldBuff((char*) fieldname, rec_des(), _rec, _isam_string) == -1)
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
return *_isam_string == 'X';
|
return *_isam_string == 'X';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
const char* TRectype::get(const char* fieldname) const
|
||||||
|
{
|
||||||
|
return get_str(fieldname);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // FOXPRO
|
#endif // FOXPRO
|
||||||
|
|
||||||
|
|
||||||
@ -1769,23 +1801,6 @@ TDate TRectype::get_date(const char* fieldname) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const TString& TRectype::get(const char* fieldname) const
|
|
||||||
{
|
|
||||||
RecDes* rd = rec_des();
|
|
||||||
|
|
||||||
if (CFieldType((char*) fieldname, rd) == _datefld)
|
|
||||||
{
|
|
||||||
const TRecfield f((TRectype&)*this, fieldname);
|
|
||||||
_isam_string = (const char*) f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (CGetFieldBuff((char*) fieldname, rd, _rec, (char*)(const char*)_isam_string) == -1)
|
|
||||||
UNKNOWN_FIELD(num(), fieldname);
|
|
||||||
|
|
||||||
return _isam_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
|
|
||||||
void TRectype::put(const char* fieldname, int val)
|
void TRectype::put(const char* fieldname, int val)
|
||||||
@ -1948,7 +1963,7 @@ TRectype& TRectype::operator =(const char* rec)
|
|||||||
const char* TRectype::key(int numkey) const
|
const char* TRectype::key(int numkey) const
|
||||||
{
|
{
|
||||||
// NOT_LINKED(_i, "key");
|
// NOT_LINKED(_i, "key");
|
||||||
CBuildKey(rec_des(), numkey, _rec, (char*)(const char*)_isam_string);
|
CBuildKey(rec_des(), numkey, _rec, _isam_string);
|
||||||
return _isam_string;
|
return _isam_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2086,9 +2101,9 @@ int TRecfield::operator =(int i)
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (_type == _intzerofld)
|
if (_type == _intzerofld)
|
||||||
_isam_string.format("%0*d", _len, i);
|
sprintf(_isam_string, "%0*d", _len, i);
|
||||||
else
|
else
|
||||||
_isam_string.format("%d", i);
|
sprintf(_isam_string, "%d", i);
|
||||||
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
||||||
_rec->setempty(FALSE);
|
_rec->setempty(FALSE);
|
||||||
return i;
|
return i;
|
||||||
@ -2099,9 +2114,9 @@ long TRecfield::operator =(long l)
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (_type == _longzerofld)
|
if (_type == _longzerofld)
|
||||||
_isam_string.format("%0*ld", _len, l);
|
sprintf(_isam_string, "%0*ld", _len, l);
|
||||||
else
|
else
|
||||||
_isam_string.format("%ld", l);
|
sprintf(_isam_string, "%ld", l);
|
||||||
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
||||||
_rec->setempty(FALSE);
|
_rec->setempty(FALSE);
|
||||||
return l;
|
return l;
|
||||||
@ -2112,18 +2127,37 @@ long TRecfield::operator =(long l)
|
|||||||
const real& TRecfield::operator =(const real& r)
|
const real& TRecfield::operator =(const real& r)
|
||||||
|
|
||||||
{
|
{
|
||||||
_isam_string = r.string();
|
strcpy(_isam_string, r.string());
|
||||||
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
||||||
_rec->setempty(FALSE);
|
_rec->setempty(FALSE);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
const char* TRectype::get(const char* fieldname) const
|
||||||
|
{
|
||||||
|
RecDes* rd = rec_des();
|
||||||
|
|
||||||
|
if (CFieldType((char*) fieldname, rd) == _datefld)
|
||||||
|
{
|
||||||
|
const TRecfield f((TRectype&)*this, fieldname);
|
||||||
|
strcpy(_isam_string, (const char*) f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (CGetFieldBuff((char*) fieldname, rd, _rec, _isam_string) == -1)
|
||||||
|
UNKNOWN_FIELD(num(), fieldname);
|
||||||
|
|
||||||
|
return _isam_string;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // FOXPRO
|
#endif // FOXPRO
|
||||||
|
|
||||||
|
|
||||||
const TDate& TRecfield::operator =(const TDate& d)
|
const TDate& TRecfield::operator =(const TDate& d)
|
||||||
|
|
||||||
{
|
{
|
||||||
_isam_string = (const char*)d;
|
strcpy(_isam_string, (const char*)d);
|
||||||
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
__putfieldbuff( _len, _dec, _type, _isam_string, _p);
|
||||||
_rec->setempty(FALSE);
|
_rec->setempty(FALSE);
|
||||||
return d;
|
return d;
|
||||||
@ -2162,7 +2196,7 @@ void TRecfield::setptr(TRecnotype r)
|
|||||||
TRecfield::operator int() const
|
TRecfield::operator int() const
|
||||||
|
|
||||||
{
|
{
|
||||||
__getfieldbuff( _len, _type, _p, (char*)(const char*)_isam_string);
|
__getfieldbuff( _len, _type, _p, _isam_string);
|
||||||
return atoi(_isam_string);
|
return atoi(_isam_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2170,7 +2204,7 @@ TRecfield::operator int() const
|
|||||||
TRecfield::operator long() const
|
TRecfield::operator long() const
|
||||||
|
|
||||||
{
|
{
|
||||||
__getfieldbuff( _len, _type, _p, (char*)(const char*)_isam_string);
|
__getfieldbuff( _len, _type, _p, _isam_string);
|
||||||
return atol(_isam_string);
|
return atol(_isam_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2180,7 +2214,7 @@ TRecfield::operator long() const
|
|||||||
TRecfield::operator const real() const
|
TRecfield::operator const real() const
|
||||||
|
|
||||||
{
|
{
|
||||||
__getfieldbuff( _len, _type, _p, (char*)(const char*)_isam_string);
|
__getfieldbuff( _len, _type, _p, _isam_string);
|
||||||
real r(_isam_string);
|
real r(_isam_string);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -2191,7 +2225,7 @@ TRecfield::operator TDate() const
|
|||||||
|
|
||||||
{
|
{
|
||||||
static TDate d;
|
static TDate d;
|
||||||
__getfieldbuff( _len, _type, _p, (char*)(const char*)_isam_string);
|
__getfieldbuff( _len, _type, _p, _isam_string);
|
||||||
d = _isam_string;
|
d = _isam_string;
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@ -2200,7 +2234,7 @@ TRecfield::operator TDate() const
|
|||||||
TRecfield::operator const char*() const
|
TRecfield::operator const char*() const
|
||||||
|
|
||||||
{
|
{
|
||||||
__getfieldbuff( _len, _type, _p, (char*)(const char*)_isam_string);
|
__getfieldbuff( _len, _type, _p, _isam_string);
|
||||||
return _isam_string;
|
return _isam_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,21 +87,20 @@ public:
|
|||||||
bool exist(const char* fieldname) const; // Ritorna l'esistenza del campo
|
bool exist(const char* fieldname) const; // Ritorna l'esistenza del campo
|
||||||
const char* fieldname(int i) const; // Ritorna il nome del campo i
|
const char* fieldname(int i) const; // Ritorna il nome del campo i
|
||||||
|
|
||||||
// @DES Get tipizzata. Ritorna il contenuto del campo nei vari tipi
|
const char* get_str(const char* fieldname) const ;
|
||||||
// @FPUB
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
|
const TString& get(const char* fieldname) const ;
|
||||||
int get_int(const char* fieldname) const ;
|
int get_int(const char* fieldname) const ;
|
||||||
long get_long(const char* fieldname) const ;
|
long get_long(const char* fieldname) const ;
|
||||||
word get_word(const char* fieldname) const ;
|
word get_word(const char* fieldname) const ;
|
||||||
char get_char(const char* fieldname) const ;
|
char get_char(const char* fieldname) const ;
|
||||||
bool get_bool(const char* fieldname) const ;
|
bool get_bool(const char* fieldname) const ;
|
||||||
real get_real(const char* fieldname) const ;
|
real get_real(const char* fieldname) const ;
|
||||||
|
#else
|
||||||
|
const char* get(const char* fieldname) const ;
|
||||||
#endif
|
#endif
|
||||||
TDate get_date(const char* fieldname) const ;
|
TDate get_date(const char* fieldname) const ;
|
||||||
|
|
||||||
// @DES Get non tipizzata. Il campo e' ritornato come TString&
|
|
||||||
// @FPUB
|
|
||||||
const TString& get(const char* fieldname) const ;
|
|
||||||
|
|
||||||
// @DES Put tipizzata
|
// @DES Put tipizzata
|
||||||
// @FPUB
|
// @FPUB
|
||||||
@ -114,6 +113,7 @@ public:
|
|||||||
void put(const char* fieldname, char val);
|
void put(const char* fieldname, char val);
|
||||||
void put(const char* fieldname, bool val);
|
void put(const char* fieldname, bool val);
|
||||||
void put(const char* fieldname, const real& val);
|
void put(const char* fieldname, const real& val);
|
||||||
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @DES Put NON tipizzata
|
// @DES Put NON tipizzata
|
||||||
@ -260,14 +260,9 @@ public:
|
|||||||
TDate get_date(const char* fieldname) const
|
TDate get_date(const char* fieldname) const
|
||||||
{ return curr().get_date(fieldname);}
|
{ return curr().get_date(fieldname);}
|
||||||
|
|
||||||
// @DES Get non tipizzata. Il campo e' ritornato come TString&
|
#ifndef FOXPRO
|
||||||
// @FPUB
|
|
||||||
const TString& get(const char* fieldname) const
|
const TString& get(const char* fieldname) const
|
||||||
{ return curr().get(fieldname);}
|
{ return curr().get(fieldname);}
|
||||||
|
|
||||||
// @DES Put NON tipizzata
|
|
||||||
// @FPUB
|
|
||||||
#ifndef FOXPRO
|
|
||||||
void put(const char* fieldname, int val)
|
void put(const char* fieldname, int val)
|
||||||
{ curr().put(fieldname, val);}
|
{ curr().put(fieldname, val);}
|
||||||
void put(const char* fieldname, long val)
|
void put(const char* fieldname, long val)
|
||||||
@ -282,6 +277,9 @@ public:
|
|||||||
{ curr().put(fieldname, val);}
|
{ curr().put(fieldname, val);}
|
||||||
void put(const char* fieldname, const real& val)
|
void put(const char* fieldname, const real& val)
|
||||||
{ curr().put(fieldname, val);}
|
{ curr().put(fieldname, val);}
|
||||||
|
#else
|
||||||
|
const char* get(const char* fieldname) const
|
||||||
|
{ return curr().get(fieldname);}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @DES Put NON tipizzata
|
// @DES Put NON tipizzata
|
||||||
|
@ -459,9 +459,6 @@ void TMask_field::set_prompt(const char* p)
|
|||||||
|
|
||||||
void TMask_field::set(const char* s)
|
void TMask_field::set(const char* s)
|
||||||
{
|
{
|
||||||
if (_dlg == 108)
|
|
||||||
_dlg = 108;
|
|
||||||
|
|
||||||
if (mask().is_running())
|
if (mask().is_running())
|
||||||
{
|
{
|
||||||
set_window_data(s);
|
set_window_data(s);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#define PART_CAMBIO "CAMBIO"
|
#define PART_CAMBIO "CAMBIO"
|
||||||
#define PART_IMPORTOVAL "IMPORTOVAL"
|
#define PART_IMPORTOVAL "IMPORTOVAL"
|
||||||
#define PART_DATACAM "DATACAM"
|
#define PART_DATACAM "DATACAM"
|
||||||
#define PART_TIPOCF "TIPOCF"
|
#define PART_TIPOCF "TIPOC"
|
||||||
#define PART_GRUPPO "GRUPPO"
|
#define PART_GRUPPO "GRUPPO"
|
||||||
#define PART_CONTO "CONTO"
|
#define PART_CONTO "CONTO"
|
||||||
#define PART_SOTTOCONTO "SOTTOCONTO"
|
#define PART_SOTTOCONTO "SOTTOCONTO"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: printapp.cpp,v 1.22 1995-04-14 17:11:07 alex Exp $
|
// $Id: printapp.cpp,v 1.23 1995-04-20 14:33:40 guy Exp $
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ static char tb[120];
|
|||||||
|
|
||||||
int TPrint_application::find_link(const char* descr) const
|
int TPrint_application::find_link(const char* descr) const
|
||||||
{
|
{
|
||||||
const TArray& arr = main_app().printer().links();
|
const TArray& arr = printer().links();
|
||||||
for (int i = 0; i < arr.items(); i++)
|
for (int i = 0; i < arr.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& tt = (TToken_string&)arr[i];
|
TToken_string& tt = (TToken_string&)arr[i];
|
||||||
@ -279,12 +279,12 @@ void TPrint_application::_pp_header (TPrinter &)
|
|||||||
{
|
{
|
||||||
TPrint_application& prapp = (TPrint_application&)main_app();
|
TPrint_application& prapp = (TPrint_application&)main_app();
|
||||||
prapp.preprocess_header();
|
prapp.preprocess_header();
|
||||||
prapp.printer().resetheader();
|
printer().resetheader();
|
||||||
const int ii = prapp._header.last();
|
const int ii = prapp._header.last();
|
||||||
// reset and add header/footer lines
|
// reset and add header/footer lines
|
||||||
for (int i = 0; i <= ii; i++)
|
for (int i = 0; i <= ii; i++)
|
||||||
if (prapp._header.objptr(i) != NULL)
|
if (prapp._header.objptr(i) != NULL)
|
||||||
prapp.printer().setheaderline (i, new TPrintrow((TPrintrow &)prapp._header[i]));
|
printer().setheaderline (i, new TPrintrow((TPrintrow &)prapp._header[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_application::_pp_footer (TPrinter &)
|
void TPrint_application::_pp_footer (TPrinter &)
|
||||||
@ -292,11 +292,11 @@ void TPrint_application::_pp_footer (TPrinter &)
|
|||||||
TPrint_application& prapp = (TPrint_application&)main_app();
|
TPrint_application& prapp = (TPrint_application&)main_app();
|
||||||
|
|
||||||
prapp.preprocess_footer ();
|
prapp.preprocess_footer ();
|
||||||
prapp.printer().resetfooter ();
|
printer().resetfooter ();
|
||||||
int ii = prapp._footer.last();
|
int ii = prapp._footer.last();
|
||||||
for (int i = 0; i <= ii; i++)
|
for (int i = 0; i <= ii; i++)
|
||||||
if (prapp._footer.objptr(i) != NULL)
|
if (prapp._footer.objptr(i) != NULL)
|
||||||
prapp.printer().setfooterline (i,
|
printer().setfooterline (i,
|
||||||
new TPrintrow ((TPrintrow &) (prapp._footer)[i]));
|
new TPrintrow ((TPrintrow &) (prapp._footer)[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include <strstream.h>
|
#include <strstream.h>
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
@ -15,17 +14,35 @@
|
|||||||
#define STYLE_NUM 4
|
#define STYLE_NUM 4
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <config.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <printwin.h>
|
#include <printwin.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <viswin.h>
|
#include <viswin.h>
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include <bagn001a.h>
|
#include <bagn001a.h>
|
||||||
|
|
||||||
|
HIDDEN TPrinter* _printer = NULL;
|
||||||
|
|
||||||
|
TPrinter& printer()
|
||||||
|
{
|
||||||
|
if (_printer == NULL)
|
||||||
|
_printer = new TPrinter;
|
||||||
|
return *_printer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void printer_destroy()
|
||||||
|
{
|
||||||
|
if (_printer != NULL)
|
||||||
|
{
|
||||||
|
delete _printer;
|
||||||
|
_printer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// PrDesc
|
// PrDesc
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -41,10 +58,8 @@ struct PrDesc
|
|||||||
}
|
}
|
||||||
PrintWhat;
|
PrintWhat;
|
||||||
|
|
||||||
#define LINES_PER_INCH (6.0)
|
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
void TPrinter::_get_windows_printer_names (TToken_string & t)
|
void TPrinter::_get_windows_printer_names (TToken_string & t)
|
||||||
@ -617,7 +632,7 @@ bool printers_on_key (TMask_field & f, KEY key)
|
|||||||
{
|
{
|
||||||
TToken_string pn1 (10), pn2 (20);
|
TToken_string pn1 (10), pn2 (20);
|
||||||
|
|
||||||
const PrinterDef & def = main_app().printer().get_description(atoi(f.get ()));
|
const PrinterDef & def = printer().get_description(atoi(f.get ()));
|
||||||
const char *s;
|
const char *s;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
while ((s = def.get_codenames (j)) != NULL)
|
while ((s = def.get_codenames (j)) != NULL)
|
||||||
@ -686,17 +701,17 @@ HIDDEN bool set_windows_print_device (TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (key == K_SPACE && f.mask().is_running())
|
if (key == K_SPACE && f.mask().is_running())
|
||||||
{
|
{
|
||||||
TPrinter& printer = main_app().printer();
|
TPrinter& pr = printer();
|
||||||
|
|
||||||
char szDevice[80];
|
char szDevice[80];
|
||||||
TToken_string & pn = printer.getprinternames ();
|
TToken_string & pn = pr.getprinternames ();
|
||||||
TString pdev (pn.get (atoi (f.get())));
|
TString pdev (pn.get (atoi (f.get())));
|
||||||
GetProfileString ("devices", pdev, "", szDevice, sizeof (szDevice));
|
GetProfileString ("devices", pdev, "", szDevice, sizeof (szDevice));
|
||||||
pdev << "," << szDevice;
|
pdev << "," << szDevice;
|
||||||
// scrivi (e semmai lo si risistema poi)
|
// scrivi (e semmai lo si risistema poi)
|
||||||
WriteProfileString("windows", "device", pdev);
|
WriteProfileString("windows", "device", pdev);
|
||||||
printer.set_printrcd();
|
pr.set_printrcd();
|
||||||
printer.set_win_formlen();
|
pr.set_win_formlen();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -739,9 +754,7 @@ TPrinter::TPrinter()
|
|||||||
_ch_size = cnf.get_int("Size", NULL, -1, 12);
|
_ch_size = cnf.get_int("Size", NULL, -1, 12);
|
||||||
_lines_per_inch = cnf.get_int("Lines", NULL, -1, 6);
|
_lines_per_inch = cnf.get_int("Lines", NULL, -1, 6);
|
||||||
|
|
||||||
xvt_print_open ();
|
// xvt_print_open ();
|
||||||
|
|
||||||
set_printrcd();
|
|
||||||
set_win_formlen ();
|
set_win_formlen ();
|
||||||
|
|
||||||
char defPrinter[80];
|
char defPrinter[80];
|
||||||
@ -848,11 +861,9 @@ void TPrinter::read_configuration(const char *conf)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 1: // file
|
case 1: // file
|
||||||
|
|
||||||
_printertype = fileprinter;
|
_printertype = fileprinter;
|
||||||
break;
|
break;
|
||||||
case 2: // video
|
case 2: // video
|
||||||
|
|
||||||
_printertype = screenvis;
|
_printertype = screenvis;
|
||||||
_curcode = 0;
|
_curcode = 0;
|
||||||
break;
|
break;
|
||||||
@ -863,8 +874,11 @@ void TPrinter::read_configuration(const char *conf)
|
|||||||
TPrinter::~TPrinter ()
|
TPrinter::~TPrinter ()
|
||||||
{
|
{
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
if (_print_rcd != NULL)
|
||||||
|
{
|
||||||
xvt_print_destroy(_print_rcd);
|
xvt_print_destroy(_print_rcd);
|
||||||
xvt_print_close();
|
_print_rcd = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,4 +387,7 @@ public:
|
|||||||
virtual ~TFile_printer();
|
virtual ~TFile_printer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TPrinter& printer();
|
||||||
|
void printer_destroy();
|
||||||
|
|
||||||
#endif // __PRINTER_H
|
#endif // __PRINTER_H
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <printwin.h>
|
#include <printwin.h>
|
||||||
#include <xvtility.h>
|
#include <xvtility.h>
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ HIDDEN int LEN_SPACES(WINDOW win, int x)
|
|||||||
|
|
||||||
void TPrintwin::paint_background(long j)
|
void TPrintwin::paint_background(long j)
|
||||||
{
|
{
|
||||||
const bool isbackground = _bg->items() > 0 && main_app().printer().isgraphics();
|
const bool isbackground = _bg->items() > 0 && printer().isgraphics();
|
||||||
if (!isbackground) return;
|
if (!isbackground) return;
|
||||||
|
|
||||||
int rw = (int)(j % _formlen);
|
int rw = (int)(j % _formlen);
|
||||||
@ -93,7 +94,7 @@ void TPrintwin::paint_background(long j)
|
|||||||
TImage* i = (TImage*)_images.objptr(id);
|
TImage* i = (TImage*)_images.objptr(id);
|
||||||
if (i == NULL)
|
if (i == NULL)
|
||||||
{
|
{
|
||||||
const TString_array& a = main_app().printer().image_names();
|
const TString_array& a = printer().image_names();
|
||||||
const TImage src(a.row(id));
|
const TImage src(a.row(id));
|
||||||
if (src.ok())
|
if (src.ok())
|
||||||
{
|
{
|
||||||
@ -228,7 +229,7 @@ bool TPrintwin::do_print()
|
|||||||
TPrintwin::TPrintwin(TTextfile& txt)
|
TPrintwin::TPrintwin(TTextfile& txt)
|
||||||
: _txt(txt), _inited(FALSE), _aborted(FALSE)
|
: _txt(txt), _inited(FALSE), _aborted(FALSE)
|
||||||
{
|
{
|
||||||
TPrinter& p = main_app().printer();
|
TPrinter& p = printer();
|
||||||
|
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
#if XVT_OS != XVT_OS_SCOUNIX
|
||||||
_printrcd = p.get_printrcd();
|
_printrcd = p.get_printrcd();
|
||||||
|
@ -273,7 +273,7 @@ char *real ::literals () const
|
|||||||
if (c > 1)
|
if (c > 1)
|
||||||
centinaia = primi20[c];
|
centinaia = primi20[c];
|
||||||
else
|
else
|
||||||
centinaia.cut (0);
|
centinaia.cut(0);
|
||||||
v -= c * 100;
|
v -= c * 100;
|
||||||
centinaia << "cento";
|
centinaia << "cento";
|
||||||
} else centinaia.cut(0);
|
} else centinaia.cut(0);
|
||||||
@ -283,20 +283,24 @@ char *real ::literals () const
|
|||||||
centinaia << decine[d];
|
centinaia << decine[d];
|
||||||
v -= d * 10;
|
v -= d * 10;
|
||||||
}
|
}
|
||||||
if (v != 1)
|
|
||||||
|
if (v > 0)
|
||||||
|
{
|
||||||
|
if (v > 1)
|
||||||
{
|
{
|
||||||
centinaia << primi20[v] << potenze[migliaia];
|
centinaia << primi20[v] << potenze[migliaia];
|
||||||
}
|
}
|
||||||
else if (val > 1)
|
else if (val > 1)
|
||||||
{
|
{
|
||||||
if (d > 1)
|
if (d > 1)
|
||||||
centinaia.cut (centinaia.len () - 1);
|
centinaia.cut (centinaia.len() - 1);
|
||||||
centinaia << "un" << (migliaia ? potenze[migliaia] : "o");
|
centinaia << "un" << (migliaia ? potenze[migliaia] : "o");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
centinaia = uni[migliaia];
|
centinaia = uni[migliaia];
|
||||||
|
}
|
||||||
|
|
||||||
risultato.insert (centinaia, 0);
|
risultato.insert(centinaia, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (negativo)
|
if (negativo)
|
||||||
@ -788,3 +792,84 @@ void TDistrib::init (const real & r, bool zap)
|
|||||||
_tot = r; _ready = FALSE;
|
_tot = r; _ready = FALSE;
|
||||||
if (zap) _slices.destroy();
|
if (zap) _slices.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// Importo
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
const TImporto& TImporto::add_to(TToken_string& s) const
|
||||||
|
{
|
||||||
|
const bool dare = sezione() == 'D';
|
||||||
|
const char* v = valore().string();
|
||||||
|
s.add(dare ? v : "", 0);
|
||||||
|
s.add(dare ? "" : v, 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cerified 99%
|
||||||
|
// Ambigous section for ZERO
|
||||||
|
const TImporto& TImporto::operator =(TToken_string& sv)
|
||||||
|
{
|
||||||
|
_valore = real(sv.get(0));
|
||||||
|
if (_valore == ZERO)
|
||||||
|
{
|
||||||
|
_valore = real(sv.get());
|
||||||
|
_sezione = 'A';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_sezione = 'D';
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TImporto& TImporto::set(char s, const real& v)
|
||||||
|
{
|
||||||
|
CHECKD(s == 'D' || s == 'A', "Sezione errata per importo: codice ", (int)s);
|
||||||
|
_sezione = s; _valore = v;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TImporto& TImporto::operator += (const TImporto& i)
|
||||||
|
{
|
||||||
|
if (_valore.is_zero())
|
||||||
|
_sezione = i._sezione;
|
||||||
|
|
||||||
|
if (_sezione == i._sezione)
|
||||||
|
_valore += i._valore;
|
||||||
|
else
|
||||||
|
_valore -= i._valore;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TImporto& TImporto::operator -= (const TImporto& i)
|
||||||
|
{
|
||||||
|
if (_valore.is_zero())
|
||||||
|
_sezione = i._sezione;
|
||||||
|
|
||||||
|
if (_sezione == i._sezione)
|
||||||
|
_valore -= i._valore;
|
||||||
|
else
|
||||||
|
_valore += i._valore;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TImporto& TImporto::swap_section()
|
||||||
|
{
|
||||||
|
_sezione = (_sezione == 'D') ? 'A' : 'D';
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TImporto& TImporto::normalize()
|
||||||
|
{
|
||||||
|
if (_valore.sign() < 0)
|
||||||
|
{
|
||||||
|
_valore = -_valore;
|
||||||
|
swap_section();
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#include <stdtypes.h>
|
#include <stdtypes.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ARRAY_H
|
#ifndef __STRINGS_H
|
||||||
#include <array.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
// @C
|
// @C
|
||||||
class real : public TObject
|
class real : public TObject
|
||||||
@ -156,5 +156,29 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class TImporto : public TObject
|
||||||
|
{
|
||||||
|
char _sezione;
|
||||||
|
real _valore;
|
||||||
|
|
||||||
|
public:
|
||||||
|
char sezione() const { return _sezione; }
|
||||||
|
const real& valore() const { return _valore; }
|
||||||
|
|
||||||
|
bool is_zero() const { return _valore.is_zero(); }
|
||||||
|
|
||||||
|
const TImporto& operator=(const TImporto& i) { return set(i.sezione(), i.valore()); }
|
||||||
|
const TImporto& operator=(TToken_string& sv);
|
||||||
|
const TImporto& operator+=(const TImporto& i);
|
||||||
|
const TImporto& operator-=(const TImporto& i);
|
||||||
|
const TImporto& normalize();
|
||||||
|
const TImporto& swap_section();
|
||||||
|
|
||||||
|
const TImporto& set(char s, const real& v);
|
||||||
|
const TImporto& add_to(TToken_string& s) const;
|
||||||
|
|
||||||
|
TImporto(char s = 'D', const real& v = ZERO) { set(s, v); }
|
||||||
|
TImporto(const TImporto& i) : _sezione(i._sezione), _valore(i._valore) {}
|
||||||
|
};
|
||||||
|
|
||||||
#endif // __REAL_H
|
#endif // __REAL_H
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: relation.cpp,v 1.38 1995-04-19 13:39:17 alex Exp $
|
// $Id: relation.cpp,v 1.39 1995-04-20 14:34:26 guy Exp $
|
||||||
// relation.cpp
|
// relation.cpp
|
||||||
// fv 12/8/93
|
// fv 12/8/93
|
||||||
// relation class for isam files
|
// relation class for isam files
|
||||||
@ -919,9 +919,9 @@ void TCursor::filter(const char* fil, const TRectype *from,
|
|||||||
{
|
{
|
||||||
CHECK(!_frozen, "Impossibile filtrare un cursore congelato");
|
CHECK(!_frozen, "Impossibile filtrare un cursore congelato");
|
||||||
|
|
||||||
TString kf(_keyfrom), kto(_keyto), filter(fil);
|
TString kf(_keyfrom), kto(_keyto);
|
||||||
|
|
||||||
const bool filterchanged = _filter != filter;
|
const bool filterchanged = (fil != NULL) && (_filter != fil);
|
||||||
|
|
||||||
if (file().tab())
|
if (file().tab())
|
||||||
{
|
{
|
||||||
@ -948,7 +948,7 @@ void TCursor::filter(const char* fil, const TRectype *from,
|
|||||||
_lastrec = 0;
|
_lastrec = 0;
|
||||||
if (filterchanged)
|
if (filterchanged)
|
||||||
{
|
{
|
||||||
_filter = filter;
|
_filter = fil;
|
||||||
if (_fexpr) delete _fexpr;
|
if (_fexpr) delete _fexpr;
|
||||||
TTypeexp type = (_filter.find('"') != -1) ? _strexpr : _numexpr;
|
TTypeexp type = (_filter.find('"') != -1) ? _strexpr : _numexpr;
|
||||||
if (_filter.not_empty())
|
if (_filter.not_empty())
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#define SCAD_IMPORTOVAL "IMPORTOVAL"
|
#define SCAD_IMPORTOVAL "IMPORTOVAL"
|
||||||
#define SCAD_DATACAMBIO "DATACAM"
|
#define SCAD_DATACAMBIO "DATACAM"
|
||||||
#define SCAD_DATASCAD "DATASCAD"
|
#define SCAD_DATASCAD "DATASCAD"
|
||||||
#define SCAD_TIPOCF "TIPOCF"
|
#define SCAD_TIPOCF "TIPOC"
|
||||||
#define SCAD_GRUPPO "GRUPPO"
|
#define SCAD_GRUPPO "GRUPPO"
|
||||||
#define SCAD_CONTO "CONTO"
|
#define SCAD_CONTO "CONTO"
|
||||||
#define SCAD_SOTTOCONTO "SOTTOCONTO"
|
#define SCAD_SOTTOCONTO "SOTTOCONTO"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <printer.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -579,7 +580,7 @@ void TSheet::update()
|
|||||||
|
|
||||||
void TSheet::print()
|
void TSheet::print()
|
||||||
{
|
{
|
||||||
TPrinter& pr = main_app().printer();
|
TPrinter& pr = printer();
|
||||||
TPrintrow row;
|
TPrintrow row;
|
||||||
bool ok = pr.open();
|
bool ok = pr.open();
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ void TViswin::exec_link()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LINKHANDLER pl = main_app().printer().getlinkhandler();
|
LINKHANDLER pl = printer().getlinkhandler();
|
||||||
if (pl)
|
if (pl)
|
||||||
pl(_linkID, _multiple ? (const char*)_multiple_link :
|
pl(_linkID, _multiple ? (const char*)_multiple_link :
|
||||||
(const char*)_linktxt);
|
(const char*)_linktxt);
|
||||||
@ -698,7 +698,7 @@ void TViswin::paint_background (long j, int row)
|
|||||||
TImage* i = (TImage*)_images.objptr(id);
|
TImage* i = (TImage*)_images.objptr(id);
|
||||||
if (i == NULL && y1 == 0)
|
if (i == NULL && y1 == 0)
|
||||||
{
|
{
|
||||||
const TString_array& a = main_app().printer().image_names();
|
const TString_array& a = printer().image_names();
|
||||||
const TImage src(a.row(id));
|
const TImage src(a.row(id));
|
||||||
if (src.ok())
|
if (src.ok())
|
||||||
{
|
{
|
||||||
@ -1050,6 +1050,7 @@ void TViswin::update ()
|
|||||||
set_mode (M_COPY);
|
set_mode (M_COPY);
|
||||||
set_brush (BACKGROUND);
|
set_brush (BACKGROUND);
|
||||||
autoscroll (FALSE);
|
autoscroll (FALSE);
|
||||||
|
|
||||||
if (_rulers)
|
if (_rulers)
|
||||||
{
|
{
|
||||||
bar (0, 0, columns() + 1, 1);
|
bar (0, 0, columns() + 1, 1);
|
||||||
@ -2108,6 +2109,10 @@ void TViswin::close_print ()
|
|||||||
if (_bookmarks->items() > 0)
|
if (_bookmarks->items() > 0)
|
||||||
build_index_menu();
|
build_index_menu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TImage* i = (TImage*)_images.objptr(0);
|
||||||
|
if (i != NULL) i->set_palette(win());
|
||||||
|
|
||||||
force_update ();
|
force_update ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2363,13 +2368,13 @@ TViswin::TViswin(const char *fname,
|
|||||||
_textcolumns = TEXTCOLUMNS;
|
_textcolumns = TEXTCOLUMNS;
|
||||||
autoscroll (TRUE);
|
autoscroll (TRUE);
|
||||||
|
|
||||||
_links = _toplevel ? &(main_app().printer().links()) : &(_brwfld->_links);
|
_links = _toplevel ? &(printer().links()) : &(_brwfld->_links);
|
||||||
_multiple = _toplevel ? (main_app().printer ().ismultiplelink()) :
|
_multiple = _toplevel ? (printer ().ismultiplelink()) :
|
||||||
(_brwfld->is_multiple_link());
|
(_brwfld->is_multiple_link());
|
||||||
_bookmarks = &(main_app().printer().get_bookmarks());
|
_bookmarks = &(printer().get_bookmarks());
|
||||||
|
|
||||||
_bg = _toplevel ? &(main_app().printer().getbgdesc()) : _brwfld->get_bg_desc();
|
_bg = _toplevel ? &(printer().getbgdesc()) : _brwfld->get_bg_desc();
|
||||||
_formlen = _toplevel ? main_app().printer().formlen() : maxalt;
|
_formlen = _toplevel ? printer().formlen() : maxalt;
|
||||||
_linkID = -1;
|
_linkID = -1;
|
||||||
_inside_linkexec = FALSE;
|
_inside_linkexec = FALSE;
|
||||||
|
|
||||||
@ -2520,7 +2525,7 @@ void TBrowsefile_field::disable_link(char fg, char bg)
|
|||||||
|
|
||||||
void TBrowsefile_field::set_background(const char* bg)
|
void TBrowsefile_field::set_background(const char* bg)
|
||||||
{
|
{
|
||||||
main_app().printer().parse_background(bg,_background);
|
printer().parse_background(bg,_background);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBrowsefile_field::add_line(const char* l)
|
void TBrowsefile_field::add_line(const char* l)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <date.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
#include <window.h>
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
extern "C" { long nap(long period); }
|
extern "C" { long nap(long period); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user