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
216
cg/cg0100.cpp
216
cg/cg0100.cpp
@ -11,23 +11,23 @@
|
||||
|
||||
class CG0100_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _saldi;
|
||||
TLocalisamfile* _tabcom;
|
||||
TMask* _msk;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _saldi;
|
||||
TLocalisamfile* _tabcom;
|
||||
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) {return _msk;}
|
||||
virtual bool changing_mask(int mode) {return FALSE;}
|
||||
virtual bool protected_record(TRectype &rec);
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m) {init_insert_mode(m);}
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) {return _msk;}
|
||||
virtual bool changing_mask(int mode) {return FALSE;}
|
||||
virtual bool protected_record(TRectype &rec);
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m) {init_insert_mode(m);}
|
||||
|
||||
public:
|
||||
virtual TRelation* get_relation() const {return _rel;}
|
||||
CG0100_application() {}
|
||||
virtual TRelation* get_relation() const {return _rel;}
|
||||
CG0100_application() {}
|
||||
};
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ bool CG0100_application::protected_record(TRectype &rec)
|
||||
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
||||
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))
|
||||
{
|
||||
_saldi->zero();
|
||||
@ -51,12 +51,12 @@ bool CG0100_application::protected_record(TRectype &rec)
|
||||
_saldi->read(_isgteq);
|
||||
|
||||
return _saldi->good() && gruppo ==_saldi->get_int(PCN_GRUPPO) &&
|
||||
conto ==_saldi->get_int(PCN_CONTO) &&
|
||||
sottoc ==_saldi->get_long(PCN_SOTTOCONTO);
|
||||
conto ==_saldi->get_int(PCN_CONTO) &&
|
||||
sottoc ==_saldi->get_long(PCN_SOTTOCONTO);
|
||||
}
|
||||
pconti.zero() ;
|
||||
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)
|
||||
pconti.put(PCN_CONTO, conto);
|
||||
TRectype rec1(pconti.curr());
|
||||
@ -66,45 +66,45 @@ bool CG0100_application::protected_record(TRectype &rec)
|
||||
pconti.next();
|
||||
|
||||
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 nconto = pconti.get_int(PCN_CONTO);
|
||||
// const int ngruppo = pconti.get_int(PCN_GRUPPO);
|
||||
// const int nconto = pconti.get_int(PCN_CONTO);
|
||||
|
||||
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
||||
// if (conto == 0 && gruppo == ngruppo)
|
||||
// return TRUE;
|
||||
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
||||
// if (conto == 0 && gruppo == ngruppo)
|
||||
// return TRUE;
|
||||
|
||||
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
||||
// dello stesso gruppo e conto
|
||||
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
||||
// dello stesso gruppo e conto
|
||||
|
||||
// if (gruppo == ngruppo && conto == nconto)
|
||||
// return TRUE;
|
||||
// return FALSE;
|
||||
// if (gruppo == ngruppo && conto == nconto)
|
||||
// return TRUE;
|
||||
// return FALSE;
|
||||
}
|
||||
|
||||
void CG0100_application::init_query_mode(TMask& m)
|
||||
|
||||
{
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -3);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -3);
|
||||
}
|
||||
|
||||
HIDDEN bool tmcf_handler(TMask_field& f, KEY key)
|
||||
|
||||
{
|
||||
if (f.active() && key == K_SPACE)
|
||||
{
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||
const bool enable_sezsaldi = (sottoc != 0) || (sottoc == 0 && conto != 0 && m.get(FLD_CM1_TMCF).not_empty());
|
||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||
const bool enable_sezsaldi = (sottoc != 0) || (sottoc == 0 && conto != 0 && m.get(FLD_CM1_TMCF).not_empty());
|
||||
|
||||
m.show(FLD_CM2_SEZSALDI, enable_sezsaldi);
|
||||
}
|
||||
return TRUE;
|
||||
m.show(FLD_CM2_SEZSALDI, enable_sezsaldi);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HIDDEN bool ivd_enable = TRUE;
|
||||
@ -206,17 +206,17 @@ void CG0100_application::init_insert_mode(TMask& m)
|
||||
m.show(FLD_CM1_NUMIVDH, !ivd_enable);
|
||||
if (!ivd_enable)
|
||||
{
|
||||
m.set(FLD_CM1_SEZIVD, s1);
|
||||
m.set(FLD_CM1_LETTIVDH, s2);
|
||||
m.set(FLD_CM1_NUMRIVDH, s3);
|
||||
m.set(FLD_CM1_NUMIVDH, s4);
|
||||
m.set(FLD_CM1_SEZIVD, s1);
|
||||
m.set(FLD_CM1_LETTIVDH, s2);
|
||||
m.set(FLD_CM1_NUMRIVDH, s3);
|
||||
m.set(FLD_CM1_NUMIVDH, s4);
|
||||
}
|
||||
}
|
||||
pconti.zero();
|
||||
pconti.put(PCN_GRUPPO, gruppo);
|
||||
pconti.read();
|
||||
if (pconti.good())
|
||||
if (s.empty()) s = pconti.get(PCN_CODCBL);
|
||||
if (s.empty()) s = pconti.get(PCN_CODCBL);
|
||||
}
|
||||
if (s.not_empty())
|
||||
{
|
||||
@ -236,90 +236,90 @@ void CG0100_application::init_insert_mode(TMask& m)
|
||||
|
||||
HIDDEN bool gruppo_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
const int gruppo = atoi(m.get(FLD_CM1_GRUPPO));
|
||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
||||
CG0100_application* app = (CG0100_application*) MainApp();
|
||||
TLocalisamfile& pconti = *app->get_relation()->lfile();
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
const int gruppo = atoi(m.get(FLD_CM1_GRUPPO));
|
||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
||||
CG0100_application* app = (CG0100_application*) MainApp();
|
||||
TLocalisamfile& pconti = *app->get_relation()->lfile();
|
||||
|
||||
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
||||
return TRUE;
|
||||
if (gruppo == 0)
|
||||
{
|
||||
if (conto != 0 || sottoc != 0)
|
||||
return f.warning_box("Codice conto impossibile!");
|
||||
else
|
||||
return f.error_box("E' obbligatorio l'inserimento del gruppo");
|
||||
}
|
||||
if (conto > 0 && sottoc == 0) // conto => ricerca gruppo
|
||||
{
|
||||
pconti.zero() ;
|
||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||
pconti.setkey(1) ;
|
||||
pconti.read(_isequal, _nolock );
|
||||
if (pconti.bad())
|
||||
return f.warning_box ("Non esiste il gruppo relativo a questo conto");
|
||||
}
|
||||
if (sottoc > 0) // sottoconto => ricerca conto
|
||||
{
|
||||
pconti.zero() ;
|
||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||
pconti.put(PCN_CONTO, conto) ;
|
||||
pconti.setkey(1) ;
|
||||
pconti.read(_isequal, _nolock );
|
||||
if (pconti.bad())
|
||||
return f.warning_box ("Non esiste il conto relativo a questo sottoconto");
|
||||
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
||||
return TRUE;
|
||||
if (gruppo == 0)
|
||||
{
|
||||
if (conto != 0 || sottoc != 0)
|
||||
return f.warning_box("Codice conto impossibile!");
|
||||
else
|
||||
return f.error_box("E' obbligatorio l'inserimento del gruppo");
|
||||
}
|
||||
if (conto > 0 && sottoc == 0) // conto => ricerca gruppo
|
||||
{
|
||||
pconti.zero() ;
|
||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||
pconti.setkey(1) ;
|
||||
pconti.read(_isequal, _nolock );
|
||||
if (pconti.bad())
|
||||
return f.warning_box ("Non esiste il gruppo relativo a questo conto");
|
||||
}
|
||||
if (sottoc > 0) // sottoconto => ricerca conto
|
||||
{
|
||||
pconti.zero() ;
|
||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||
pconti.put(PCN_CONTO, conto) ;
|
||||
pconti.setkey(1) ;
|
||||
pconti.read(_isequal, _nolock );
|
||||
if (pconti.bad())
|
||||
return f.warning_box ("Non esiste il conto relativo a questo sottoconto");
|
||||
else
|
||||
{
|
||||
TString tmcf = pconti.get(PCN_TMCF);
|
||||
TString tmcf = pconti.get(PCN_TMCF);
|
||||
if (tmcf.not_empty())
|
||||
return f.warning_box ("Non puoi inserire un sottoconto di un conto relativo ad un cliente/fornitore");
|
||||
return f.warning_box ("Non puoi inserire un sottoconto di un conto relativo ad un cliente/fornitore");
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_TAB)
|
||||
{
|
||||
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
|
||||
if (gruppo.empty()) return TRUE;
|
||||
TString conto(f.mask().get(FLD_CM1_CONTO));
|
||||
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
||||
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
||||
dispatch_e_char(f.parent(), K_SHIFT_ENTER);
|
||||
}
|
||||
if (key == K_TAB)
|
||||
{
|
||||
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
|
||||
if (gruppo.empty()) return TRUE;
|
||||
TString conto(f.mask().get(FLD_CM1_CONTO));
|
||||
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
||||
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
||||
dispatch_e_char(f.parent(), K_AUTO_ENTER);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CG0100_application::user_create()
|
||||
{
|
||||
_msk = new TMask("cg0100a") ;
|
||||
_msk->set_handler(FLD_CM1_GRUPPO, gruppo_handler);
|
||||
_msk->set_handler(FLD_CM1_SOTTOCONTO, sottoc_handler);
|
||||
_msk->set_handler(FLD_CM1_INDBIL, indbil_handler);
|
||||
_msk->set_handler(FLD_CM1_TMCF, tmcf_handler);
|
||||
_msk = new TMask("cg0100a") ;
|
||||
_msk->set_handler(FLD_CM1_GRUPPO, gruppo_handler);
|
||||
_msk->set_handler(FLD_CM1_SOTTOCONTO, sottoc_handler);
|
||||
_msk->set_handler(FLD_CM1_INDBIL, indbil_handler);
|
||||
_msk->set_handler(FLD_CM1_TMCF, tmcf_handler);
|
||||
|
||||
_rel = new TRelation(LF_PCON);
|
||||
_saldi = new TLocalisamfile(LF_SALDI);
|
||||
_saldi->setkey(2);
|
||||
set_search_field(FLD_CM1_GRUPPO);
|
||||
return TRUE;
|
||||
_rel = new TRelation(LF_PCON);
|
||||
_saldi = new TLocalisamfile(LF_SALDI);
|
||||
_saldi->setkey(2);
|
||||
set_search_field(FLD_CM1_GRUPPO);
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
bool CG0100_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _saldi;
|
||||
delete _rel;
|
||||
delete _saldi;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -7,18 +7,18 @@
|
||||
class CG0300_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _ditte;
|
||||
TLocalisamfile* _attiv;
|
||||
TLocalisamfile* _clifo;
|
||||
TRelation *_rel;
|
||||
TLocalisamfile* _ditte;
|
||||
TLocalisamfile* _attiv;
|
||||
TLocalisamfile* _clifo;
|
||||
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) {return _msk;}
|
||||
virtual bool changing_mask(int mode) {return FALSE;}
|
||||
virtual TRelation* get_relation() const {return _rel;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_query_insert_mode(TMask& m);
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) {return _msk;}
|
||||
virtual bool changing_mask(int mode) {return FALSE;}
|
||||
virtual TRelation* get_relation() const {return _rel;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_query_insert_mode(TMask& m);
|
||||
|
||||
public:
|
||||
CG0300_application() {}
|
||||
@ -27,49 +27,49 @@ public:
|
||||
void CG0300_application::init_query_mode(TMask& m)
|
||||
|
||||
{
|
||||
disable_menu_item(M_FILE_NEW);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'h', -2);
|
||||
disable_menu_item(M_FILE_NEW);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'h', -2);
|
||||
}
|
||||
|
||||
void CG0300_application::init_query_insert_mode(TMask& m)
|
||||
|
||||
{
|
||||
disable_menu_item(M_FILE_NEW);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'h', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||
disable_menu_item(M_FILE_NEW);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'h', -1);
|
||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||
}
|
||||
|
||||
|
||||
HIDDEN bool key_handler (TMask_field& f, KEY k)
|
||||
|
||||
{
|
||||
if (k == K_TAB)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
if (k == K_TAB)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
|
||||
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
||||
m.get(F_CODCF).not_empty())
|
||||
m.send_key(K_SHIFT_ENTER, 0);
|
||||
}
|
||||
return TRUE;
|
||||
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
||||
m.get(F_CODCF).not_empty())
|
||||
m.send_key(K_AUTO_ENTER, 0);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CG0300_application::user_create()
|
||||
{
|
||||
_msk = new TMask("cg0300a") ;
|
||||
_msk->set_handler (F_IMMESSO, key_handler);
|
||||
_rel = new TRelation(LF_ALLEG);
|
||||
_rel = new TRelation(LF_ALLEG);
|
||||
_ditte = new TLocalisamfile(LF_NDITTE);
|
||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||
const long ditta = get_firm();
|
||||
_msk->set(F_CODDITTA, format("%ld", ditta));
|
||||
_ditte->zero();
|
||||
_ditte->put(N_CODDITTA, ditta);
|
||||
_ditte->read();
|
||||
if (_ditte->good())
|
||||
_msk->set(F_CODATT,_ditte->get(N_CODATTPREV));
|
||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||
const long ditta = get_firm();
|
||||
_msk->set(F_CODDITTA, format("%ld", ditta));
|
||||
_ditte->zero();
|
||||
_ditte->put(N_CODDITTA, ditta);
|
||||
_ditte->read();
|
||||
if (_ditte->good())
|
||||
_msk->set(F_CODATT,_ditte->get(N_CODATTPREV));
|
||||
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,
|
||||
const real& saldorafr = ZERO,
|
||||
const real& sld_prg_dare = ZERO,
|
||||
const real& sld_prg_avere = ZERO,
|
||||
const real& mov_dare = ZERO,
|
||||
const real& mov_avere = ZERO)
|
||||
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo,
|
||||
const real& saldorafr,
|
||||
const real& sld_prg_dare,
|
||||
const real& sld_prg_avere,
|
||||
const real& mov_dare,
|
||||
const real& mov_avere)
|
||||
{
|
||||
b->saldo = saldo;
|
||||
b->saldorafr = saldorafr;
|
||||
|
@ -627,7 +627,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
int TPrimanota_application::write(const TMask& m)
|
||||
{
|
||||
const long numreg = m.get_long(F_NUMREG);
|
||||
if (numreg > _lastreg) _lastreg = numreg;
|
||||
if (numreg > _lastreg) _lastreg = numreg; // Aggiorna ultima registrazione
|
||||
|
||||
mask2rel(m);
|
||||
const int err = _rel->write(TRUE);
|
||||
|
980
cg/cg3200.cpp
980
cg/cg3200.cpp
File diff suppressed because it is too large
Load Diff
216
cg/cg3500.cpp
216
cg/cg3500.cpp
@ -3,9 +3,7 @@
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <printapp.h>
|
||||
#include <date.h>
|
||||
#include <mask.h>
|
||||
#include <scanner.h>
|
||||
#include <utility.h>
|
||||
#include <prefix.h>
|
||||
#include <config.h>
|
||||
@ -13,14 +11,14 @@
|
||||
#include <pconti.h>
|
||||
#include <comuni.h>
|
||||
#include <clifo.h>
|
||||
|
||||
#include <saldi.h>
|
||||
#include <nditte.h>
|
||||
#include <anagr.h>
|
||||
|
||||
#include <cglib.h>
|
||||
|
||||
#include <cg3.h>
|
||||
#include <cg3500.h>
|
||||
#include "cglib.h"
|
||||
#include "cg3.h"
|
||||
#include "cg3500.h"
|
||||
|
||||
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
||||
|
||||
@ -96,7 +94,7 @@ bool CG3500_application::riepilogo()
|
||||
|
||||
//il conto e' cambiato anche se e' rimasto invariato il conto ma e' cambiato il gruppo
|
||||
if ( (((cp != -1) && (conto.conto() != cp)) || ((gp != -1) && (conto.gruppo() != gp)))
|
||||
&& esiste_sc )
|
||||
&& esiste_sc )
|
||||
{
|
||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||
prg_gruppo_dare += prg_conto_dare;
|
||||
@ -112,7 +110,7 @@ bool CG3500_application::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||
if (saldo_conto > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
else
|
||||
{
|
||||
saldo_conto = saldo_conto * (-1.00);
|
||||
@ -137,7 +135,7 @@ bool CG3500_application::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
else
|
||||
{
|
||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||
@ -151,73 +149,73 @@ bool CG3500_application::riepilogo()
|
||||
}
|
||||
if ( (conto.sottoconto() == 0) && (conto.conto() != 0) ) //si tratta di un conto
|
||||
{
|
||||
if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
|
||||
{
|
||||
_udata_max = 0l;
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
|
||||
if (esiste_sc)
|
||||
{
|
||||
gp = conto.gruppo();
|
||||
cp = conto.conto();
|
||||
}
|
||||
TRecnotype recnum = _pcn->recno();
|
||||
_pcn->next();
|
||||
if (_pcn->eof())
|
||||
{
|
||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||
prg_gruppo_dare += prg_conto_dare;
|
||||
prg_gruppo_avere += prg_conto_avere;
|
||||
if (esiste_sc)
|
||||
{
|
||||
//scrivo il record del conto;
|
||||
_tmp_saldi->zero();
|
||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||
_tmp_saldi->put(SLD_CONTO,cp);
|
||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||
_tmp_saldi->put(SLD_DATAULMOV,_udata_max);
|
||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||
if (saldo_conto > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
else
|
||||
{
|
||||
saldo_conto = saldo_conto * (-1.00);
|
||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
|
||||
}
|
||||
_tmp_saldi->write();
|
||||
esiste_conto = TRUE;
|
||||
}
|
||||
if (esiste_conto)
|
||||
{
|
||||
saldo_gruppo = prg_gruppo_dare - prg_gruppo_avere;
|
||||
//scrivo il record del gruppo
|
||||
_tmp_saldi->zero();
|
||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||
_tmp_saldi->put(SLD_CONTO,0);
|
||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
else
|
||||
{
|
||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_gruppo);
|
||||
}
|
||||
_tmp_saldi->write();
|
||||
}
|
||||
}
|
||||
_pcn->readat(recnum);
|
||||
if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
|
||||
{
|
||||
_udata_max = 0l;
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
|
||||
if (esiste_sc)
|
||||
{
|
||||
gp = conto.gruppo();
|
||||
cp = conto.conto();
|
||||
}
|
||||
TRecnotype recnum = _pcn->recno();
|
||||
_pcn->next();
|
||||
if (_pcn->eof())
|
||||
{
|
||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||
prg_gruppo_dare += prg_conto_dare;
|
||||
prg_gruppo_avere += prg_conto_avere;
|
||||
if (esiste_sc)
|
||||
{
|
||||
//scrivo il record del conto;
|
||||
_tmp_saldi->zero();
|
||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||
_tmp_saldi->put(SLD_CONTO,cp);
|
||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||
_tmp_saldi->put(SLD_DATAULMOV,_udata_max);
|
||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||
if (saldo_conto > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
else
|
||||
{
|
||||
saldo_conto = saldo_conto * (-1.00);
|
||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
|
||||
}
|
||||
_tmp_saldi->write();
|
||||
esiste_conto = TRUE;
|
||||
}
|
||||
if (esiste_conto)
|
||||
{
|
||||
saldo_gruppo = prg_gruppo_dare - prg_gruppo_avere;
|
||||
//scrivo il record del gruppo
|
||||
_tmp_saldi->zero();
|
||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||
_tmp_saldi->put(SLD_CONTO,0);
|
||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
else
|
||||
{
|
||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_gruppo);
|
||||
}
|
||||
_tmp_saldi->write();
|
||||
}
|
||||
}
|
||||
_pcn->readat(recnum);
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (conto.conto() == 0)
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
indbil = _pcn->get_int(PCN_INDBIL);
|
||||
|
||||
if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto
|
||||
{
|
||||
@ -230,7 +228,7 @@ bool CG3500_application::riepilogo()
|
||||
prg_dare = 0.00;
|
||||
prg_avere = 0.00;
|
||||
if (_richiesta == 1)
|
||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
saldo = prg_dare - prg_avere;
|
||||
|
||||
@ -248,7 +246,7 @@ bool CG3500_application::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
||||
if (saldo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||
else
|
||||
{
|
||||
saldo = saldo * (-1.00);
|
||||
@ -282,7 +280,7 @@ bool CG3500_application::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||
if (saldo_conto > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||
else
|
||||
{
|
||||
saldo_conto = saldo_conto * (-1.00);
|
||||
@ -299,7 +297,7 @@ bool CG3500_application::riepilogo()
|
||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||
else
|
||||
{
|
||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||
@ -336,7 +334,7 @@ bool CG3500_application::ricerca_cf(TConto& conto,int indbil,real& prg_conto_dar
|
||||
prg_avere = 0.00;
|
||||
conto.set(g, c, s, tipo); //aggiunge a conto s
|
||||
if (_richiesta == 1)
|
||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||
saldo = prg_dare - prg_avere;
|
||||
prg_conto_dare += prg_dare;
|
||||
@ -352,7 +350,7 @@ bool CG3500_application::ricerca_cf(TConto& conto,int indbil,real& prg_conto_dar
|
||||
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
||||
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
||||
if (saldo > 0.00) //va stampato in Dare
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||
else
|
||||
{
|
||||
saldo = saldo * (-1.00);
|
||||
@ -497,7 +495,7 @@ tipo CG3500_application::leggi_gruppi(int counter)
|
||||
}
|
||||
|
||||
if (_gprec == -1)
|
||||
_gprec = _gcorr;
|
||||
_gprec = _gcorr;
|
||||
|
||||
_tmp_saldi->readat(pos);
|
||||
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
||||
@ -527,7 +525,7 @@ bool CG3500_application::CercaConto(int g, int c)
|
||||
_cconto = _tmp_saldi->get_int(SLD_CONTO);
|
||||
_tipo = _tmp_saldi->get(SLD_FLAGSALINI)[0];
|
||||
if (_scelta == 2)
|
||||
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
||||
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
||||
TConto conto (_gconto,_cconto,0l,_tipo);
|
||||
_descrconto = conto.descrizione();
|
||||
_prg_dare_conto = _tmp_saldi->get_real(SLD_PDARE);
|
||||
@ -570,13 +568,13 @@ bool CG3500_application::preprocess_page(int file, int counter)
|
||||
reset_print();
|
||||
|
||||
if (_scelta == 1)
|
||||
_tp = leggi_conti(counter);
|
||||
_tp = leggi_conti(counter);
|
||||
if (_scelta == 2)
|
||||
_tp = leggi_gruppi(counter);
|
||||
_tp = leggi_gruppi(counter);
|
||||
if (_tp == fine)
|
||||
{
|
||||
if (_scelta == 1)
|
||||
setta_riga_sottoconto();
|
||||
setta_riga_sottoconto();
|
||||
setta_riga_conto();
|
||||
setta_riga_gruppo();
|
||||
setta_riga_totale();
|
||||
@ -587,9 +585,9 @@ bool CG3500_application::preprocess_page(int file, int counter)
|
||||
setta_riga_gruppo();
|
||||
}
|
||||
if (_tp == stampaconto)
|
||||
setta_riga_conto();
|
||||
setta_riga_conto();
|
||||
if (_tp == stampasottoconto)
|
||||
setta_riga_sottoconto();
|
||||
setta_riga_sottoconto();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -604,7 +602,7 @@ print_action CG3500_application::postprocess_print(int file, int counter)
|
||||
print_action CG3500_application::postprocess_page(int file, int counter)
|
||||
{
|
||||
if (_tp == fine)
|
||||
return NEXT_PAGE;
|
||||
return NEXT_PAGE;
|
||||
|
||||
return REPEAT_PAGE;
|
||||
}
|
||||
@ -627,22 +625,22 @@ void CG3500_application::setta_riga_conto()
|
||||
|
||||
riga = "";
|
||||
if ( (_tp == fine) && (_scelta == 1) ) r = 2;
|
||||
else r = 1;
|
||||
else r = 1;
|
||||
if (_scelta == 1)
|
||||
{
|
||||
set_row(r++,"%s",(const char*)riga);
|
||||
set_row(r,"**** Totali conto %03d.%03d",(const char*)_gconto,(const char*)_cconto);
|
||||
set_row(r," %.27s",(const char*)_descrconto);
|
||||
set_row(r++,"%s",(const char*)riga);
|
||||
set_row(r,"**** Totali conto %03d.%03d",(const char*)_gconto,(const char*)_cconto);
|
||||
set_row(r," %.27s",(const char*)_descrconto);
|
||||
}
|
||||
if (_scelta == 2)
|
||||
{
|
||||
set_row(r,"%03d", (const char*)_ccorr);
|
||||
set_row(r," %.32s",(const char*)_descrconto);
|
||||
set_row(r,"@42g%s",(const char*)udata);
|
||||
set_row(r,"%03d", (const char*)_ccorr);
|
||||
set_row(r," %.32s",(const char*)_descrconto);
|
||||
set_row(r,"@42g%s",(const char*)udata);
|
||||
}
|
||||
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_conto,&_prg_avere_conto,&_saldo_dare_conto,&_saldo_avere_conto);
|
||||
if ( (_scelta == 1) || ((_scelta == 2) && (_tp == fine)) )
|
||||
set_row(r,"%s",(const char*)riga);
|
||||
set_row(r,"%s",(const char*)riga);
|
||||
}
|
||||
|
||||
void CG3500_application::setta_riga_gruppo()
|
||||
@ -652,11 +650,11 @@ void CG3500_application::setta_riga_gruppo()
|
||||
|
||||
riga.fill('-');
|
||||
if (_scelta == 1)
|
||||
if (_tp == fine) r = 5;
|
||||
else r = 4;
|
||||
if (_tp == fine) r = 5;
|
||||
else r = 4;
|
||||
if (_scelta == 2)
|
||||
if (_tp == fine) r = 3;
|
||||
else r = 2;
|
||||
if (_tp == fine) r = 3;
|
||||
else r = 2;
|
||||
set_row(r,"**** TOTALI GRUPPO %03d-",(const char*)_ggruppo);
|
||||
set_row(r," %.30s",(const char*)_descrgruppo);
|
||||
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_gruppo,&_prg_avere_gruppo,&_saldo_dare_gruppo,&_saldo_avere_gruppo);
|
||||
@ -674,7 +672,7 @@ void CG3500_application::setta_riga_totale()
|
||||
else r = 6;
|
||||
set_row(r,"**** TOTALE GENERALE @57g%r@77g%r",&_prg_dare_tot,&_prg_avere_tot);
|
||||
if (_saldo_tot > 0.00)
|
||||
set_row(r,"@97g%r",&_saldo_tot);
|
||||
set_row(r,"@97g%r",&_saldo_tot);
|
||||
else
|
||||
{
|
||||
_saldo_tot = _saldo_tot * (-1.00);
|
||||
@ -689,15 +687,15 @@ TDate CG3500_application::UltimaData(int g, int c, long s, int anno)
|
||||
|
||||
saldi.zero();
|
||||
if (_annoese != 0)
|
||||
saldi.put(SLD_ANNOES, anno);
|
||||
saldi.put(SLD_ANNOES, anno);
|
||||
saldi.put(SLD_GRUPPO,g);
|
||||
if (c != 0)
|
||||
saldi.put(SLD_CONTO, c);
|
||||
saldi.put(SLD_CONTO, c);
|
||||
if (s != 0)
|
||||
saldi.put(SLD_SOTTOCONTO, s);
|
||||
saldi.put(SLD_SOTTOCONTO, s);
|
||||
saldi.read();
|
||||
if (saldi.bad())
|
||||
saldi.zero();
|
||||
saldi.zero();
|
||||
uldata = saldi.get(SLD_DATAULMOV);
|
||||
|
||||
return uldata;
|
||||
@ -818,9 +816,9 @@ int CG3500_application::stampa_intestazione_ditta()
|
||||
codice_ditta << get_firm();
|
||||
|
||||
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
||||
(const char*)_ragsoc, (const char*)_viafis,
|
||||
(const char*)_cap, (const char*)_comunefis,
|
||||
(const char*)_provfis);
|
||||
(const char*)_ragsoc, (const char*)_viafis,
|
||||
(const char*)_cap, (const char*)_comunefis,
|
||||
(const char*)_provfis);
|
||||
r++;
|
||||
printer().setdate(_data);
|
||||
riga = "Data @< Pag. @#";
|
||||
@ -841,17 +839,17 @@ void CG3500_application::preprocess_header()
|
||||
|
||||
r++;
|
||||
if (_scelta == 1) //stampa riepilogo conti
|
||||
set_header(r,"*** MASTRO DI CONTO ***");
|
||||
set_header(r,"*** MASTRO DI CONTO ***");
|
||||
else set_header(r,"*** MASTRO DI GRUPPO ***");
|
||||
set_header(r,"@33gAnno esercizio %d", _annoese);
|
||||
if (_richiesta == 1)
|
||||
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE");
|
||||
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE");
|
||||
else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI");
|
||||
|
||||
r++;
|
||||
r++;
|
||||
if (_scelta == 1)
|
||||
set_header(r,"SOTTOC DESCRIZIONE");
|
||||
set_header(r,"SOTTOC DESCRIZIONE");
|
||||
else set_header(r,"CONTO DESCRIZIONE");
|
||||
set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE");
|
||||
riga.fill('-');
|
||||
|
@ -4,10 +4,7 @@
|
||||
#include <tabutil.h>
|
||||
#include <printapp.h>
|
||||
#include <mask.h>
|
||||
#include <date.h>
|
||||
#include <scanner.h>
|
||||
#include <utility.h>
|
||||
#include <prefix.h>
|
||||
#include <config.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
@ -18,7 +15,6 @@
|
||||
#include <causali.h>
|
||||
#include <nditte.h>
|
||||
|
||||
#include "cg4.h"
|
||||
#include "cg4500a.h"
|
||||
#include "cg4500b.h"
|
||||
|
||||
@ -576,3 +572,15 @@ int cg4500 (int argc, char* argv[])
|
||||
main_app.run(argc, argv, "");
|
||||
return TRUE;
|
||||
}
|
||||
<<<<<<< cg4500.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> 1.4
|
||||
|
@ -546,7 +546,8 @@ TPush_button::TPush_button(short left, short top, short right, short bottom,
|
||||
caption = format("#%d#%d", BMP_DELREC, BMP_DELRECDN);
|
||||
break;
|
||||
case DLG_NEWREC:
|
||||
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
||||
if (height > ROWY && strcmp("~Nuovo", caption) == 0) // Puo' essere Gestione
|
||||
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
||||
break;
|
||||
case DLG_FIRSTREC:
|
||||
caption = format("#%d", BMP_FIRSTREC);
|
||||
|
@ -16,6 +16,7 @@
|
||||
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
||||
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
||||
#define K_QUIT 10334
|
||||
#define K_FORCE_CLOSE 11334
|
||||
#define K_SAVE 10082
|
||||
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
||||
#define K_SHIFT_F2 K_SHIFT+K_F2
|
||||
|
@ -98,10 +98,12 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
||||
switch(ep->v.ctl.id)
|
||||
{
|
||||
case DLG_OK :
|
||||
on_key(K_AUTO_ENTER); break;
|
||||
stop_run(K_AUTO_ENTER); break;
|
||||
case DLG_BAR :
|
||||
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 :
|
||||
on_key(K_NEXT); break;
|
||||
@ -123,8 +125,6 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
||||
stop_run(K_DEL); break;
|
||||
case DLG_SAVEREC :
|
||||
stop_run(K_SAVE); break;
|
||||
case DLG_QUIT :
|
||||
stop_run(K_QUIT); break;
|
||||
*/
|
||||
case DLG_F9:
|
||||
{
|
||||
@ -557,18 +557,18 @@ int TMask::find_active_field(int first, int dir) const
|
||||
void TMask::set_focus()
|
||||
{
|
||||
_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)
|
||||
{
|
||||
const WINDOW pw = win(); // previous window
|
||||
_page = page;
|
||||
show_window(win(), TRUE); // show new page
|
||||
const WINDOW pw = win(); // previous window
|
||||
_page = page; // update page number
|
||||
show_window(win(), TRUE); // show new page
|
||||
if (pw) show_window(pw, FALSE); // hide old page
|
||||
}
|
||||
|
||||
const WINDOW fw = fld(_focus).win();
|
||||
set_front_window(fw);
|
||||
set_front_window(f.win());
|
||||
}
|
||||
|
||||
|
||||
@ -577,9 +577,9 @@ void TMask::move_focus_field(int d)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -601,9 +601,7 @@ void TMask::move_focus_field(int d)
|
||||
|
||||
bool TMask::stop_run(KEY key)
|
||||
{
|
||||
if (key == K_CTRL_ENTER) key = K_ENTER;
|
||||
|
||||
if (key != K_AUTO_ENTER)
|
||||
if (key != K_AUTO_ENTER && key != K_FORCE_CLOSE)
|
||||
{
|
||||
const int last = fields();
|
||||
bool found = FALSE;
|
||||
@ -626,11 +624,13 @@ bool TMask::stop_run(KEY key)
|
||||
#ifdef DBG
|
||||
return error_box("Non e' attivo il bottone associato a %d", key);
|
||||
#else
|
||||
beep();
|
||||
return FALSE;
|
||||
#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)
|
||||
{
|
||||
@ -694,7 +694,7 @@ bool TMask::on_key(KEY key)
|
||||
if (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);
|
||||
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 <applicat.h>
|
||||
@ -1721,13 +1721,13 @@ const char* TEdit_field::format(const char* d)
|
||||
|
||||
if (fpark.not_empty())
|
||||
{
|
||||
#ifdef DBG
|
||||
if (fpark.len() > _size)
|
||||
{
|
||||
#ifdef DBG
|
||||
error_box("Campo %d troppo lungo: %d > %d", dlg(), fpark.len(), _size);
|
||||
#endif
|
||||
fpark.cut(_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_flags.uppercase)
|
||||
fpark.upper();
|
||||
|
@ -32,6 +32,11 @@ class TSpreadsheet : public TWindow
|
||||
|
||||
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);
|
||||
void init();
|
||||
|
||||
@ -99,11 +104,12 @@ void TSpreadsheet::init()
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
|
||||
TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||
const char* maskname, int maskno,
|
||||
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 MAX_COL = 32;
|
||||
@ -181,8 +187,8 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||
|
||||
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
||||
{
|
||||
const int cid = FIRST_FIELD+i; // Column & Field ID
|
||||
const TMask_field* f = field(cid); // Field on mask
|
||||
const int cid = FIRST_FIELD+i; // Column & Field ID
|
||||
const TMask_field* f = field(cid); // Field on mask
|
||||
const int w = width[i] + (f->has_query() ? 2 : 0); // Column width
|
||||
|
||||
long flags = XI_ATR_EDITMENU | XI_ATR_AUTOSCROLL;
|
||||
@ -259,8 +265,8 @@ TMask_field* TSpreadsheet::cell2field(const XI_OBJ* cell) const
|
||||
{
|
||||
TMask_field* f = field(id);
|
||||
if (f == NULL) break;
|
||||
good = f;
|
||||
if (f->active()) break;
|
||||
good = f; // We've found a field with the proper ID ...
|
||||
if (f->active()) break; // ... and it's active: end of search
|
||||
}
|
||||
|
||||
return good;
|
||||
@ -280,7 +286,7 @@ void TSpreadsheet::update_rec(int rec)
|
||||
|
||||
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||
{
|
||||
set_front_window(win());
|
||||
// set_front_window(win());
|
||||
XI_OBJ cell;
|
||||
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
||||
xi_set_focus(&cell);
|
||||
@ -331,7 +337,9 @@ void TSpreadsheet::update(int row)
|
||||
{
|
||||
xi_cell_request(_list);
|
||||
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
|
||||
update_rec(row);
|
||||
@ -349,11 +357,6 @@ void TSpreadsheet::xiev_handler(XI_OBJ *itf, XI_EVENT *xiev)
|
||||
// Certified 75%
|
||||
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)
|
||||
{
|
||||
case XIE_GET_FIRST:
|
||||
@ -430,18 +433,18 @@ break;
|
||||
case XIE_BUTTON:
|
||||
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);
|
||||
edit_field->set(val); // Update current cell
|
||||
check_enabled = FALSE; // Disable checks
|
||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
||||
if (edit_field->on_key(K_F9)) // Show search sheet
|
||||
_edit_field->set(val); // Update current cell
|
||||
_check_enabled = FALSE; // Disable checks
|
||||
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||
if (_edit_field->on_key(K_F9)) // Show search sheet
|
||||
{
|
||||
mask2str(cur_row); // Update row
|
||||
row_dirty = TRUE;
|
||||
mask2str(_cur_row); // Update row
|
||||
_row_dirty = TRUE;
|
||||
}
|
||||
check_enabled = TRUE; // Enable checks
|
||||
_check_enabled = TRUE; // Enable checks
|
||||
xi_set_focus(xiev->v.xi_obj); // Restore focus to cell
|
||||
}
|
||||
} else
|
||||
@ -450,17 +453,17 @@ if (xiev->v.xi_obj->type == XIT_LIST)
|
||||
break;
|
||||
case XIE_DBL_CELL:
|
||||
{
|
||||
check_enabled = FALSE;
|
||||
cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
||||
const KEY k = edit(cur_row);
|
||||
_check_enabled = FALSE;
|
||||
_cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
||||
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||
const KEY k = edit(_cur_row);
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
update_rec(cur_row);
|
||||
row_dirty = TRUE;
|
||||
update_rec(_cur_row);
|
||||
_row_dirty = TRUE;
|
||||
}
|
||||
xi_set_focus(xiev->v.xi_obj);
|
||||
check_enabled = TRUE;
|
||||
_check_enabled = TRUE;
|
||||
}
|
||||
break;
|
||||
case XIE_ON_ROW:
|
||||
@ -468,24 +471,24 @@ break;
|
||||
const int rec = row2rec(xiev->v.xi_obj->v.row);
|
||||
if (rec < items())
|
||||
{
|
||||
cur_row = rec;
|
||||
_cur_row = rec;
|
||||
str2mask(rec);
|
||||
row_dirty = FALSE;
|
||||
_row_dirty = FALSE;
|
||||
}
|
||||
else
|
||||
xiev->refused = TRUE;
|
||||
}
|
||||
break;
|
||||
case XIE_OFF_ROW:
|
||||
if (row_dirty && check_enabled)
|
||||
if (_row_dirty && _check_enabled)
|
||||
{
|
||||
check_enabled = FALSE; // Avoid recursion!
|
||||
str2mask(cur_row); // It shouldn't have to be necessary
|
||||
_check_enabled = FALSE; // Avoid recursion!
|
||||
str2mask(_cur_row); // It shouldn't have to be necessary
|
||||
bool ok = _mask.check_fields();
|
||||
if (ok)
|
||||
{
|
||||
mask2str(cur_row);
|
||||
ok = notify(cur_row, K_ENTER); // Notify edit
|
||||
mask2str(_cur_row);
|
||||
ok = notify(_cur_row, K_ENTER); // Notify edit
|
||||
}
|
||||
if (!ok)
|
||||
{
|
||||
@ -497,17 +500,17 @@ break;
|
||||
xvt_statbar_set("");
|
||||
set_dirty();
|
||||
}
|
||||
check_enabled = TRUE;
|
||||
_check_enabled = TRUE;
|
||||
}
|
||||
break;
|
||||
case XIE_ON_CELL:
|
||||
{
|
||||
TMask_field* f = cell2field(xiev->v.xi_obj);
|
||||
const int col = (f->dlg() - FIRST_FIELD) % 100;
|
||||
if (!cell_disabled(cur_row, col))
|
||||
if (!cell_disabled(_cur_row, col))
|
||||
{
|
||||
edit_field = f;
|
||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
||||
_edit_field = f;
|
||||
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, FOCUS_BACK_COLOR);
|
||||
}
|
||||
else
|
||||
@ -528,18 +531,18 @@ break;
|
||||
}
|
||||
break;
|
||||
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 nuo(c->picture_data(xi_get_text(xiev->v.xi_obj, NULL, -1), TRUE));
|
||||
if (old != nuo)
|
||||
{
|
||||
check_enabled = FALSE;
|
||||
if (!row_dirty)
|
||||
_check_enabled = FALSE;
|
||||
if (!_row_dirty)
|
||||
{
|
||||
notify(cur_row, K_SPACE);
|
||||
row_dirty = TRUE;
|
||||
notify(_cur_row, K_SPACE);
|
||||
_row_dirty = TRUE;
|
||||
}
|
||||
c->set(nuo); // Set new mask value
|
||||
c->set_dirty(); // Get it dirty!
|
||||
@ -550,10 +553,10 @@ break;
|
||||
}
|
||||
else
|
||||
{
|
||||
mask2str(cur_row); // Update sheet row
|
||||
edit_field = NULL; // Reset current field
|
||||
mask2str(_cur_row); // Update sheet row
|
||||
_edit_field = NULL; // Reset current field
|
||||
}
|
||||
check_enabled = TRUE;
|
||||
_check_enabled = TRUE;
|
||||
}
|
||||
if (!xiev->refused)
|
||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, NORMAL_BACK_COLOR);
|
||||
@ -580,35 +583,38 @@ break;
|
||||
XI_OBJ* itf = xi_get_itf(win());
|
||||
const bool ok = (bool)xi_move_focus(itf);
|
||||
if (!ok)
|
||||
{
|
||||
set_dirty(2);
|
||||
xiev->refused = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case E_CHAR:
|
||||
if (edit_field)
|
||||
if (_edit_field)
|
||||
{
|
||||
const KEY k = e_char_to_key(ep);
|
||||
switch(k)
|
||||
{
|
||||
case K_F1:
|
||||
check_enabled = FALSE; // Disable checks
|
||||
edit_field->on_key(K_F1);
|
||||
set_focus_cell(cur_row, cur_col);
|
||||
check_enabled = TRUE; // Enable checks
|
||||
_check_enabled = FALSE; // Disable checks
|
||||
_edit_field->on_key(K_F1);
|
||||
set_focus_cell(_cur_row, _cur_col);
|
||||
_check_enabled = TRUE; // Enable checks
|
||||
break;
|
||||
case K_F2:
|
||||
case K_F3:
|
||||
case K_F8:
|
||||
case K_F9:
|
||||
{
|
||||
check_enabled = FALSE; // Disable checks
|
||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
||||
if (edit_field->on_key(k))
|
||||
_check_enabled = FALSE; // Disable checks
|
||||
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||
if (_edit_field->on_key(k))
|
||||
{
|
||||
mask2str(cur_row);
|
||||
row_dirty = TRUE;
|
||||
mask2str(_cur_row);
|
||||
_row_dirty = TRUE;
|
||||
}
|
||||
set_focus_cell(cur_row, cur_col);
|
||||
check_enabled = TRUE; // Enable checks
|
||||
set_focus_cell(_cur_row, _cur_col);
|
||||
_check_enabled = TRUE; // Enable checks
|
||||
}
|
||||
break;
|
||||
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)
|
||||
{
|
||||
const int BUT_HEIGHT =
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
2
|
||||
const int BUT_HEIGHT = 2;
|
||||
#else
|
||||
1
|
||||
const int BUT_HEIGHT = 1;
|
||||
#endif
|
||||
;
|
||||
|
||||
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++)
|
||||
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(),
|
||||
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();
|
||||
for (const char* item = s->get(0); item; 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);
|
||||
}
|
||||
|
||||
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);
|
||||
slist_dispose(lst);
|
||||
|
||||
TString id(3); id << f->dlg();
|
||||
TString16 id; id << f->dlg();
|
||||
const int sel = s->get_pos(id) >> 1;
|
||||
win_list_set_sel(listbox, sel, TRUE);
|
||||
}
|
||||
@ -649,7 +652,7 @@ void TBrowse_sheet::repos_buttons() const
|
||||
if (w != NULL_WIN)
|
||||
{
|
||||
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.right += r.left;
|
||||
r.bottom += r.top;
|
||||
@ -673,7 +676,12 @@ bool TBrowse_sheet::on_key(KEY k)
|
||||
const TString old(_field->get());
|
||||
|
||||
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);
|
||||
field().set(val);
|
||||
|
||||
|
@ -18,7 +18,7 @@ END
|
||||
|
||||
BUTTON DLG_FINDREC 8 2
|
||||
BEGIN
|
||||
PROMPT -46 -1 "Ricerca"
|
||||
PROMPT -46 -1 "Ri~cerca"
|
||||
MESSAGE EXIT,K_F9
|
||||
END
|
||||
|
||||
|
@ -28,7 +28,7 @@ HIDDEN bool _expr_val(TEdit_field& f, KEY)
|
||||
const char* s = e.varname(i);
|
||||
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);
|
||||
}
|
||||
s++;
|
||||
@ -100,7 +100,7 @@ bool pi_check(const char * st, const char * paiva)
|
||||
// Controlla la partita iva se e' non vuota ed italiana
|
||||
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 (pi.empty()) return TRUE;
|
||||
@ -220,10 +220,10 @@ HIDDEN bool _xt_pi_val(TEdit_field& f, KEY key)
|
||||
TMask& m = f.mask();
|
||||
if (m.query_mode()) return TRUE;
|
||||
|
||||
TString value(f.get());
|
||||
TString16 value(f.get());
|
||||
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 (!_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));
|
||||
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())
|
||||
{
|
||||
c.zero();
|
||||
@ -269,7 +269,7 @@ HIDDEN bool _xtz_pi_val(TEdit_field& f, KEY key)
|
||||
|
||||
{
|
||||
if (f.mask().query_mode()) return TRUE;
|
||||
TString pi(f.get());
|
||||
TString16 pi(f.get());
|
||||
if (pi.empty()) return TRUE;
|
||||
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;
|
||||
|
||||
const TString cf(f.get());
|
||||
const TString16 cf(f.get());
|
||||
if (cf.empty()) return f.error_box("Codice fiscale obbligatorio");
|
||||
|
||||
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 (!_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;
|
||||
}
|
||||
|
||||
@ -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)));
|
||||
|
||||
char sesso = fld_sex.get()[0];
|
||||
TString data(fld_dat.get());
|
||||
TString com(fld_com.get());
|
||||
TString16 data(fld_dat.get());
|
||||
TString16 com(fld_com.get());
|
||||
|
||||
TString wm("LMNPQRSTUV");
|
||||
TString16 wm("LMNPQRSTUV");
|
||||
int p;
|
||||
if ((p = wm.find(cf[6])) != -1) cf[6] = '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);
|
||||
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);
|
||||
}
|
||||
s++;
|
||||
@ -517,7 +517,7 @@ HIDDEN bool _strcalc_val(TEdit_field& f, KEY k)
|
||||
const char* s = e.varname(i);
|
||||
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);
|
||||
}
|
||||
s++;
|
||||
|
@ -53,7 +53,7 @@ void TWindow_manager::destroy()
|
||||
while (_current >= 0)
|
||||
{
|
||||
TWindow* w = cur_win();
|
||||
w->stop_run(K_QUIT);
|
||||
w->stop_run(K_FORCE_CLOSE);
|
||||
w->close_modal();
|
||||
}
|
||||
}
|
||||
|
@ -750,8 +750,17 @@ void xvt_statbar_refresh()
|
||||
HIDDEN bool test_menu_tag(MENU_ITEM* mi, MENU_TAG tag)
|
||||
{
|
||||
CHECK(mi, "Can't test NULL MENU_ITEM");
|
||||
if (mi->tag == tag) return TRUE;
|
||||
if (mi->child != NULL) return test_menu_tag(mi->child, tag);
|
||||
|
||||
while (mi->tag)
|
||||
{
|
||||
if (mi->tag == tag) return TRUE;
|
||||
if (mi->child != NULL)
|
||||
{
|
||||
const bool ok = test_menu_tag(mi->child, tag);
|
||||
if (ok) return TRUE;
|
||||
}
|
||||
mi++;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user