Corretta generazione nomi file temporanei e MESSAGE COPY delle maschere
git-svn-id: svn://10.65.10.50/trunk@309 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f3d76f55e8
commit
6426742708
@ -5,11 +5,11 @@
|
||||
#include <isam.h>
|
||||
|
||||
#ifndef FOXPRO
|
||||
#include <expr.h>
|
||||
#include <progind.h>
|
||||
#endif
|
||||
#include <execp.h>
|
||||
#include <relation.h>
|
||||
#include <expr.h>
|
||||
#include <config.h>
|
||||
#include <prefix.h>
|
||||
#include <extcdecl.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
// $Id: maskfld.cpp,v 1.25 1994-10-03 08:47:14 guy Exp $
|
||||
// $Id: maskfld.cpp,v 1.26 1994-10-04 15:38:47 guy Exp $
|
||||
#include <xvt.h>
|
||||
|
||||
#include <applicat.h>
|
||||
@ -516,7 +516,7 @@ HIDDEN void modify_list(bool add, TMask_field& f, TToken_string& msg)
|
||||
HIDDEN const char* copy_value(TToken_string& msg, const TString& val)
|
||||
{
|
||||
int from = msg.get_int()-1;
|
||||
int to = 0;
|
||||
int to = -1;
|
||||
if (from < 0) from = 0;
|
||||
else to = msg.get_int();
|
||||
return val.sub(from, to);
|
||||
|
@ -547,7 +547,7 @@ break;
|
||||
}
|
||||
c->set(nuo); // Set new mask value
|
||||
c->set_dirty(); // Get it dirty!
|
||||
if (c->on_key(K_TAB) == FALSE) // Test it
|
||||
if (c->on_key(c->is_edit() ? K_TAB : K_SPACE) == FALSE) // Test it
|
||||
{
|
||||
c->set(old);
|
||||
xiev->refused = TRUE;
|
||||
@ -792,10 +792,26 @@ void TSpreadsheet::mask2str(int riga)
|
||||
TToken_string& r = row(riga);
|
||||
r.cut(0);
|
||||
for (short id = FIRST_FIELD; ; id++)
|
||||
{
|
||||
const int pos = _mask.id2pos(id);
|
||||
{
|
||||
int pos = _mask.id2pos(id);
|
||||
if (pos < 0) break;
|
||||
r.add(_mask.fld(pos).get());
|
||||
|
||||
for(int dlg = id; pos >= 0; pos = _mask.id2pos(dlg += 100))
|
||||
{
|
||||
const TMask_field& f = _mask.fld(pos);
|
||||
if (f.showed())
|
||||
{
|
||||
r.add(f.get());
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef DBG
|
||||
if (pos < 0)
|
||||
{
|
||||
warning_box("Non e' visibile il campo %d per lo sheet", dlg);
|
||||
r.add(" ");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
update_rec(riga);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// $Id: relation.cpp,v 1.13 1994-09-27 10:19:32 alex Exp $
|
||||
// $Id: relation.cpp,v 1.14 1994-10-04 15:38:54 guy Exp $
|
||||
// relation.cpp
|
||||
// fv 12/8/93
|
||||
// relation class for isam files
|
||||
@ -669,10 +669,10 @@ FILE* TCursor::open_index(bool create) const
|
||||
TRecnotype TCursor::buildcursor(TRecnotype rp)
|
||||
{
|
||||
TRecnotype ap = 0, junkl;
|
||||
char s[82];
|
||||
int junk, l, pagecnt = 0;
|
||||
Page p;
|
||||
int pos;
|
||||
char s[82];
|
||||
int junk, l, pagecnt = 0;
|
||||
Page p;
|
||||
int pos;
|
||||
const int kl = file().filehnd()->i.Base[file().filehnd()->i.PN].KeyLen;
|
||||
const bool filtered = has_filter();
|
||||
|
||||
@ -959,9 +959,6 @@ TCursor::TCursor(TRelation* r, const char* filter, int nkey, TRectype *from, TRe
|
||||
CHECKD(_nkey > 0 && _nkey <= file().filehnd()->r->NKeys, "Bad key number : ", _nkey);
|
||||
_indexname.temp("ci");
|
||||
|
||||
FILE* _f = open_index(TRUE);
|
||||
fclose(_f);
|
||||
|
||||
_pos = 0;
|
||||
_totrec = 0;
|
||||
_lastrec = 0;
|
||||
@ -1073,7 +1070,6 @@ TRecnotype TCursor::operator +=(const TRecnotype npos)
|
||||
|
||||
|
||||
TRecnotype TCursor::items()
|
||||
|
||||
{
|
||||
if (changed())
|
||||
_totrec = update();
|
||||
|
@ -96,25 +96,25 @@ TString& TString::operator <<(char c)
|
||||
|
||||
|
||||
TString& TString::operator <<(int n)
|
||||
{
|
||||
const int pos = make_room(8);
|
||||
sprintf(&_str[pos], "%d", n);
|
||||
return *this;
|
||||
{
|
||||
char s[16];
|
||||
sprintf(s, "%d", n);
|
||||
return operator <<(s);
|
||||
}
|
||||
|
||||
|
||||
TString& TString::operator <<(long n)
|
||||
{
|
||||
const int pos = make_room(12);
|
||||
sprintf(&_str[pos], "%ld", n);
|
||||
return *this;
|
||||
char s[16];
|
||||
sprintf(s, "%ld", n);
|
||||
return operator <<(s);
|
||||
}
|
||||
|
||||
TString& TString::operator <<(double n)
|
||||
{
|
||||
const int pos = make_room(16);
|
||||
sprintf(&_str[pos], "%lg", n);
|
||||
return *this;
|
||||
char s[32];
|
||||
sprintf(s, "%lf", n);
|
||||
return operator <<(s);
|
||||
}
|
||||
|
||||
// Appends an object to the string
|
||||
@ -586,7 +586,7 @@ const TFilename& TFilename::tempdir()
|
||||
mkdir(_str);
|
||||
#endif
|
||||
if (res == 0)
|
||||
warning_box("E' stata creata la directory per i file temporanei '%s'", _str);
|
||||
message_box("E' stata creata la directory per i file temporanei '%s'", _str);
|
||||
else
|
||||
fatal_box("Impossibile creare la directory '%s' per i file temporanei", _str);
|
||||
}
|
||||
@ -600,13 +600,9 @@ const TFilename& TFilename::temp(const char* prefix)
|
||||
const TFilename dirpref(tempdir());
|
||||
char* t = NULL;
|
||||
|
||||
TString16 est;
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
set(prefix);
|
||||
est = ext(); // Memorizza eventuale estensione
|
||||
if (est.not_empty()) ext(""); // Toglie " "
|
||||
|
||||
strip("$#");
|
||||
t = tempnam((char*)(const char*)dirpref, (char*)_str);
|
||||
@ -631,13 +627,10 @@ const TFilename& TFilename::temp(const char* prefix)
|
||||
set(t);
|
||||
}
|
||||
|
||||
if (est.not_empty()) ext(est); // Ripristina estensione
|
||||
else
|
||||
{
|
||||
const char* const e = ext();
|
||||
if (e == NULL || *e == '\0') // Aggiunge estensione
|
||||
ext("tmp");
|
||||
}
|
||||
#ifdef DBG
|
||||
if (fexist(_str))
|
||||
fatal_box("Il file '%s' esiste gia'", t);
|
||||
#endif
|
||||
if (t) free(t);
|
||||
|
||||
return *this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user