Patch level : 2.0 232

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :

Migliorata ricerca su campi "zoom" (descrizione articolo in righe documento)
Correzione necessaria per PG200009


git-svn-id: svn://10.65.10.50/trunk@11342 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-07-23 07:47:28 +00:00
parent e17772ddf0
commit 217b32a84a
4 changed files with 51 additions and 61 deletions

View File

@ -1,16 +1,11 @@
#include <stdio.h>
#include <applicat.h>
#include <expr.h>
#include <files.h>
#include <utility.h>
#include <config.h>
#ifndef FOXPRO
#include <expr.h>
#include <applicat.h>
#else
#include <strings.h>
#endif
#include <extcdecl.h>
#include <lffiles.h>
@ -20,10 +15,8 @@
HIDDEN char _files_tmp_string[256];
TFile::TFile (int lenrec, int base)
{
_file = new SecDef;
// if (_file == NULL) fatal_box ("Can't allocate record file ");
_file->IOR = NOERR;
_len = lenrec;
_base = base;
@ -33,7 +26,6 @@ TFile::TFile (int lenrec, int base)
}
TFile::~TFile ()
{
delete _file;
}
@ -682,29 +674,26 @@ void TTrec::print_on (ostream & out) const
void TTrec::read_from (istream & in)
{
int ln;
const int n = num();
in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n');
if (_des && n>=LF_TABGEN && n<=LF_TAB)
{
TString t(_files_tmp_string);
if (t.find('|')>-1)
const TFixed_string t(_files_tmp_string);
if (t.find('|') >= 0)
{
TString tabname(t.right(3));
const TString4 tabname(t.right(3));
strcpy(_files_tmp_string,t.left(t.len()-4)); // Toglie il nome della tabella
if (_tab != tabname && !yesno_box("Descrizione relativa alla tabella %s.\n Continuo ?",(const char*) tabname))
return;
}
}
ln = atoi (_files_tmp_string);
if (ln != n && !yesno_box ("Descrizione relativa al file n.ro %d.\n Continuo ?", ln))
const int ln = atoi (_files_tmp_string);
if (n > 0 && ln != n && !yesno_box ("Descrizione relativa al file n.ro %d.\n Continuo ?", ln))
return;
int nfields;
in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n');
nfields = atoi (_files_tmp_string);
const int nfields = atoi (_files_tmp_string);
set_fields (nfields);
TToken_string t;
for (int i = 0; i < nfields; i++)

View File

@ -3221,14 +3221,14 @@ void TRectype::put(const char* fieldname, const TDate& val)
void TRectype::put(const char* fieldname, char val)
{
const char w[2] = {val, '\0'};
const char w[2] = { val, '\0' };
put_str( fieldname, w);
}
void TRectype::put(const char* fieldname, bool val)
{
char s[2] = { val ? 'X' : ' ', '\0'};
const char s[2] = { val ? 'X' : ' ', '\0' };
put_str( fieldname, s);
}
@ -3251,7 +3251,7 @@ void TRectype::put_str(const char* fieldname, const char* val)
if (ft == _boolfld)
val = (*val && strchr("1STXY", toupper(*val)) != NULL) ? "T" : "F";
if (*val == '\0') // VERIFICRE COL REPOSITORY
if (*val == '\0') // VERIFICARE COL REPOSITORY
{
TRecfield f(*this, fieldname);
if (*f.pos() == '\0') return;
@ -3456,7 +3456,7 @@ bool TRectype::get_relapp(TString& app) const
{
if (*_tab)
{
TString8 cod(_tab);
TString4 cod(_tab);
if (num() == LF_TABCOM)
cod.insert("%");
else
@ -3472,51 +3472,47 @@ void TRectype::edit(int logicnum, const char * alternate_key_fields) const
{
if (logicnum <= 0)
logicnum = num();
TToken_string key_labels;
TRectype r(logicnum);
if (*_tab)
r.settab(_tab);
const RecDes* recd = r.rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
for (int i = 0; i < kd.NkFields; i++)
{
const int nf = kd.FieldSeq[i] % MaxFields;
const RecFieldDes& rf = recd->Fd[nf];
key_labels.add(rf.Name);
}
TToken_string key_fields(alternate_key_fields);
if (key_fields.empty_items())
key_fields = key_labels;
TFilename ininame; ininame.temp();
{
TConfig ini(ininame, "Transaction");
ini.set("Action", "MODIFY");
TString16 p; p << logicnum;
ini.set_paragraph(p);
FOR_EACH_TOKEN(key_labels, tok)
{
const TString16 name(tok);
const TString& value = get(key_fields.get());
ini.set(name, value);
}
}
TString app;
if (r.get_relapp(app))
{
const RecDes* recd = r.rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
TToken_string key_labels;
for (int i = 0; i < kd.NkFields; i++)
{
const int nf = kd.FieldSeq[i] % MaxFields;
const RecFieldDes& rf = recd->Fd[nf];
key_labels.add(rf.Name);
}
TToken_string key_fields(alternate_key_fields);
if (key_fields.empty_items())
key_fields = key_labels;
TFilename ininame; ininame.temp();
{
TConfig ini(ininame, "Transaction");
ini.set("Action", "LINK");
TString16 p; p << logicnum;
ini.set_paragraph(p);
FOR_EACH_TOKEN(key_labels, tok)
{
const TString16 name(tok);
const TString& value = get(key_fields.get());
ini.set(name, value);
}
}
app << " -i" << ininame;
TExternal_app a(app);
a.run();
xvt_fsys_removefile(ininame);
}
}

View File

@ -2189,11 +2189,15 @@ void TBrowse::do_output(CheckTime t)
if (do_that)
{
// Considera a parte l'inizializzazione delle transazioni!
if (!f.mask().is_running() && main_app().class_id() == CLASS_RELATION_APPLICATION)
if (!f.empty() && main_app().class_id() == CLASS_RELATION_APPLICATION)
{
const TRelation_application& ra = (const TRelation_application&)main_app();
if (ra.is_transaction() && !f.empty())
do_that = false;
const TMask& m = f.mask();
if (!m.is_running() && m.get_sheet() == NULL)
{
const TRelation_application& ra = (const TRelation_application&)main_app();
if (ra.is_transaction())
do_that = false;
}
}
}
if (do_that)

View File

@ -1604,6 +1604,7 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
switch (c.class_id())
{
case CLASS_EDIT_FIELD:
case CLASS_ZOOM_FIELD:
e = &add_string(c.dlg(), 0, p, 1, y++, csize, flags, csize > 50 ? 50 : csize);
break;
case CLASS_REAL_FIELD: