Corretta put_paragraph (da controllare) apply_format e vari validate
git-svn-id: svn://10.65.10.50/trunk@5139 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8af278924f
commit
f2c81b4290
225
include/form.cpp
225
include/form.cpp
@ -1461,7 +1461,8 @@ bool TForm_string::read()
|
|||||||
|
|
||||||
void TForm_string::put_paragraph(const char* s)
|
void TForm_string::put_paragraph(const char* s)
|
||||||
{
|
{
|
||||||
if (hidden()) return;
|
if (hidden()) return;
|
||||||
|
|
||||||
const int h = height();
|
const int h = height();
|
||||||
|
|
||||||
if (h > 1)
|
if (h > 1)
|
||||||
@ -1489,25 +1490,30 @@ void TForm_string::put_paragraph(const char* s)
|
|||||||
}
|
}
|
||||||
_effective_height = i;
|
_effective_height = i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
string_at(-1, _y, s);
|
{
|
||||||
|
if (_prompt.empty())
|
||||||
|
string_at(x(), _y, s);
|
||||||
|
else
|
||||||
|
string_at(-1 , _y, s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TForm_string::apply_format(TString& s, const TString& p) const
|
void TForm_string::apply_format(TString& s) const
|
||||||
{
|
{
|
||||||
TString tmp(s);
|
TString tmp(s);
|
||||||
if (!p.blank())
|
if (!picture().blank())
|
||||||
{
|
{
|
||||||
TToken_string delim(4, ','); // Stringa con i due delimitatori
|
TToken_string delim(4, ','); // Stringa con i due delimitatori
|
||||||
const char* pic = p; // Picture senza delimitatori
|
const char * pic = picture(); // Picture senza delimitatori
|
||||||
|
|
||||||
if (pic[0] == '(') // Se ci sono i delimitatori ...
|
if (pic[0] == '(') // Se ci sono i delimitatori ...
|
||||||
{
|
{
|
||||||
const int bra = p.find(')');
|
const int bra = picture().find(')');
|
||||||
if (bra > 0) // ... cerca la parentesi chiusa
|
if (bra > 0) // ... cerca la parentesi chiusa
|
||||||
{
|
{
|
||||||
delim = p.sub(1, bra); // memorizza delimitatori
|
delim = picture().sub(1, bra); // memorizza delimitatori
|
||||||
pic += bra+1; // toglili dalla picture
|
pic += bra+1; // toglili dalla picture
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1553,7 +1559,7 @@ bool TForm_string::update()
|
|||||||
do_message(n);
|
do_message(n);
|
||||||
// prende il campo e lo stampa
|
// prende il campo e lo stampa
|
||||||
s = get();
|
s = get();
|
||||||
apply_format(s, picture());
|
apply_format(s);
|
||||||
put_paragraph(s);
|
put_paragraph(s);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1562,7 +1568,7 @@ bool TForm_string::update()
|
|||||||
const char* TForm_string::example() const
|
const char* TForm_string::example() const
|
||||||
{
|
{
|
||||||
TString prova("XXXXXXXXXXXXXXXXXXXXXXXXXX");
|
TString prova("XXXXXXXXXXXXXXXXXXXXXXXXXX");
|
||||||
apply_format(prova, picture());
|
apply_format(prova);
|
||||||
const int w = width();
|
const int w = width();
|
||||||
if (prova.size() > w && w > 0) prova.cut(w);
|
if (prova.size() > w && w > 0) prova.cut(w);
|
||||||
return strcpy(__tmp_string, prova);
|
return strcpy(__tmp_string, prova);
|
||||||
@ -1576,7 +1582,6 @@ const char* TForm_string::example() const
|
|||||||
|
|
||||||
class TForm_number : public TForm_string
|
class TForm_number : public TForm_string
|
||||||
{
|
{
|
||||||
void apply_format(real& r, TString& s) const;
|
|
||||||
|
|
||||||
protected: // TForm_string
|
protected: // TForm_string
|
||||||
virtual const char* class_name() const { return "NUMERO"; }
|
virtual const char* class_name() const { return "NUMERO"; }
|
||||||
@ -1593,6 +1598,7 @@ public:
|
|||||||
void set_decimals(int d) { _height = d; }
|
void set_decimals(int d) { _height = d; }
|
||||||
virtual const char* example() const;
|
virtual const char* example() const;
|
||||||
virtual void set_picture(const char* p);
|
virtual void set_picture(const char* p);
|
||||||
|
virtual void apply_format(TString& s) const;
|
||||||
virtual void put_paragraph(const char * s);
|
virtual void put_paragraph(const char * s);
|
||||||
|
|
||||||
TForm_number(TPrint_section* section) : TForm_string(section) {}
|
TForm_number(TPrint_section* section) : TForm_string(section) {}
|
||||||
@ -1640,26 +1646,20 @@ bool TForm_number::update()
|
|||||||
|
|
||||||
if (!n.is_zero())
|
if (!n.is_zero())
|
||||||
{
|
{
|
||||||
TString s;
|
TString s(get());
|
||||||
real n(get());
|
apply_format(s);
|
||||||
apply_format(n,s);
|
|
||||||
put_paragraph(s);
|
put_paragraph(s);
|
||||||
// do_message();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// const int nm = (_message.objptr(1) != NULL ? 1 : 0);
|
|
||||||
// do_message(nm);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TForm_number::apply_format(real& n , TString& s) const
|
void TForm_number::apply_format(TString& s) const
|
||||||
{
|
{
|
||||||
if (!picture().blank())
|
if (!picture().blank())
|
||||||
{
|
{
|
||||||
|
real n(s);
|
||||||
TToken_string delim(4, ','); // Stringa con i due delimitatori
|
TToken_string delim(4, ','); // Stringa con i due delimitatori
|
||||||
TString pic(picture()); // Picture senza delimitatori
|
TString pic(picture()); // Picture senza delimitatori
|
||||||
int maxlen = -1;
|
int maxlen = -1;
|
||||||
@ -1711,7 +1711,7 @@ void TForm_number::apply_format(real& n , TString& s) const
|
|||||||
s << d; // ... aggiungilo alla fine
|
s << d; // ... aggiungilo alla fine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else s = n.string();
|
// else s = n.string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TForm_number::set_picture(const char *p)
|
void TForm_number::set_picture(const char *p)
|
||||||
@ -1723,9 +1723,8 @@ void TForm_number::set_picture(const char *p)
|
|||||||
|
|
||||||
const char* TForm_number::example() const
|
const char* TForm_number::example() const
|
||||||
{
|
{
|
||||||
real n("123456789120.00"); n.round(2);
|
TString s("123456789120.00");
|
||||||
TString s;
|
apply_format(s);
|
||||||
apply_format(n,s);
|
|
||||||
return strcpy(__tmp_string, s);
|
return strcpy(__tmp_string, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4633,7 +4632,8 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
|
|||||||
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
||||||
TString valore;
|
TString valore;
|
||||||
|
|
||||||
if (code=="_ISAMREAD") {
|
if (code=="_ISAMREAD")
|
||||||
|
{
|
||||||
// lettura generica di un file del database
|
// lettura generica di un file del database
|
||||||
// sintassi: _ISAMREAD,<file>,<espressione input>[!<espressione input>!...],{<campo file>|<espressione output>[!<espressione output>!...]}
|
// sintassi: _ISAMREAD,<file>,<espressione input>[!<espressione input>!...],{<campo file>|<espressione output>[!<espressione output>!...]}
|
||||||
// dove: <file> è il numero logico del file o il nome della tabella
|
// dove: <file> è il numero logico del file o il nome della tabella
|
||||||
@ -4649,17 +4649,22 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
|
|||||||
else file= new TTable(f_code); // altrimenti è una tabella
|
else file= new TTable(f_code); // altrimenti è una tabella
|
||||||
file->zero(); // vuota il record corrente del file
|
file->zero(); // vuota il record corrente del file
|
||||||
TToken_string in(s.get(), '!');
|
TToken_string in(s.get(), '!');
|
||||||
for (i=0; i<in.items(); i++) { // scansione sugli elementi dell'input
|
for (i=0; i<in.items(); i++)
|
||||||
|
{ // scansione sugli elementi dell'input
|
||||||
TString curr(in.get(i));
|
TString curr(in.get(i));
|
||||||
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
||||||
if (poseq== -1) {
|
if (poseq== -1)
|
||||||
|
{
|
||||||
poseq= curr.find('=');
|
poseq= curr.find('=');
|
||||||
if (poseq != -1) posrv= poseq+1;
|
if (poseq != -1) posrv= poseq+1;
|
||||||
} else posrv= poseq+2;
|
}
|
||||||
|
else
|
||||||
|
posrv= poseq+2;
|
||||||
TString fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
|
TString fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
|
||||||
TString expr(curr.mid(posrv)); // preleva l'espressione di assegnamento alla destra dell'uguale
|
TString expr(curr.mid(posrv)); // preleva l'espressione di assegnamento alla destra dell'uguale
|
||||||
TExpression rval(expr, _strexpr);
|
TExpression rval(expr, _strexpr);
|
||||||
for (j=0; j<rval.numvar(); j++) { // scansione delle variabili dell'espressione di rvalue
|
for (j=0; j<rval.numvar(); j++)
|
||||||
|
{ // scansione delle variabili dell'espressione di rvalue
|
||||||
TString var= rval.varname(j);
|
TString var= rval.varname(j);
|
||||||
if (var[0]=='#') var.ltrim(1); // rimuove dalla stringa il primo carattere
|
if (var[0]=='#') var.ltrim(1); // rimuove dalla stringa il primo carattere
|
||||||
TForm_item &fi= cf.find_field(var);
|
TForm_item &fi= cf.find_field(var);
|
||||||
@ -4667,71 +4672,92 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
|
|||||||
}
|
}
|
||||||
file->put(fld, (const char *)rval); // scrive il risultato dell'espressione nel campo del file
|
file->put(fld, (const char *)rval); // scrive il risultato dell'espressione nel campo del file
|
||||||
}
|
}
|
||||||
if (file->read()== NOERR) { // tenta una lettura del file
|
if (file->read()== NOERR)
|
||||||
|
{ // tenta una lettura del file
|
||||||
TToken_string out(s.get(), '!');
|
TToken_string out(s.get(), '!');
|
||||||
for (i=0; i<out.items(); i++) { // scansione sugli elementi dell'output
|
for (i=0; i<out.items(); i++)
|
||||||
|
{ // scansione sugli elementi dell'output
|
||||||
TString curr(out.get(i));
|
TString curr(out.get(i));
|
||||||
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
||||||
if (poseq== -1) {
|
if (poseq== -1)
|
||||||
|
{
|
||||||
poseq= curr.find('=');
|
poseq= curr.find('=');
|
||||||
if (poseq != -1) posrv= poseq+1;
|
if (poseq != -1) posrv= poseq+1;
|
||||||
} else posrv= poseq+2;
|
}
|
||||||
if (poseq== -1) {
|
else
|
||||||
|
posrv= poseq+2;
|
||||||
|
if (poseq== -1)
|
||||||
|
{
|
||||||
const TString &dat= file->get(curr); // preleva il nome del campo del file e lo legge dal record
|
const TString &dat= file->get(curr); // preleva il nome del campo del file e lo legge dal record
|
||||||
cf.put_paragraph(dat);
|
cf.set(dat);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TString fld(curr.left(poseq)); // preleva il nome del campo del form alla sinistra dell'uguale
|
TString fld(curr.left(poseq)); // preleva il nome del campo del form alla sinistra dell'uguale
|
||||||
const TString &dat= file->get(curr.mid(posrv)); // preleva il nome del campo del file alla destra dell'uguale e lo legge dal record
|
const TString &dat= file->get(curr.mid(posrv)); // preleva il nome del campo del file alla destra dell'uguale e lo legge dal record
|
||||||
if (fld[0]=='#') fld.ltrim(1);
|
if (fld[0]=='#') fld.ltrim(1);
|
||||||
if (fld.right(1)== "@") { // se c'è la a-commerciale è un gruppo
|
if (fld.right(1)== "@")
|
||||||
if (fld.find("->") != -1) { // se nel gruppo c'è la freccia si riferisce ad un'altra sezione
|
{ // se c'è la a-commerciale è un gruppo
|
||||||
|
if (fld.find("->") != -1)
|
||||||
|
{ // se nel gruppo c'è la freccia si riferisce ad un'altra sezione
|
||||||
sec= fld[0];
|
sec= fld[0];
|
||||||
if (fld[1] != '-') pt= char2page(fld[1]);
|
if (fld[1] != '-') pt= char2page(fld[1]);
|
||||||
else pt= even_page;
|
else pt= even_page;
|
||||||
itms= section(sec, pt).fields();
|
itms= section(sec, pt).fields();
|
||||||
} else { // altrimenti si riferisce alla sezione corrente
|
}
|
||||||
|
else
|
||||||
|
{ // altrimenti si riferisce alla sezione corrente
|
||||||
sec= cf.section().section_type();
|
sec= cf.section().section_type();
|
||||||
pt= cf.section().page_type();
|
pt= cf.section().page_type();
|
||||||
itms= cf.section().fields();
|
itms= cf.section().fields();
|
||||||
}
|
}
|
||||||
for (j=0; j<itms; j++) { // per ogni campo della sezione specificata (o sottointesa)...
|
for (j=0; j<itms; j++)
|
||||||
|
{ // per ogni campo della sezione specificata (o sottointesa)...
|
||||||
TForm_item &fi= section(sec, pt).field(j);
|
TForm_item &fi= section(sec, pt).field(j);
|
||||||
fi.put_paragraph(dat);
|
fi.set(dat);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TForm_item &fi= cf.find_field(fld);
|
TForm_item &fi= cf.find_field(fld);
|
||||||
fi.put_paragraph(dat);
|
fi.set(dat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete file;
|
delete file;
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
// fine _ISAMREAD
|
// fine _ISAMREAD
|
||||||
} else if (code== "_TABLEREAD") {
|
}
|
||||||
// lettura generica di un campo di una tabella
|
|
||||||
// sintassi: _TABLEREAD,<tabella>,<chiave>,<campo file>
|
if (code== "_TABLEREAD")
|
||||||
// dove: <tabella> nome tabella da leggere
|
{
|
||||||
// <chiave> costante stringa o riferimento a campo della form (preceduto da '#') da usare come chiave di ricerca
|
// lettura generica di un campo di una tabella
|
||||||
// <campo file> identificativo del campo da leggere dalla tabella
|
// sintassi: _TABLEREAD,<tabella>,<chiave>,<campo file>
|
||||||
|
// dove: <tabella> nome tabella da leggere
|
||||||
|
// <chiave> costante stringa o riferimento a campo della form (preceduto da '#') da usare come chiave di ricerca
|
||||||
|
// <campo file> identificativo del campo da leggere dalla tabella
|
||||||
TTable tab(s.get()); // prende il nome della tabella
|
TTable tab(s.get()); // prende il nome della tabella
|
||||||
tab.zero(); // vuota il record corrente della tabella
|
tab.zero(); // vuota il record corrente della tabella
|
||||||
TString in(s.get()); // prende il valore o il campo da usare come codice di ricerca
|
TString in(s.get()); // prende il valore o il campo da usare come codice di ricerca
|
||||||
if (in[0]== '#') {
|
if (in[0]== '#')
|
||||||
in.ltrim(1);
|
{
|
||||||
TForm_item &fi= cf.find_field(in);
|
in.ltrim(1);
|
||||||
in= fi.get();
|
TForm_item &fi= cf.find_field(in);
|
||||||
|
in= fi.get();
|
||||||
}
|
}
|
||||||
tab.put("CODTAB", in); // setta la chiave nella tabella
|
tab.put("CODTAB", in); // setta la chiave nella tabella
|
||||||
if (tab.read()== NOERR) {
|
if (tab.read()== NOERR)
|
||||||
|
{
|
||||||
const TString &fld= s.get(); // prende il nome del campo da leggere...
|
const TString &fld= s.get(); // prende il nome del campo da leggere...
|
||||||
valore = tab.get(fld);
|
valore = tab.get(fld);
|
||||||
cf.set(valore);
|
cf.set(valore);
|
||||||
cf.put_paragraph(valore);
|
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
} // fine _TABLEREAD
|
} // fine _TABLEREAD
|
||||||
else if (code== "_ALIGN") {
|
|
||||||
|
if (code== "_ALIGN")
|
||||||
|
{
|
||||||
// allineamento della posizione di un campo rispetto ad un altro
|
// allineamento della posizione di un campo rispetto ad un altro
|
||||||
// sintassi: _ALIGN,<campo form>[,<allineamento>][,<allineamento>...]
|
// sintassi: _ALIGN,<campo form>[,<allineamento>][,<allineamento>...]
|
||||||
// dove: <campo form> è il campo della form (preceduto da '#') da cui prendere l'allineamento
|
// dove: <campo form> è il campo della form (preceduto da '#') da cui prendere l'allineamento
|
||||||
@ -4744,68 +4770,55 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
|
|||||||
TString in(s.get());
|
TString in(s.get());
|
||||||
if (in[0]== '#') in.ltrim(1);
|
if (in[0]== '#') in.ltrim(1);
|
||||||
TForm_item &fi= cf.find_field(in);
|
TForm_item &fi= cf.find_field(in);
|
||||||
const int width = cf.width();
|
|
||||||
valore = cf.get();
|
|
||||||
TString clear(width);
|
|
||||||
TString picture(cf.picture());
|
|
||||||
clear.spaces();
|
|
||||||
int i= 2;
|
int i= 2;
|
||||||
short save_x = cf.x();
|
for (const char * cmd = s.get(); cmd != NULL; cmd = s.get())
|
||||||
short save_y = cf.y();
|
{ // Calcola la nuova posizione
|
||||||
short save_height = cf.height();
|
TString align(cmd);
|
||||||
cf.height() = 2; // Solo temporaneamente per far si' che stampi alla giusta posizione
|
if (align[0]=='!')
|
||||||
cf.set(clear);
|
align.ltrim(1);
|
||||||
cf.put_paragraph(clear);
|
|
||||||
while (i<s.items()) { // Calcola la nuova posizione
|
|
||||||
TString align(s.get());
|
|
||||||
if (align[0]=='!') align.ltrim(1);
|
|
||||||
if (align== "TOP") cf.y()= fi.y();
|
if (align== "TOP") cf.y()= fi.y();
|
||||||
if (align== "MIDDLE") cf.y()= fi.y()+ fi.effective_height()/2;
|
else
|
||||||
if (align== "BOTTOM") cf.y()= fi.y()+ fi.effective_height()-1;
|
if (align== "MIDDLE") cf.y()= fi.y()+ fi.effective_height()/2;
|
||||||
if (align== "LEFT") cf.set_x(fi.x());
|
else
|
||||||
if (align== "RIGHT") cf.set_x(fi.x()+ fi.width());
|
if (align== "BOTTOM") cf.y()= fi.y()+ fi.effective_height()-1;
|
||||||
i++;
|
else
|
||||||
}
|
if (align== "LEFT") cf.set_x(fi.x());
|
||||||
real x(valore);
|
else
|
||||||
if (x.is_real(valore)) // se e' un numero controlla che non sia uguale 0
|
if (align== "RIGHT") cf.set_x(fi.x()+ fi.width());
|
||||||
{
|
|
||||||
if (x != 0.0)
|
|
||||||
valore = x.string(picture);
|
|
||||||
else
|
|
||||||
valore = "";
|
|
||||||
}
|
}
|
||||||
// altrimenti stampa la stringa cosi' com'e'
|
// altrimenti stampa la stringa cosi' com'e'
|
||||||
cf.set(valore);
|
return TRUE;
|
||||||
cf.put_paragraph(valore);
|
|
||||||
cf.y() = save_y;
|
|
||||||
cf.set_x(save_x);
|
|
||||||
cf.height() = save_height;
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _ALIGN
|
} // fine _ALIGN
|
||||||
else if (code== "_PAGENO") // Messaggio per stampare il numero di pagina corrente
|
|
||||||
|
if (code== "_PAGENO") // Messaggio per stampare il numero di pagina corrente
|
||||||
{
|
{
|
||||||
TString16 pg; pg << int(printer().getcurrentpage() );
|
TString16 pg; pg << int(printer().getcurrentpage() );
|
||||||
//cf.put_paragraph(pg);
|
|
||||||
cf.set(pg);
|
cf.set(pg);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (code== "_TODAY")// Messaggio per stampare la data di oggi
|
|
||||||
|
if (code== "_TODAY")// Messaggio per stampare la data di oggi
|
||||||
{
|
{
|
||||||
TString16 dt(TDate(TODAY).string());
|
TString16 dt(TDate(TODAY).string());
|
||||||
cf.set(dt);
|
cf.set(dt);
|
||||||
//cf.put_paragraph(pg);
|
return TRUE;
|
||||||
return (TRUE);
|
|
||||||
}
|
}
|
||||||
else if (code== "_NUMEXPR" || code== "_STREXPR") {
|
|
||||||
// Messaggio per la valutazione di espressioni numeriche e stringhe
|
if (code== "_NUMEXPR" || code== "_STREXPR")
|
||||||
|
{
|
||||||
|
// Messaggio per la valutazione di espressioni numeriche e stringhe
|
||||||
TExpression rval(s.get(),code[1]=='N' ? _numexpr:_strexpr,TRUE);
|
TExpression rval(s.get(),code[1]=='N' ? _numexpr:_strexpr,TRUE);
|
||||||
cf.section().eval_expr(rval);
|
cf.section().eval_expr(rval);
|
||||||
const char *res=(const char *)rval;
|
const char *res = (const char *)rval;
|
||||||
if (!rval.error())
|
if (!rval.error())
|
||||||
cf.set(res);
|
cf.set(res);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (code== "_DITTA") {
|
|
||||||
|
if (code== "_DITTA")
|
||||||
|
{
|
||||||
// lettura dei dati della ditta
|
// lettura dei dati della ditta
|
||||||
// sintassi: _DITTA,{<campo relazione>|<macro>}
|
// sintassi: _DITTA,{<campo relazione>|<macro>}
|
||||||
// dove: <campo relazione> è un riferimento alla relazione di gestione dei dati della ditta (es. 113@->DENCOM è la denominazione del comune di residenza della ditta)
|
// dove: <campo relazione> è un riferimento alla relazione di gestione dei dati della ditta (es. 113@->DENCOM è la denominazione del comune di residenza della ditta)
|
||||||
@ -4896,8 +4909,10 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
|
|||||||
valore = fref.read(anag.curr());
|
valore = fref.read(anag.curr());
|
||||||
}
|
}
|
||||||
cf.set(valore);
|
cf.set(valore);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TForm::print_on(ostream& out) const
|
void TForm::print_on(ostream& out) const
|
||||||
|
@ -778,10 +778,12 @@ public:
|
|||||||
// @cmember Ritorna l'altezza effettiva del campo
|
// @cmember Ritorna l'altezza effettiva del campo
|
||||||
virtual int effective_height() const
|
virtual int effective_height() const
|
||||||
{ return _effective_height; }
|
{ return _effective_height; }
|
||||||
|
// @cmember Formatta la stringa <p s>. Funzione che per default non fa nulla.
|
||||||
|
// Ridefinita solo per TForm_number e TForm_string.
|
||||||
|
virtual void apply_format(TString & s) const {}
|
||||||
// @cmember Scrive la stringa <p s> alla posizione del TForm_item. Funzione che
|
// @cmember Scrive la stringa <p s> alla posizione del TForm_item. Funzione che
|
||||||
// per default non fa nulla. Ridefinita solo per TForm_number e TForm_string.
|
// per default non fa nulla. Ridefinita solo per TForm_number e TForm_string.
|
||||||
virtual void put_paragraph(const char* s)
|
virtual void put_paragraph(const char* s) {}
|
||||||
{};
|
|
||||||
|
|
||||||
// @cmember Ritorna se si tratta di una campo temporaneo (reference)
|
// @cmember Ritorna se si tratta di una campo temporaneo (reference)
|
||||||
virtual bool& temp()
|
virtual bool& temp()
|
||||||
@ -1041,7 +1043,6 @@ protected:
|
|||||||
virtual bool read();
|
virtual bool read();
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
virtual const char* example() const;
|
virtual const char* example() const;
|
||||||
virtual void apply_format(TString & s, const TString & p) const;
|
|
||||||
|
|
||||||
virtual TToken_string& memo_info() { return _memo; }
|
virtual TToken_string& memo_info() { return _memo; }
|
||||||
|
|
||||||
@ -1055,6 +1056,7 @@ public:
|
|||||||
virtual const int fields() { return _field.items();}
|
virtual const int fields() { return _field.items();}
|
||||||
virtual const TString& picture() const { return _picture; }
|
virtual const TString& picture() const { return _picture; }
|
||||||
virtual void set_picture(const char* p) { _picture = p; }
|
virtual void set_picture(const char* p) { _picture = p; }
|
||||||
|
virtual void apply_format(TString & s) const;
|
||||||
virtual void put_paragraph(const char* s);
|
virtual void put_paragraph(const char* s);
|
||||||
|
|
||||||
virtual bool edit(TMask& m);
|
virtual bool edit(TMask& m);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user