Corretta stampa Sig. o Sig.ra nella stampa delle etichette delle persone fisiche

git-svn-id: svn://10.65.10.50/trunk@253 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-09-16 10:43:09 +00:00
parent 7b2d537322
commit 19a035c659
5 changed files with 132 additions and 127 deletions

View File

@ -86,7 +86,8 @@ class TMenu_application : public TApplication
protected:
void load_menu();
int do_level();
bool create();
virtual bool create();
virtual bool menu(MENU_TAG m);
public:
TMenu_application(const char* name) : _name(name) {}
@ -179,9 +180,16 @@ int TMenu_application::do_level()
}
bool TMenu_application::create()
{
load_menu();
dispatch_e_menu(BAR_ITEM(1));
return TRUE;
}
bool TMenu_application::menu(MENU_TAG)
{
int refarray[256];
int i = 0;
@ -213,14 +221,13 @@ bool TMenu_application::create()
else _level = (--i >= 0) ? refarray[i] : 0;
}
stop_run();
return TRUE;
return FALSE;
}
int main(int argc, char** argv)
{
const char* menu = (argc < 2) ? "prassi.mnu" : argv[1];
TMenu_application ma(menu);
ma.run(argc, argv, "PRASSI");
ma.run(argc, argv, "Menu principale");
return TRUE;
}

View File

@ -42,7 +42,7 @@ void BA6100_App::process_link(int id, const char* txt)
{
if (id == _ana_link)
{
TString ss = "1|"; ss << txt;
TString80 ss = "1|"; ss << txt;
TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss);
TMailbox m;
m.send(fs);
@ -51,10 +51,9 @@ void BA6100_App::process_link(int id, const char* txt)
}
else if (id == _dit_link)
{
TString ss = "1|"; ss << txt << "|" << txt;
TString80 ss = "1|"; ss << txt << "|" << txt;
TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss);
TMailbox m;
m.send(fs);
fs.send();
TExternal_app ba4("ba4 -2");
if (ba4.run()) beep();
}
@ -165,8 +164,9 @@ void BA6100_App::preprocess_etichette()
if (_pr_what == anafis)
{
_surname = _name.mid(30,50); _surname.trim();
_name = _name.mid(0,30); _name.trim();
_surname = _name.mid(30); _surname.trim();
_name = _name.cut(30); _name.trim();
_sex = get_field(LF_ANAGFIS,"SESSO")[0] == 'M' ? "Sig." : "Sig.ra";
}
switch (_ind_what)
{
@ -453,7 +453,7 @@ bool BA6100_App::set_print(int)
void BA6100_App::user_create()
{
TToken_string rxp(40);
{
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
// setup relation
@ -544,7 +544,7 @@ void BA6100_App::user_create()
set_wait_threshold(0);
p.addstatus(1);
}
}
void BA6100_App::user_destroy()
@ -561,6 +561,6 @@ void BA6100_App::user_destroy()
int ba6100(int argc, char* argv[])
{
BA6100_App app;
app.run(argc, argv, "Stampe Anagrafiche");
app.run(argc, argv, "Stampa Anagrafiche");
return 0;
}

View File

@ -41,7 +41,8 @@ class BA6100_App : public TPrintapp
bool _is_piv, _is_cod;
bool* _frpos;
TString _cod, _cofi, _name, _surname, _address,
_cap, _prov, _com, _civ, _stato, _phone;
_cap, _prov, _com, _civ, _stato, _phone;
TString16 _sex;
int _ana_link, _dit_link;
@ -63,7 +64,7 @@ public:
TRectype& look_com(const char* cod);
const char* look_tab(const char* tabname, const char* cod,
const char* fld = "S0");
const char* fld = "S0");
// bel casino, le schede
void set_scheda_anagiu();
@ -81,23 +82,23 @@ public:
void set_headers();
const char* get_field(int ln, const char* fn)
{ return current_cursor()->curr(ln).get(fn); }
{ return current_cursor()->curr(ln).get(fn); }
void init_print();
BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30),
_address(50), _cap(10), _prov(2), _com(50), _civ(5),
_stato(40), _phone(30)
_address(50), _cap(10), _prov(2), _com(50), _civ(5),
_stato(40), _phone(30)
{
_rel_fis = _rel_giu = _rel_dit = NULL;
_pr_type = undefined; _pr_what = anafis;
_inclditte = FALSE;
_ind_what = residenza;
_rows_et = 9; _cols_et = 40;
_is_piv = TRUE; _is_cod = FALSE;
_piv_row = 7; _cod_row = 2; _ind_row = 3;
_piv_col = _ind_col = 3; _cod_col = 6;
_frpos = NULL;
}
{
_rel_fis = _rel_giu = _rel_dit = NULL;
_pr_type = undefined; _pr_what = anafis;
_inclditte = FALSE;
_ind_what = residenza;
_rows_et = 9; _cols_et = 40;
_is_piv = TRUE; _is_cod = FALSE;
_piv_row = 7; _cod_row = 2; _ind_row = 3;
_piv_col = _ind_col = 3; _cod_col = 6;
_frpos = NULL;
}
};

View File

@ -91,19 +91,19 @@ BEGIN
PROMPT 4 11 "Salva impostazioni"
END
BUTTON DLG_OK 9 3
BUTTON DLG_OK 9 2
BEGIN
PROMPT 30 12 "Conferma"
PROMPT -13 -1 "Conferma"
END
BUTTON DLG_CANCEL 9 3
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT 44 12 "Annulla"
PROMPT -23 -1 "Annulla"
END
BUTTON BUT_BA6B_RESET 5 3
BUTTON BUT_BA6B_RESET 9 2
BEGIN
PROMPT 4 12 "Reset"
PROMPT -33 -1 "~Reset"
END
ENDPAGE

View File

@ -832,10 +832,7 @@ void BA6100_App::set_etichette()
set_row(namerow,TString(format("@%dg#t",_ind_col)), &_name);
else
{
set_row(namerow,TString(format("@%dg%s #t #t",_ind_col,
*((const char *)get_field(LF_ANAGFIS,"SESSO")) == 'M' ?
"Sig." : "Sig.ra")),
&_name, &_surname);
set_row(namerow,TString(format("@%dg#t #t #t",_ind_col)), &_sex, &_name, &_surname);
}
set_row(_ind_row,TString(format("@%dg#t #t", _ind_col)), &_address, &_civ);