Correzioni al programma di gestione tracciati

git-svn-id: svn://10.65.10.50/trunk@1606 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1995-07-17 16:53:26 +00:00
parent ca135be10a
commit 2e0201a5ba
5 changed files with 9 additions and 32 deletions

View File

@ -560,7 +560,7 @@ void TManutenzione_app::update_dir()
{
TFilename path(fd.path());
path.rtrim(1);
if (!fexist(path))
if (path.not_empty() && !fexist(path))
ok = make_dir(path);
if (ok && fcopy(fs, fd))
{

View File

@ -55,7 +55,6 @@ class TRec_sheet : public TObject
protected:
bool check_key_expr(int key, const char* key_expr);
static bool fld_notify(int r, KEY k);
static bool key_notify(int r, KEY k);
void save();
virtual long items() const { return _rec->fields(); }

View File

@ -34,7 +34,6 @@
#define FLD_LEN 103
#define FLD_DEC 104
#define FLD_DES 105
#define F_NUMF 110
#define F_NUM 501
#define F_DES 502

View File

@ -71,12 +71,6 @@ ENDMASK
PAGE "Campo" -1 -1 70 11
STRING F_NUMF 3 3
BEGIN
PROMPT 2 1 "Numero "
FLAGS "DR"
END
STRING F_NOMEF 10
BEGIN
PROMPT 2 2 "Nome "
@ -167,7 +161,6 @@ END
BOOLEAN F_KDUP
BEGIN
PROMPT 1 4 "Chiavi duplicate"
FLAGS "D"
END
BUTTON DLG_OK 8 2

View File

@ -185,30 +185,15 @@ HIDDEN bool len_handler(TMask_field& f, KEY key)
}
bool TRec_sheet::fld_notify(int r, KEY k)
{
const TSheet_field& f = (const TSheet_field&) _mask->field(F_FIELDS);
if (k == K_SPACE)
{
TMask& m = f.sheet_mask();
m.set(F_NUMF, r + 1);
}
return TRUE;
}
bool TRec_sheet::key_notify(int r, KEY k)
{
const TSheet_field& f = (const TSheet_field&) _mask->field(F_KEYS);
TSheet_field& f = (TSheet_field&) _mask->field(F_KEYS);
TMask& m = f.sheet_mask();
if (r == 0)
m.reset(F_KDUP);
m.enable(F_KDUP, r > 0);
if (k == K_INS && f.items() >= 8) return FALSE;
if (k == K_INS)
{
f.disable_cell(0, 1);
if (f.items() >= 8) return FALSE;
}
return TRUE;
}
@ -242,7 +227,6 @@ void TRec_sheet::edit()
_mask->set (F_NUM, _dir->num());
_mask->set (F_DES, _dir->des());
f1.set_notify(fld_notify);
f1.sheet_mask().field(FLD_LEN).set_handler(len_handler);
int nfields = _rec->fields();
@ -258,6 +242,7 @@ void TRec_sheet::edit()
f2.set_notify(key_notify);
int nkeys = _rec->keys();
for (i = 0; i < nkeys; i++) f2.row(i) = _rec->keydef(i);
f2.disable_cell(0, 1);
while (TRUE)
{
switch (_mask->run())
@ -334,6 +319,7 @@ void TRec_sheet::edit()
nkeys = _rec->keys();
f2.reset();
for (i = 0; i < nkeys; i++) f2.row(i) = _rec->keydef(i);
f2.disable_cell(0, 1);
}
}
}