diff --git a/include/checks.cpp b/include/checks.cpp index 8fad7cbd3..81ee460db 100755 --- a/include/checks.cpp +++ b/include/checks.cpp @@ -11,7 +11,7 @@ #include #endif #include -#endif // XVT_OS +#endif /* XVT_OS */ #ifdef FOXPRO @@ -19,10 +19,6 @@ #include #endif -#ifdef XVT_R3_API -#include -#endif - #include #define buildmsg() char msg[256];va_list argptr;va_start(argptr,fmt);vsprintf(msg,fmt,argptr);va_end(argptr) diff --git a/include/execp.cpp b/include/execp.cpp index 09d6467e2..68298d3b9 100755 --- a/include/execp.cpp +++ b/include/execp.cpp @@ -77,7 +77,12 @@ int TExternal_app::run(bool async, bool iconized) _exitcode = 0; } else - error_box("Impossibile eseguire '%s':\nErrore %d", (const char*)_path, _exitcode); + { + if (_exitcode == 16) + error_box("'%s' e' gia' in esecuzione", (const char*)_path); + else + error_box("Impossibile eseguire '%s':\nErrore %d", (const char*)_path, _exitcode); + } set_cursor(TASK_WIN, CURSOR_ARROW); } diff --git a/include/isam.cpp b/include/isam.cpp index dd01e6c7c..74479e142 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -2,21 +2,22 @@ #include #define __ISAM_CPP -#include #ifndef FOXPRO +#include #include +#include #include #endif -#include -#include + #include -#include #include +#include +#include +#include +#include #include #include -#include -#include #if XVT_OS==XVT_OS_SCOUNIX #include @@ -594,46 +595,8 @@ int TBaseisamfile::_open(unsigned int mode) { isdef * fh = filehnd(); const TRecnotype nitems = fh->i.Base[0].PEOX; - if (fh->d->EOX != nitems) - { - CHECKD(getkey() == 1, "La chiave corrente non e' 1 ma ", getkey()); - TFilename fn = filename(); - - fn = fn.name(); - if (yesno_box("La dimensione dell' archivio %s e' errata. Cerco di recuperarlo ?", (const char *) fn)) - { - TDir d; - TString mess(80); - { - mess.format("Ricostruzione archivio %s : I Fase", (const char*) fn); - TProgind p(nitems ? nitems : 1, mess, TRUE, TRUE, 70); - - d.get(num(), _lock, _nordir, _sysdirop); - d.eod() = fh->d->EOD = nitems; - d.eox() = fh->d->EOX = nitems; - d.put(num(), _nordir, _sysdirop); - for (TRecnotype r = 1; r <= nitems; r++) - { - p.addstatus(1); - CRead(&fh->f, curr().string(), r, _nolock); - curr().discard(); - CWrite(&fh->f, curr().string(), r, _nolock); - } - } - mess.format("Ricostruzione archivio %s : II Fase", (const char*) fn); - TProgind p(items() ? items() : 1, mess, TRUE, TRUE, 70); - for (first(); good(); next()) - { - p.addstatus(1); - curr().recall(); - rewrite(); - } - message_box("L'archivio %s deve essere compattato", (const char *) fn); - } - else - fatal_box("L'archivio %s deve essere corretto prima di utilizzarlo", (const char *) fn); - } + recover(); } _recno = -1L; _current->_i = filehnd(); @@ -851,6 +814,8 @@ int TSystemisamfile::build(TRecnotype eox) cisbuild(filehnd(), num(), eox, &err); setstatus(err); clearfilehnd(); + +#ifndef FOXPRO if (err == NOERR && __autoload) { TFilename lf; @@ -859,6 +824,8 @@ int TSystemisamfile::build(TRecnotype eox) if (fexist(lf)) load(lf); } +#endif + return err; } @@ -903,7 +870,7 @@ bool TSystemisamfile::exec_convapp(long flev, const bool before) { int err = 0; TString80 s(conv.get(v, NULL, num())); s << " " << main_app().get_firm(); - TExternal_app app(s); + TExternal_app app(s); if (app.can_run()) { @@ -1347,10 +1314,57 @@ int TSystemisamfile::dump(const char* to, int nkey, char fs, char fd, char rs, b fclose(f); setstatus(err); return err; -} +} #endif // FOXPRO + +void TBaseisamfile::recover() +{ + isdef * fh = filehnd(); + const TRecnotype nitems = fh->i.Base[0].PEOX; + + CHECKD(getkey() == 1, "La chiave corrente non e' 1 ma ", getkey()); + TFilename fn = filename(); + + fn = fn.name(); +#ifndef FOXPRO + if (yesno_box("La dimensione dell' archivio %s e' errata. Cerco di recuperarlo?", (const char *) fn)) + { + TDir d; + TString mess(80); + + mess.format("Ricostruzione archivio %s : I Fase", (const char*) fn); + TProgind p(nitems ? nitems : 1, mess, TRUE, TRUE, 70); + d.get(num(), _lock, _nordir, _sysdirop); + d.eod() = fh->d->EOD = nitems; + d.eox() = fh->d->EOX = nitems; + d.put(num(), _nordir, _sysdirop); + for (TRecnotype r = 1; r <= nitems; r++) + { + p.addstatus(1); + CRead(&fh->f, curr().string(), r, _nolock); + curr().discard(); + CWrite(&fh->f, curr().string(), r, _nolock); + } + p.close_modal(); + + mess.format("Ricostruzione archivio %s : II Fase", (const char*) fn); + TProgind pi(items() ? items() : 1, mess, TRUE, TRUE, 70); + for (first(); good(); next()) + { + pi.addstatus(1); + curr().recall(); + rewrite(); + } + message_box("L'archivio %s deve essere compattato", (const char *) fn); + } + else +#endif + fatal_box("L'archivio %s e' incosistente e deve essere corretto prima di utilizzarlo", (const char *)fn); +} + + //////////////////////////////////////////////////////////// // TRectype //////////////////////////////////////////////////////////// diff --git a/include/isam.h b/include/isam.h index 88f475422..9c718911f 100755 --- a/include/isam.h +++ b/include/isam.h @@ -190,6 +190,8 @@ protected: // @FPROT isdef** ptrfilehnd() const { return (isdef**) &_isamfile;} void clearfilehnd() { _isamfile = NULL;} + + void recover(); int _open(unsigned int mode = _manulock); // Apre isam file con lock int _close(); const char* filename() const; diff --git a/include/maskfld.cpp b/include/maskfld.cpp index c4d02806a..d3c8b08f7 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -1,4 +1,4 @@ -// $Id: maskfld.cpp,v 1.51 1994-11-18 16:49:41 guy Exp $ +// $Id: maskfld.cpp,v 1.52 1994-11-24 14:01:01 guy Exp $ #include #include @@ -1472,11 +1472,8 @@ KEY TBrowse::run() else path = _insert.mid(1); - if (main_app().name() != cmd2name(path)) // Se non lancerei me stesso e ... - { - TExternal_app a(path); - if (a.can_run()) buttons = 1; // ... se c'e' memoria - } + if (main_app().name() != cmd2name(path)) // Se non lancerei me stesso + buttons = 1; } TBrowse_sheet s(_cursor, _items, caption, _head, buttons, _fld, sib); diff --git a/include/maskfld.h b/include/maskfld.h index 9fdfc844f..bfaa57433 100755 --- a/include/maskfld.h +++ b/include/maskfld.h @@ -1,4 +1,4 @@ -/* $Id: maskfld.h,v 1.11 1994-11-16 15:51:01 guy Exp $ */ +/* $Id: maskfld.h,v 1.12 1994-11-24 14:01:07 guy Exp $ */ #ifndef __MASKFLD_H #define __MASKFLD_H @@ -148,6 +148,7 @@ public: void disable() { enable(FALSE); } bool enabled() const { return _flags.enabled; } void enable_default(); + bool enabled_default() const { return _flags.enable_default; } virtual void show(bool on = TRUE); void hide() { show(FALSE); } diff --git a/include/msksheet.cpp b/include/msksheet.cpp index ffb4f9de4..cb0127d7b 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -392,6 +392,8 @@ void TSpreadsheet::xiev_handler(XI_OBJ *itf, XI_EVENT *xiev) // Certified 75% void TSpreadsheet::list_handler(XI_EVENT *xiev) { + static KEY _lastab = K_TAB; + switch (xiev->type) { case XIE_GET_FIRST: @@ -572,7 +574,7 @@ break; const int col = (f->dlg()-FIRST_FIELD) % 100; if (cell_disabled(_cur_row, col)) // If the cell is disabled ... { - dispatch_e_char(win(), K_TAB); // ... skip to the next one. + dispatch_e_char(win(), _lastab); // ... skip to the next one. } else { @@ -636,6 +638,10 @@ break; const KEY k = e_char_to_key(ep); switch(k) { + case K_TAB: + case K_BTAB: + _lastab = k; + break; case K_F1: _check_enabled = FALSE; // Disable checks _edit_field->on_key(K_F1); diff --git a/include/prassi.ver b/include/prassi.ver index 0704a4464..2b2f55dd9 100755 --- a/include/prassi.ver +++ b/include/prassi.ver @@ -1 +1 @@ -#define VERSION 1.15 +#define VERSION 1.16 diff --git a/include/prefix.cpp b/include/prefix.cpp index 4fb8fed54..4cce5f65d 100755 --- a/include/prefix.cpp +++ b/include/prefix.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #define __PREFIX_CPP #include @@ -15,6 +14,8 @@ #include #include +#include + HIDDEN const char* const glockname = "xx"; TPrefix::TPrefix() diff --git a/include/relapp.cpp b/include/relapp.cpp index d1f70c68d..31c434e1a 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -1,4 +1,4 @@ -// $Id: relapp.cpp,v 1.33 1994-11-18 17:01:23 guy Exp $ +// $Id: relapp.cpp,v 1.34 1994-11-24 14:01:16 guy Exp $ #include #include #include @@ -214,11 +214,13 @@ void TRelation_application::enable_query() { const int num = chiave.pos(i); TMask_field& c = _mask->fld(num); - const bool has_query = c.has_query(); - if (k == 1) - c.enable(query); - if (has_query) - ((TEdit_field&)c).enable_check(query); + if (c.enabled_default()) + { + if (k == 1) + c.enable(query); + if (c.has_query()) + ((TEdit_field&)c).enable_check(query); + } } } diff --git a/include/scanner.h b/include/scanner.h index bc4bce24d..95ccaaeb2 100755 --- a/include/scanner.h +++ b/include/scanner.h @@ -9,26 +9,8 @@ #include #endif -#ifndef XVT_R3_API -#ifndef XVT_INCL_TYPE -// @T -typedef struct s_rct { /* mathematical rectangle */ - short top; /* top coordinate */ - short left; /* left coordinate */ - short bottom; /* bottom coordinate */ - short right; /* right coordinate */ -} RCT; -#endif -#else -#ifndef XVT_INCL_XVTTYPE -typedef struct s_rct { /* mathematical rectangle */ - short top; /* top coordinate */ - short left; /* left coordinate */ - short bottom; /* bottom coordinate */ - short right; /* right coordinate */ -} RCT; -#endif - +#ifndef INCL_XVTH +#include #endif // @C diff --git a/include/strings.cpp b/include/strings.cpp index 7efc224c5..6ff1e2bc7 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -3,7 +3,10 @@ #include #include #include + +#ifndef FOXPRO #include +#endif #include #if XVT_OS==XVT_OS_SCOUNIX @@ -605,7 +608,9 @@ const TFilename& TFilename::tempdir() mkdir(_str); #endif } - + +#ifndef FOXPRO + const TString& user = main_app().user(); if (res == 0 && user.not_empty()) { @@ -626,6 +631,8 @@ const TFilename& TFilename::tempdir() #endif } } + +#endif /* FOXPRO */ if (res != 0) fatal_box("Impossibile creare la directory '%s' per i file temporanei", _str);