Corretti errori neele stampe w
git-svn-id: svn://10.65.10.50/trunk@64 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
86bd8244c4
commit
b108a12dba
@ -41,7 +41,7 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
||||||
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
||||||
|
|
||||||
// Se e' un sottoconto posso cancellarlo se non esistono saldi
|
// Se e' un sottoconto posso cancellarlo se non esistono saldi
|
||||||
if ((gruppo != 0) && (conto != 0) && (sottoc != 0))
|
if ((gruppo != 0) && (conto != 0) && (sottoc != 0))
|
||||||
{
|
{
|
||||||
_saldi->zero();
|
_saldi->zero();
|
||||||
@ -56,7 +56,7 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
}
|
}
|
||||||
pconti.zero() ;
|
pconti.zero() ;
|
||||||
pconti.put(PCN_GRUPPO, gruppo);
|
pconti.put(PCN_GRUPPO, gruppo);
|
||||||
// Se e' un conto controllo se ha dei sottoconti
|
// Se e' un conto controllo se ha dei sottoconti
|
||||||
if (conto != 0)
|
if (conto != 0)
|
||||||
pconti.put(PCN_CONTO, conto);
|
pconti.put(PCN_CONTO, conto);
|
||||||
TRectype rec1(pconti.curr());
|
TRectype rec1(pconti.curr());
|
||||||
@ -66,22 +66,22 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
pconti.next();
|
pconti.next();
|
||||||
|
|
||||||
return pconti.good() && (pconti.curr() == rec1);
|
return pconti.good() && (pconti.curr() == rec1);
|
||||||
//
|
//
|
||||||
// if (pconti.bad()) return FALSE;
|
// if (pconti.bad()) return FALSE;
|
||||||
|
|
||||||
// const int ngruppo = pconti.get_int(PCN_GRUPPO);
|
// const int ngruppo = pconti.get_int(PCN_GRUPPO);
|
||||||
// const int nconto = pconti.get_int(PCN_CONTO);
|
// const int nconto = pconti.get_int(PCN_CONTO);
|
||||||
|
|
||||||
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
||||||
// if (conto == 0 && gruppo == ngruppo)
|
// if (conto == 0 && gruppo == ngruppo)
|
||||||
// return TRUE;
|
// return TRUE;
|
||||||
|
|
||||||
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
||||||
// dello stesso gruppo e conto
|
// dello stesso gruppo e conto
|
||||||
|
|
||||||
// if (gruppo == ngruppo && conto == nconto)
|
// if (gruppo == ngruppo && conto == nconto)
|
||||||
// return TRUE;
|
// return TRUE;
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0100_application::init_query_mode(TMask& m)
|
void CG0100_application::init_query_mode(TMask& m)
|
||||||
@ -293,7 +293,7 @@ HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
|
|||||||
TString conto(f.mask().get(FLD_CM1_CONTO));
|
TString conto(f.mask().get(FLD_CM1_CONTO));
|
||||||
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
||||||
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
||||||
dispatch_e_char(f.parent(), K_SHIFT_ENTER);
|
dispatch_e_char(f.parent(), K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -50,7 +50,7 @@ HIDDEN bool key_handler (TMask_field& f, KEY k)
|
|||||||
|
|
||||||
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
||||||
m.get(F_CODCF).not_empty())
|
m.get(F_CODCF).not_empty())
|
||||||
m.send_key(K_SHIFT_ENTER, 0);
|
m.send_key(K_AUTO_ENTER, 0);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -396,12 +396,12 @@ void CG1600_application::set_bil_key(bil_ivd* b, char lettera, char sezione,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo = ZERO,
|
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo,
|
||||||
const real& saldorafr = ZERO,
|
const real& saldorafr,
|
||||||
const real& sld_prg_dare = ZERO,
|
const real& sld_prg_dare,
|
||||||
const real& sld_prg_avere = ZERO,
|
const real& sld_prg_avere,
|
||||||
const real& mov_dare = ZERO,
|
const real& mov_dare,
|
||||||
const real& mov_avere = ZERO)
|
const real& mov_avere)
|
||||||
{
|
{
|
||||||
b->saldo = saldo;
|
b->saldo = saldo;
|
||||||
b->saldorafr = saldorafr;
|
b->saldorafr = saldorafr;
|
||||||
|
@ -627,7 +627,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
int TPrimanota_application::write(const TMask& m)
|
int TPrimanota_application::write(const TMask& m)
|
||||||
{
|
{
|
||||||
const long numreg = m.get_long(F_NUMREG);
|
const long numreg = m.get_long(F_NUMREG);
|
||||||
if (numreg > _lastreg) _lastreg = numreg;
|
if (numreg > _lastreg) _lastreg = numreg; // Aggiorna ultima registrazione
|
||||||
|
|
||||||
mask2rel(m);
|
mask2rel(m);
|
||||||
const int err = _rel->write(TRUE);
|
const int err = _rel->write(TRUE);
|
||||||
|
@ -196,7 +196,7 @@ void CG3200_application::saldi_zero()
|
|||||||
while (!rmov->eof())
|
while (!rmov->eof())
|
||||||
{
|
{
|
||||||
rmov->read();
|
rmov->read();
|
||||||
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
||||||
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
||||||
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
||||||
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
||||||
@ -277,7 +277,7 @@ void CG3200_application::fai_stampa198()
|
|||||||
else if (_sezione == "A")
|
else if (_sezione == "A")
|
||||||
set_row (1,"@119g#t", &_importo_str);
|
set_row (1,"@119g#t", &_importo_str);
|
||||||
|
|
||||||
// Stampa saldo movimenti
|
// Stampa saldo movimenti
|
||||||
set_row (1,"@153g#t", &_saldo_movimenti_str);
|
set_row (1,"@153g#t", &_saldo_movimenti_str);
|
||||||
if (_numrig != 0)
|
if (_numrig != 0)
|
||||||
{
|
{
|
||||||
@ -292,7 +292,7 @@ void CG3200_application::fai_stampa198()
|
|||||||
_dataregrmov = current_cursor()->curr(LF_RMOV).get_date(RMV_DATAREG);
|
_dataregrmov = current_cursor()->curr(LF_RMOV).get_date(RMV_DATAREG);
|
||||||
dataregrmovstring=_dataregrmov.string();
|
dataregrmovstring=_dataregrmov.string();
|
||||||
|
|
||||||
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
rmov = current_cursor()->file(LF_RMOV);
|
||||||
rec = rmov->recno();
|
rec = rmov->recno();
|
||||||
@ -372,7 +372,7 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_PCON:
|
case LF_PCON:
|
||||||
// Usati in crea_intestazione()
|
// Usati in crea_intestazione()
|
||||||
_gruppo = atoi(current_cursor()->curr(LF_PCON).get(PCN_GRUPPO));
|
_gruppo = atoi(current_cursor()->curr(LF_PCON).get(PCN_GRUPPO));
|
||||||
_conto = atoi(current_cursor()->curr(LF_PCON).get(PCN_CONTO));
|
_conto = atoi(current_cursor()->curr(LF_PCON).get(PCN_CONTO));
|
||||||
_sottoc = atol(current_cursor()->curr(LF_PCON).get(PCN_SOTTOCONTO));
|
_sottoc = atol(current_cursor()->curr(LF_PCON).get(PCN_SOTTOCONTO));
|
||||||
@ -525,7 +525,7 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_CLIFO:
|
case LF_CLIFO:
|
||||||
// Usati in crea_intestazione()
|
// Usati in crea_intestazione()
|
||||||
_gruppo = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_GRUPPO));
|
_gruppo = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_GRUPPO));
|
||||||
_conto = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_CONTO));
|
_conto = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_CONTO));
|
||||||
_sottoc = atol(current_cursor()->curr(LF_CLIFO).get(CLI_CODCF));
|
_sottoc = atol(current_cursor()->curr(LF_CLIFO).get(CLI_CODCF));
|
||||||
@ -887,7 +887,7 @@ void CG3200_application::descrizione_causale()
|
|||||||
void CG3200_application::documenti_iva()
|
void CG3200_application::documenti_iva()
|
||||||
{
|
{
|
||||||
TString dep;
|
TString dep;
|
||||||
// _tipodoc = _mov->curr().get(MOV_TIPODOC);
|
// _tipodoc = _mov->curr().get(MOV_TIPODOC);
|
||||||
|
|
||||||
_tabtpd->curr().zero();
|
_tabtpd->curr().zero();
|
||||||
dep << format ("%2s",(const char*) _tipodoc);
|
dep << format ("%2s",(const char*) _tipodoc);
|
||||||
@ -964,7 +964,7 @@ bool CG3200_application::set_print(int)
|
|||||||
int nummast = atoi(_msk->get(F_NUMMAST));
|
int nummast = atoi(_msk->get(F_NUMMAST));
|
||||||
_ricerca = _msk->get(F_RICERCA)[0];
|
_ricerca = _msk->get(F_RICERCA)[0];
|
||||||
|
|
||||||
// Scelta del formato e del numero di mastrini per pagina 1 o 2
|
// Scelta del formato e del numero di mastrini per pagina 1 o 2
|
||||||
|
|
||||||
if (nummast == 1)
|
if (nummast == 1)
|
||||||
crt = formato;
|
crt = formato;
|
||||||
@ -973,7 +973,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
printer().formlen(crt);
|
printer().formlen(crt);
|
||||||
|
|
||||||
//Crea il cursore su gruppo, conto e sottoconto del file RMOV
|
//Crea il cursore su gruppo, conto e sottoconto del file RMOV
|
||||||
if (_ricerca == 'P')
|
if (_ricerca == 'P')
|
||||||
{
|
{
|
||||||
reset_files(); //resetta l'albero di stampa
|
reset_files(); //resetta l'albero di stampa
|
||||||
@ -1062,7 +1062,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1296,8 +1296,8 @@ void CG3200_application::calcola_progressivi()
|
|||||||
paveresca = 0.00;
|
paveresca = 0.00;
|
||||||
pdarescap = 0.00;
|
pdarescap = 0.00;
|
||||||
paverescap = 0.00;
|
paverescap = 0.00;
|
||||||
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
|
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
|
||||||
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
|
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
|
||||||
|
|
||||||
record.zero();
|
record.zero();
|
||||||
record.put(SLD_GRUPPO, _gruppo);
|
record.put(SLD_GRUPPO, _gruppo);
|
||||||
@ -1316,7 +1316,7 @@ void CG3200_application::calcola_progressivi()
|
|||||||
pconti.put(PCN_CONTO , _conto);
|
pconti.put(PCN_CONTO , _conto);
|
||||||
pconti.read();
|
pconti.read();
|
||||||
if (pconti.good())
|
if (pconti.good())
|
||||||
indbil = atoi (pconti.get(PCN_INDBIL));
|
indbil = pconti.get_int(PCN_INDBIL);
|
||||||
else
|
else
|
||||||
indbil = 0;
|
indbil = 0;
|
||||||
}
|
}
|
||||||
@ -1335,7 +1335,7 @@ void CG3200_application::calcola_progressivi()
|
|||||||
{
|
{
|
||||||
long annoes_saldi = saldi.curr().get_long(SLD_ANNOES);
|
long annoes_saldi = saldi.curr().get_long(SLD_ANNOES);
|
||||||
|
|
||||||
//Calcola i progressivi dell'esercizio attuale
|
//Calcola i progressivi dell'esercizio attuale
|
||||||
|
|
||||||
if (annoes_saldi == _annomsk)
|
if (annoes_saldi == _annomsk)
|
||||||
{
|
{
|
||||||
@ -1345,7 +1345,7 @@ void CG3200_application::calcola_progressivi()
|
|||||||
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
|
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calcola i progressivi dell'esercizio precedente
|
//Calcola i progressivi dell'esercizio precedente
|
||||||
|
|
||||||
if (annoes_saldi == _annoesmsk)
|
if (annoes_saldi == _annoesmsk)
|
||||||
{
|
{
|
||||||
@ -1354,11 +1354,11 @@ void CG3200_application::calcola_progressivi()
|
|||||||
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
||||||
paverep = saldi.curr().get_real(SLD_PAVERE);
|
paverep = saldi.curr().get_real(SLD_PAVERE);
|
||||||
|
|
||||||
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
||||||
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
||||||
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
||||||
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
||||||
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
||||||
|
|
||||||
if (saldo != 0)
|
if (saldo != 0)
|
||||||
{
|
{
|
||||||
@ -1376,8 +1376,8 @@ void CG3200_application::calcola_progressivi()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
||||||
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
||||||
|
|
||||||
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
||||||
{
|
{
|
||||||
@ -1397,10 +1397,10 @@ void CG3200_application::calcola_progressivi()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calcolo dei progressivi precedenti: somma di tutti quei movimenti di rmov
|
//Calcolo dei progressivi precedenti: somma di tutti quei movimenti di rmov
|
||||||
//che hanno la data di registrazione inferiore alla data di inizio stampa,
|
//che hanno la data di registrazione inferiore alla data di inizio stampa,
|
||||||
//dei progressivi dell'anno esercizio precedente, e dei progressivi dei
|
//dei progressivi dell'anno esercizio precedente, e dei progressivi dei
|
||||||
//movimenti scaricati dell'esercizio attuale.
|
//movimenti scaricati dell'esercizio attuale.
|
||||||
|
|
||||||
calcola_progressivi_al();
|
calcola_progressivi_al();
|
||||||
|
|
||||||
@ -1426,12 +1426,12 @@ void CG3200_application::calcola_progressivi()
|
|||||||
string = _progreavere.string("###############");
|
string = _progreavere.string("###############");
|
||||||
set_header (10,"@119g%15s",(const char*) string);
|
set_header (10,"@119g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
//Calcolo dei progressivi al <ultima data registrazione>
|
//Calcolo dei progressivi al <ultima data registrazione>
|
||||||
|
|
||||||
|
|
||||||
//Se sulla maschera e' stato selezionato il controllo competenza esercizio
|
//Se sulla maschera e' stato selezionato il controllo competenza esercizio
|
||||||
//Sommo i progressivi dell'esercizio precedente e quelli dell'esercizio attuale
|
//Sommo i progressivi dell'esercizio precedente e quelli dell'esercizio attuale
|
||||||
//altrimenti solo quelli dell'esercizio attuale
|
//altrimenti solo quelli dell'esercizio attuale
|
||||||
|
|
||||||
if (_competenza)
|
if (_competenza)
|
||||||
{
|
{
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <date.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <scanner.h>
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -13,14 +11,14 @@
|
|||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
|
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
|
|
||||||
#include <cglib.h>
|
#include "cglib.h"
|
||||||
|
#include "cg3.h"
|
||||||
#include <cg3.h>
|
#include "cg3500.h"
|
||||||
#include <cg3500.h>
|
|
||||||
|
|
||||||
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
||||||
|
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <date.h>
|
|
||||||
#include <scanner.h>
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <prefix.h>
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
@ -18,7 +15,6 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
#include "cg4.h"
|
|
||||||
#include "cg4500a.h"
|
#include "cg4500a.h"
|
||||||
#include "cg4500b.h"
|
#include "cg4500b.h"
|
||||||
|
|
||||||
@ -576,3 +572,15 @@ int cg4500 (int argc, char* argv[])
|
|||||||
main_app.run(argc, argv, "");
|
main_app.run(argc, argv, "");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
<<<<<<< cg4500.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> 1.4
|
||||||
|
@ -546,6 +546,7 @@ TPush_button::TPush_button(short left, short top, short right, short bottom,
|
|||||||
caption = format("#%d#%d", BMP_DELREC, BMP_DELRECDN);
|
caption = format("#%d#%d", BMP_DELREC, BMP_DELRECDN);
|
||||||
break;
|
break;
|
||||||
case DLG_NEWREC:
|
case DLG_NEWREC:
|
||||||
|
if (height > ROWY && strcmp("~Nuovo", caption) == 0) // Puo' essere Gestione
|
||||||
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
||||||
break;
|
break;
|
||||||
case DLG_FIRSTREC:
|
case DLG_FIRSTREC:
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
||||||
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
||||||
#define K_QUIT 10334
|
#define K_QUIT 10334
|
||||||
|
#define K_FORCE_CLOSE 11334
|
||||||
#define K_SAVE 10082
|
#define K_SAVE 10082
|
||||||
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
||||||
#define K_SHIFT_F2 K_SHIFT+K_F2
|
#define K_SHIFT_F2 K_SHIFT+K_F2
|
||||||
|
@ -98,10 +98,12 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
switch(ep->v.ctl.id)
|
switch(ep->v.ctl.id)
|
||||||
{
|
{
|
||||||
case DLG_OK :
|
case DLG_OK :
|
||||||
on_key(K_AUTO_ENTER); break;
|
stop_run(K_AUTO_ENTER); break;
|
||||||
case DLG_BAR :
|
case DLG_BAR :
|
||||||
case DLG_CANCEL :
|
case DLG_CANCEL :
|
||||||
on_key(K_ESC); break;
|
stop_run(K_ESC); break;
|
||||||
|
case DLG_QUIT :
|
||||||
|
stop_run(K_FORCE_CLOSE); break;
|
||||||
/*
|
/*
|
||||||
case DLG_PGDN :
|
case DLG_PGDN :
|
||||||
on_key(K_NEXT); break;
|
on_key(K_NEXT); break;
|
||||||
@ -123,8 +125,6 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
stop_run(K_DEL); break;
|
stop_run(K_DEL); break;
|
||||||
case DLG_SAVEREC :
|
case DLG_SAVEREC :
|
||||||
stop_run(K_SAVE); break;
|
stop_run(K_SAVE); break;
|
||||||
case DLG_QUIT :
|
|
||||||
stop_run(K_QUIT); break;
|
|
||||||
*/
|
*/
|
||||||
case DLG_F9:
|
case DLG_F9:
|
||||||
{
|
{
|
||||||
@ -557,18 +557,18 @@ int TMask::find_active_field(int first, int dir) const
|
|||||||
void TMask::set_focus()
|
void TMask::set_focus()
|
||||||
{
|
{
|
||||||
_focus = find_active_field(_focus, +1);
|
_focus = find_active_field(_focus, +1);
|
||||||
const int page = find_parent_page(fld(_focus));
|
const TMask_field& f = fld(_focus);
|
||||||
|
const int page = find_parent_page(f);
|
||||||
|
|
||||||
if (page != _page && page != MAX_PAGES)
|
if (page != _page && page != MAX_PAGES)
|
||||||
{
|
{
|
||||||
const WINDOW pw = win(); // previous window
|
const WINDOW pw = win(); // previous window
|
||||||
_page = page;
|
_page = page; // update page number
|
||||||
show_window(win(), TRUE); // show new page
|
show_window(win(), TRUE); // show new page
|
||||||
if (pw) show_window(pw, FALSE); // hide old page
|
if (pw) show_window(pw, FALSE); // hide old page
|
||||||
}
|
}
|
||||||
|
|
||||||
const WINDOW fw = fld(_focus).win();
|
set_front_window(f.win());
|
||||||
set_front_window(fw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -577,9 +577,9 @@ void TMask::move_focus_field(int d)
|
|||||||
{
|
{
|
||||||
TMask_field& f = fld(_focus);
|
TMask_field& f = fld(_focus);
|
||||||
|
|
||||||
if (f.on_key(K_TAB) == FALSE) // New style
|
if (f.on_key(K_TAB) == FALSE) // Don't you agree to lose focus? ...
|
||||||
{
|
{
|
||||||
set_focus();
|
set_focus(); // ... Keep it
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,9 +601,7 @@ void TMask::move_focus_field(int d)
|
|||||||
|
|
||||||
bool TMask::stop_run(KEY key)
|
bool TMask::stop_run(KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_CTRL_ENTER) key = K_ENTER;
|
if (key != K_AUTO_ENTER && key != K_FORCE_CLOSE)
|
||||||
|
|
||||||
if (key != K_AUTO_ENTER)
|
|
||||||
{
|
{
|
||||||
const int last = fields();
|
const int last = fields();
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
@ -626,11 +624,13 @@ bool TMask::stop_run(KEY key)
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
return error_box("Non e' attivo il bottone associato a %d", key);
|
return error_box("Non e' attivo il bottone associato a %d", key);
|
||||||
#else
|
#else
|
||||||
beep();
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else key = K_ENTER;
|
}
|
||||||
|
|
||||||
|
if (key == K_CTRL_ENTER) key = K_ENTER; else
|
||||||
|
if (key == K_FORCE_CLOSE) key = K_QUIT;
|
||||||
|
|
||||||
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
||||||
{
|
{
|
||||||
@ -694,7 +694,7 @@ bool TMask::on_key(KEY key)
|
|||||||
if (key > K_CTRL)
|
if (key > K_CTRL)
|
||||||
{
|
{
|
||||||
key -= K_CTRL;
|
key -= K_CTRL;
|
||||||
if (key >= K_F1 && key <= K_F10)
|
if (key >= K_F1 && key <= K_F12)
|
||||||
next_page(1000 + key - K_F1);
|
next_page(1000 + key - K_F1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: maskfld.cpp,v 1.3 1994-08-23 13:52:21 guy Exp $
|
// $Id: maskfld.cpp,v 1.4 1994-08-26 13:07:14 guy Exp $
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
@ -1721,13 +1721,13 @@ const char* TEdit_field::format(const char* d)
|
|||||||
|
|
||||||
if (fpark.not_empty())
|
if (fpark.not_empty())
|
||||||
{
|
{
|
||||||
#ifdef DBG
|
|
||||||
if (fpark.len() > _size)
|
if (fpark.len() > _size)
|
||||||
{
|
{
|
||||||
|
#ifdef DBG
|
||||||
error_box("Campo %d troppo lungo: %d > %d", dlg(), fpark.len(), _size);
|
error_box("Campo %d troppo lungo: %d > %d", dlg(), fpark.len(), _size);
|
||||||
|
#endif
|
||||||
fpark.cut(_size);
|
fpark.cut(_size);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_flags.uppercase)
|
if (_flags.uppercase)
|
||||||
fpark.upper();
|
fpark.upper();
|
||||||
|
@ -32,6 +32,11 @@ class TSpreadsheet : public TWindow
|
|||||||
|
|
||||||
SPREADSHEET_NOTIFY _notify;
|
SPREADSHEET_NOTIFY _notify;
|
||||||
|
|
||||||
|
TMask_field* _edit_field; // Current edit field
|
||||||
|
int _cur_row, _cur_col; // Current cell
|
||||||
|
bool _row_dirty; // Current row changed
|
||||||
|
bool _check_enabled; // Perform OFF_ROW checks
|
||||||
|
|
||||||
static void xiev_handler(XI_OBJ *itf, XI_EVENT *xiev);
|
static void xiev_handler(XI_OBJ *itf, XI_EVENT *xiev);
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
@ -99,11 +104,12 @@ void TSpreadsheet::init()
|
|||||||
first = FALSE;
|
first = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||||
const char* maskname, int maskno,
|
const char* maskname, int maskno,
|
||||||
const char* head, WINDOW parent)
|
const char* head, WINDOW parent)
|
||||||
: _mask(maskname, NO_MODE, maskno), _notify(NULL)
|
: _mask(maskname, NO_MODE, maskno), _notify(NULL), _edit_field(NULL), _cur_row(0), _cur_col(0),
|
||||||
|
_row_dirty(FALSE), _check_enabled(TRUE)
|
||||||
{
|
{
|
||||||
const int NUMBER_WIDTH = 3;
|
const int NUMBER_WIDTH = 3;
|
||||||
const int MAX_COL = 32;
|
const int MAX_COL = 32;
|
||||||
@ -259,8 +265,8 @@ TMask_field* TSpreadsheet::cell2field(const XI_OBJ* cell) const
|
|||||||
{
|
{
|
||||||
TMask_field* f = field(id);
|
TMask_field* f = field(id);
|
||||||
if (f == NULL) break;
|
if (f == NULL) break;
|
||||||
good = f;
|
good = f; // We've found a field with the proper ID ...
|
||||||
if (f->active()) break;
|
if (f->active()) break; // ... and it's active: end of search
|
||||||
}
|
}
|
||||||
|
|
||||||
return good;
|
return good;
|
||||||
@ -280,7 +286,7 @@ void TSpreadsheet::update_rec(int rec)
|
|||||||
|
|
||||||
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||||
{
|
{
|
||||||
set_front_window(win());
|
// set_front_window(win());
|
||||||
XI_OBJ cell;
|
XI_OBJ cell;
|
||||||
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
||||||
xi_set_focus(&cell);
|
xi_set_focus(&cell);
|
||||||
@ -331,7 +337,9 @@ void TSpreadsheet::update(int row)
|
|||||||
{
|
{
|
||||||
xi_cell_request(_list);
|
xi_cell_request(_list);
|
||||||
xi_scroll(_list, XI_SCROLL_FIRST);
|
xi_scroll(_list, XI_SCROLL_FIRST);
|
||||||
set_front_window(win());
|
XI_OBJ* itf = xi_get_itf(win());
|
||||||
|
xi_set_focus(itf);
|
||||||
|
// set_front_window(win());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
update_rec(row);
|
update_rec(row);
|
||||||
@ -349,11 +357,6 @@ void TSpreadsheet::xiev_handler(XI_OBJ *itf, XI_EVENT *xiev)
|
|||||||
// Certified 75%
|
// Certified 75%
|
||||||
void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
||||||
{
|
{
|
||||||
static TMask_field* edit_field = NULL; // Current edit field
|
|
||||||
static int cur_row = 0, cur_col = 0; // Current cell
|
|
||||||
static bool row_dirty = FALSE; // Current row changed
|
|
||||||
static bool check_enabled = TRUE; // Perform OFF_ROW checks
|
|
||||||
|
|
||||||
switch (xiev->type)
|
switch (xiev->type)
|
||||||
{
|
{
|
||||||
case XIE_GET_FIRST:
|
case XIE_GET_FIRST:
|
||||||
@ -430,18 +433,18 @@ break;
|
|||||||
case XIE_BUTTON:
|
case XIE_BUTTON:
|
||||||
if (xiev->v.xi_obj->type == XIT_CELL)
|
if (xiev->v.xi_obj->type == XIT_CELL)
|
||||||
{
|
{
|
||||||
if (edit_field)
|
if (_edit_field)
|
||||||
{
|
{
|
||||||
const char* val = xi_get_text(xiev->v.xi_obj, NULL, -1);
|
const char* val = xi_get_text(xiev->v.xi_obj, NULL, -1);
|
||||||
edit_field->set(val); // Update current cell
|
_edit_field->set(val); // Update current cell
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||||
if (edit_field->on_key(K_F9)) // Show search sheet
|
if (_edit_field->on_key(K_F9)) // Show search sheet
|
||||||
{
|
{
|
||||||
mask2str(cur_row); // Update row
|
mask2str(_cur_row); // Update row
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
xi_set_focus(xiev->v.xi_obj); // Restore focus to cell
|
xi_set_focus(xiev->v.xi_obj); // Restore focus to cell
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -450,17 +453,17 @@ if (xiev->v.xi_obj->type == XIT_LIST)
|
|||||||
break;
|
break;
|
||||||
case XIE_DBL_CELL:
|
case XIE_DBL_CELL:
|
||||||
{
|
{
|
||||||
check_enabled = FALSE;
|
_check_enabled = FALSE;
|
||||||
cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
_cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
||||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||||
const KEY k = edit(cur_row);
|
const KEY k = edit(_cur_row);
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
update_rec(cur_row);
|
update_rec(_cur_row);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
xi_set_focus(xiev->v.xi_obj);
|
xi_set_focus(xiev->v.xi_obj);
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_ON_ROW:
|
case XIE_ON_ROW:
|
||||||
@ -468,24 +471,24 @@ break;
|
|||||||
const int rec = row2rec(xiev->v.xi_obj->v.row);
|
const int rec = row2rec(xiev->v.xi_obj->v.row);
|
||||||
if (rec < items())
|
if (rec < items())
|
||||||
{
|
{
|
||||||
cur_row = rec;
|
_cur_row = rec;
|
||||||
str2mask(rec);
|
str2mask(rec);
|
||||||
row_dirty = FALSE;
|
_row_dirty = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xiev->refused = TRUE;
|
xiev->refused = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_OFF_ROW:
|
case XIE_OFF_ROW:
|
||||||
if (row_dirty && check_enabled)
|
if (_row_dirty && _check_enabled)
|
||||||
{
|
{
|
||||||
check_enabled = FALSE; // Avoid recursion!
|
_check_enabled = FALSE; // Avoid recursion!
|
||||||
str2mask(cur_row); // It shouldn't have to be necessary
|
str2mask(_cur_row); // It shouldn't have to be necessary
|
||||||
bool ok = _mask.check_fields();
|
bool ok = _mask.check_fields();
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
mask2str(cur_row);
|
mask2str(_cur_row);
|
||||||
ok = notify(cur_row, K_ENTER); // Notify edit
|
ok = notify(_cur_row, K_ENTER); // Notify edit
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
@ -497,17 +500,17 @@ break;
|
|||||||
xvt_statbar_set("");
|
xvt_statbar_set("");
|
||||||
set_dirty();
|
set_dirty();
|
||||||
}
|
}
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_ON_CELL:
|
case XIE_ON_CELL:
|
||||||
{
|
{
|
||||||
TMask_field* f = cell2field(xiev->v.xi_obj);
|
TMask_field* f = cell2field(xiev->v.xi_obj);
|
||||||
const int col = (f->dlg() - FIRST_FIELD) % 100;
|
const int col = (f->dlg() - FIRST_FIELD) % 100;
|
||||||
if (!cell_disabled(cur_row, col))
|
if (!cell_disabled(_cur_row, col))
|
||||||
{
|
{
|
||||||
edit_field = f;
|
_edit_field = f;
|
||||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, FOCUS_BACK_COLOR);
|
xi_set_color(xiev->v.xi_obj, XIC_BACK, FOCUS_BACK_COLOR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -528,18 +531,18 @@ break;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_OFF_CELL:
|
case XIE_OFF_CELL:
|
||||||
if (edit_field && check_enabled)
|
if (_edit_field && _check_enabled)
|
||||||
{
|
{
|
||||||
TMask_field* c = edit_field; // Save field, it could turn out to be NULL on error
|
TMask_field* c = _edit_field; // Save field, it could turn out to be NULL on error
|
||||||
const TString80 old(c->get()); // Save old value on mask
|
const TString80 old(c->get()); // Save old value on mask
|
||||||
const TString80 nuo(c->picture_data(xi_get_text(xiev->v.xi_obj, NULL, -1), TRUE));
|
const TString80 nuo(c->picture_data(xi_get_text(xiev->v.xi_obj, NULL, -1), TRUE));
|
||||||
if (old != nuo)
|
if (old != nuo)
|
||||||
{
|
{
|
||||||
check_enabled = FALSE;
|
_check_enabled = FALSE;
|
||||||
if (!row_dirty)
|
if (!_row_dirty)
|
||||||
{
|
{
|
||||||
notify(cur_row, K_SPACE);
|
notify(_cur_row, K_SPACE);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
c->set(nuo); // Set new mask value
|
c->set(nuo); // Set new mask value
|
||||||
c->set_dirty(); // Get it dirty!
|
c->set_dirty(); // Get it dirty!
|
||||||
@ -550,10 +553,10 @@ break;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask2str(cur_row); // Update sheet row
|
mask2str(_cur_row); // Update sheet row
|
||||||
edit_field = NULL; // Reset current field
|
_edit_field = NULL; // Reset current field
|
||||||
}
|
}
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
if (!xiev->refused)
|
if (!xiev->refused)
|
||||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, NORMAL_BACK_COLOR);
|
xi_set_color(xiev->v.xi_obj, XIC_BACK, NORMAL_BACK_COLOR);
|
||||||
@ -580,35 +583,38 @@ break;
|
|||||||
XI_OBJ* itf = xi_get_itf(win());
|
XI_OBJ* itf = xi_get_itf(win());
|
||||||
const bool ok = (bool)xi_move_focus(itf);
|
const bool ok = (bool)xi_move_focus(itf);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
|
{
|
||||||
|
set_dirty(2);
|
||||||
xiev->refused = TRUE;
|
xiev->refused = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case E_CHAR:
|
case E_CHAR:
|
||||||
if (edit_field)
|
if (_edit_field)
|
||||||
{
|
{
|
||||||
const KEY k = e_char_to_key(ep);
|
const KEY k = e_char_to_key(ep);
|
||||||
switch(k)
|
switch(k)
|
||||||
{
|
{
|
||||||
case K_F1:
|
case K_F1:
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
edit_field->on_key(K_F1);
|
_edit_field->on_key(K_F1);
|
||||||
set_focus_cell(cur_row, cur_col);
|
set_focus_cell(_cur_row, _cur_col);
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
break;
|
break;
|
||||||
case K_F2:
|
case K_F2:
|
||||||
case K_F3:
|
case K_F3:
|
||||||
case K_F8:
|
case K_F8:
|
||||||
case K_F9:
|
case K_F9:
|
||||||
{
|
{
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||||
if (edit_field->on_key(k))
|
if (_edit_field->on_key(k))
|
||||||
{
|
{
|
||||||
mask2str(cur_row);
|
mask2str(_cur_row);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
set_focus_cell(cur_row, cur_col);
|
set_focus_cell(_cur_row, _cur_col);
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case K_PREV:
|
case K_PREV:
|
||||||
|
@ -1 +1 @@
|
|||||||
#define VERSION 1.8
|
#define VERSION 1.9
|
||||||
|
@ -76,13 +76,12 @@ TSheet::TSheet(short x, short y, short dx, short dy,
|
|||||||
|
|
||||||
void TSheet::add_button(short id, const char* caption, KEY key)
|
void TSheet::add_button(short id, const char* caption, KEY key)
|
||||||
{
|
{
|
||||||
const int BUT_HEIGHT =
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
2
|
const int BUT_HEIGHT = 2;
|
||||||
#else
|
#else
|
||||||
1
|
const int BUT_HEIGHT = 1;
|
||||||
#endif
|
#endif
|
||||||
;
|
|
||||||
WINDOW b = xvt_create_control(WC_PUSHBUTTON, 0, 0, 11, BUT_HEIGHT, caption, win(), 0, 0, id);
|
WINDOW b = xvt_create_control(WC_PUSHBUTTON, 0, 0, 11, BUT_HEIGHT, caption, win(), 0, 0, id);
|
||||||
for (int i = 0; i < MAX_BUT; i++)
|
for (int i = 0; i < MAX_BUT; i++)
|
||||||
if (_button[i] == NULL_WIN)
|
if (_button[i] == NULL_WIN)
|
||||||
@ -611,21 +610,25 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
|||||||
{
|
{
|
||||||
xvt_create_control(WC_EDIT, 1, -3, f->size()+1, 1, f->get(), win(),
|
xvt_create_control(WC_EDIT, 1, -3, f->size()+1, 1, f->get(), win(),
|
||||||
CTL_FLAG_DISABLED, 0L, 100);
|
CTL_FLAG_DISABLED, 0L, 100);
|
||||||
if (s)
|
|
||||||
{
|
|
||||||
WINDOW listbox = xvt_create_control(WC_LISTBUTTON, f->size()+3, -3, 18, 3,
|
|
||||||
"", win(), 0, 0L, 99);
|
|
||||||
|
|
||||||
|
if (s && s->items() > 2)
|
||||||
|
{
|
||||||
|
int maxlen = 0;
|
||||||
SLIST lst = slist_new();
|
SLIST lst = slist_new();
|
||||||
for (const char* item = s->get(0); item; item = s->get())
|
for (const char* item = s->get(0); item; item = s->get())
|
||||||
{
|
{
|
||||||
item = s->get();
|
item = s->get();
|
||||||
|
const int len = strlen(item);
|
||||||
|
if (len > maxlen) maxlen = len;
|
||||||
slist_add(lst, (SLIST_ELT)NULL, (char*)item, 0L);
|
slist_add(lst, (SLIST_ELT)NULL, (char*)item, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WINDOW listbox = xvt_create_control(WC_LISTBUTTON, f->size()+3, -3, maxlen+3, 3,
|
||||||
|
"", win(), 0, 0L, 99);
|
||||||
win_list_add(listbox, -1, (char*)lst);
|
win_list_add(listbox, -1, (char*)lst);
|
||||||
slist_dispose(lst);
|
slist_dispose(lst);
|
||||||
|
|
||||||
TString id(3); id << f->dlg();
|
TString16 id; id << f->dlg();
|
||||||
const int sel = s->get_pos(id) >> 1;
|
const int sel = s->get_pos(id) >> 1;
|
||||||
win_list_set_sel(listbox, sel, TRUE);
|
win_list_set_sel(listbox, sel, TRUE);
|
||||||
}
|
}
|
||||||
@ -649,7 +652,7 @@ void TBrowse_sheet::repos_buttons() const
|
|||||||
if (w != NULL_WIN)
|
if (w != NULL_WIN)
|
||||||
{
|
{
|
||||||
RCT r; get_client_rect(w, &r);
|
RCT r; get_client_rect(w, &r);
|
||||||
r.left = CHARX*(id == 99 ? 1 : 21);
|
r.left = CHARX*(id == 99 ? _field->size()+3 : 1);
|
||||||
r.top = wr.bottom - 4*CHARY + 4;
|
r.top = wr.bottom - 4*CHARY + 4;
|
||||||
r.right += r.left;
|
r.right += r.left;
|
||||||
r.bottom += r.top;
|
r.bottom += r.top;
|
||||||
@ -673,7 +676,12 @@ bool TBrowse_sheet::on_key(KEY k)
|
|||||||
const TString old(_field->get());
|
const TString old(_field->get());
|
||||||
|
|
||||||
TString val(old.size()+1); val = old;
|
TString val(old.size()+1); val = old;
|
||||||
if (alnum) val << char(k);
|
if (alnum)
|
||||||
|
{
|
||||||
|
if (val.len() > field().size())
|
||||||
|
val.cut(0);
|
||||||
|
val << char(k);
|
||||||
|
}
|
||||||
else val.rtrim(1);
|
else val.rtrim(1);
|
||||||
field().set(val);
|
field().set(val);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ END
|
|||||||
|
|
||||||
BUTTON DLG_FINDREC 8 2
|
BUTTON DLG_FINDREC 8 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -46 -1 "Ricerca"
|
PROMPT -46 -1 "Ri~cerca"
|
||||||
MESSAGE EXIT,K_F9
|
MESSAGE EXIT,K_F9
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ HIDDEN bool _expr_val(TEdit_field& f, KEY)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
@ -100,7 +100,7 @@ bool pi_check(const char * st, const char * paiva)
|
|||||||
// Controlla la partita iva se e' non vuota ed italiana
|
// Controlla la partita iva se e' non vuota ed italiana
|
||||||
HIDDEN bool _pi_val(TEdit_field& f, KEY)
|
HIDDEN bool _pi_val(TEdit_field& f, KEY)
|
||||||
{
|
{
|
||||||
TString stato(f.mask().get(atoi(get_val_param(0)))), pi(f.get());
|
TString16 stato(f.mask().get(atoi(get_val_param(0)))), pi(f.get());
|
||||||
|
|
||||||
if (stato.not_empty() && stato != "IT") return TRUE;
|
if (stato.not_empty() && stato != "IT") return TRUE;
|
||||||
if (pi.empty()) return TRUE;
|
if (pi.empty()) return TRUE;
|
||||||
@ -220,10 +220,10 @@ HIDDEN bool _xt_pi_val(TEdit_field& f, KEY key)
|
|||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (m.query_mode()) return TRUE;
|
if (m.query_mode()) return TRUE;
|
||||||
|
|
||||||
TString value(f.get());
|
TString16 value(f.get());
|
||||||
if (value.empty()) return f.error_box("Partita IVA obbligatoria");
|
if (value.empty()) return f.error_box("Partita IVA obbligatoria");
|
||||||
|
|
||||||
const TString stato(m.get(atoi(get_val_param(0))));
|
const TString16 stato(m.get(atoi(get_val_param(0))));
|
||||||
if (stato.not_empty() && stato != "IT") return TRUE;
|
if (stato.not_empty() && stato != "IT") return TRUE;
|
||||||
|
|
||||||
if (!_pi_val(f, key)) return FALSE;
|
if (!_pi_val(f, key)) return FALSE;
|
||||||
@ -237,7 +237,7 @@ HIDDEN bool _xt_pi_val(TEdit_field& f, KEY key)
|
|||||||
const int comune = atoi(get_val_param(i));
|
const int comune = atoi(get_val_param(i));
|
||||||
if (comune)
|
if (comune)
|
||||||
{
|
{
|
||||||
const TString com(m.get(comune)); // Comune residenza fiscale e residenza
|
const TString16 com(m.get(comune)); // Comune residenza fiscale e residenza
|
||||||
if (com.not_empty())
|
if (com.not_empty())
|
||||||
{
|
{
|
||||||
c.zero();
|
c.zero();
|
||||||
@ -269,7 +269,7 @@ HIDDEN bool _xtz_pi_val(TEdit_field& f, KEY key)
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (f.mask().query_mode()) return TRUE;
|
if (f.mask().query_mode()) return TRUE;
|
||||||
TString pi(f.get());
|
TString16 pi(f.get());
|
||||||
if (pi.empty()) return TRUE;
|
if (pi.empty()) return TRUE;
|
||||||
return _xt_pi_val(f, key);
|
return _xt_pi_val(f, key);
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (f.mask().query_mode()) return TRUE;
|
if (f.mask().query_mode()) return TRUE;
|
||||||
|
|
||||||
const TString cf(f.get());
|
const TString16 cf(f.get());
|
||||||
if (cf.empty()) return f.error_box("Codice fiscale obbligatorio");
|
if (cf.empty()) return f.error_box("Codice fiscale obbligatorio");
|
||||||
|
|
||||||
if (!_cf_val(f, key)) return FALSE;
|
if (!_cf_val(f, key)) return FALSE;
|
||||||
@ -288,7 +288,7 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
if (cf.len() == 11)
|
if (cf.len() == 11)
|
||||||
{
|
{
|
||||||
if (!_xt_pi_val(f, key)) return FALSE;
|
if (!_xt_pi_val(f, key)) return FALSE;
|
||||||
TString stato(f.mask().get(atoi(get_val_param(0))));
|
TString16 stato(f.mask().get(atoi(get_val_param(0))));
|
||||||
if ((stato.not_empty()) && (stato != "IT")) return TRUE;
|
if ((stato.not_empty()) && (stato != "IT")) return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,10 +302,10 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
|
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
|
||||||
|
|
||||||
char sesso = fld_sex.get()[0];
|
char sesso = fld_sex.get()[0];
|
||||||
TString data(fld_dat.get());
|
TString16 data(fld_dat.get());
|
||||||
TString com(fld_com.get());
|
TString16 com(fld_com.get());
|
||||||
|
|
||||||
TString wm("LMNPQRSTUV");
|
TString16 wm("LMNPQRSTUV");
|
||||||
int p;
|
int p;
|
||||||
if ((p = wm.find(cf[6])) != -1) cf[6] = '0' + p;
|
if ((p = wm.find(cf[6])) != -1) cf[6] = '0' + p;
|
||||||
if ((p = wm.find(cf[7])) != -1) cf[7] = '0' + p;
|
if ((p = wm.find(cf[7])) != -1) cf[7] = '0' + p;
|
||||||
@ -494,7 +494,7 @@ HIDDEN bool _numcalc_val(TEdit_field& f, KEY k)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
@ -517,7 +517,7 @@ HIDDEN bool _strcalc_val(TEdit_field& f, KEY k)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
@ -53,7 +53,7 @@ void TWindow_manager::destroy()
|
|||||||
while (_current >= 0)
|
while (_current >= 0)
|
||||||
{
|
{
|
||||||
TWindow* w = cur_win();
|
TWindow* w = cur_win();
|
||||||
w->stop_run(K_QUIT);
|
w->stop_run(K_FORCE_CLOSE);
|
||||||
w->close_modal();
|
w->close_modal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -750,8 +750,17 @@ void xvt_statbar_refresh()
|
|||||||
HIDDEN bool test_menu_tag(MENU_ITEM* mi, MENU_TAG tag)
|
HIDDEN bool test_menu_tag(MENU_ITEM* mi, MENU_TAG tag)
|
||||||
{
|
{
|
||||||
CHECK(mi, "Can't test NULL MENU_ITEM");
|
CHECK(mi, "Can't test NULL MENU_ITEM");
|
||||||
|
|
||||||
|
while (mi->tag)
|
||||||
|
{
|
||||||
if (mi->tag == tag) return TRUE;
|
if (mi->tag == tag) return TRUE;
|
||||||
if (mi->child != NULL) return test_menu_tag(mi->child, tag);
|
if (mi->child != NULL)
|
||||||
|
{
|
||||||
|
const bool ok = test_menu_tag(mi->child, tag);
|
||||||
|
if (ok) return TRUE;
|
||||||
|
}
|
||||||
|
mi++;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user