Commentate varie parti per rendere possibile la compilazione di AGA.FLL

Avvertimento di esaurimento delle risorse di Windows
Navigazione con TAB e Shift-TAB sulle celle disabilitate degli sheet.


git-svn-id: svn://10.65.10.50/trunk@693 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-11-24 14:01:20 +00:00
parent f9f06059d3
commit 827fbd2701
12 changed files with 103 additions and 90 deletions

View File

@ -11,7 +11,7 @@
#include <xvtility.h>
#endif
#include <applicat.h>
#endif // XVT_OS
#endif /* XVT_OS */
#ifdef FOXPRO
@ -19,10 +19,6 @@
#include <pro_ext.h>
#endif
#ifdef XVT_R3_API
#include <windows.h>
#endif
#include <checks.h>
#define buildmsg() char msg[256];va_list argptr;va_start(argptr,fmt);vsprintf(msg,fmt,argptr);va_end(argptr)

View File

@ -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);
}

View File

@ -2,21 +2,22 @@
#include <stdlib.h>
#define __ISAM_CPP
#include <isam.h>
#ifndef FOXPRO
#include <applicat.h>
#include <expr.h>
#include <execp.h>
#include <progind.h>
#endif
#include <execp.h>
#include <relation.h>
#include <config.h>
#include <prefix.h>
#include <extcdecl.h>
#include <isam.h>
#include <mailbox.h>
#include <prefix.h>
#include <relation.h>
#include <scanner.h>
#include <utility.h>
#include <applicat.h>
#include <mailbox.h>
#if XVT_OS==XVT_OS_SCOUNIX
#include <sys/types.h>
@ -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
////////////////////////////////////////////////////////////

View File

@ -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;

View File

@ -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 <xvt.h>
#include <applicat.h>
@ -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);

View File

@ -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); }

View File

@ -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);

View File

@ -1 +1 @@
#define VERSION 1.15
#define VERSION 1.16

View File

@ -1,7 +1,6 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <lffiles.h>
#define __PREFIX_CPP
#include <prefix.h>
@ -15,6 +14,8 @@
#include <scanner.h>
#include <utility.h>
#include <lffiles.h>
HIDDEN const char* const glockname = "xx";
TPrefix::TPrefix()

View File

@ -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 <mailbox.h>
#include <sheet.h>
#include <urldefid.h>
@ -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);
}
}
}

View File

@ -9,26 +9,8 @@
#include <strings.h>
#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 <xvt.h>
#endif
// @C

View File

@ -3,7 +3,10 @@
#include <stdarg.h>
#include <stdlib.h>
#include <strstream.h>
#ifndef FOXPRO
#include <applicat.h>
#endif
#include <strings.h>
#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);