Patch level : 10.0

Files correlati     : ve0 ve1
Ricompilazione Demo : [ ]
Commento            :
Aggiornato uso TWindow::handler


git-svn-id: svn://10.65.10.50/trunk@19480 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-10-20 15:37:29 +00:00
parent b90437ca1c
commit b5111dfbbe
4 changed files with 54 additions and 49 deletions

View File

@ -214,17 +214,9 @@ void TMotore_application::init_modify_mode( TMask& m )
if (key != __last_key) if (key != __last_key)
{ {
TString msg; TString msg;
msg.format("Documento non %s%s%s.", (no_mod ? "modificabile":""), msg.format(FR("Documento non %s%s%s."), (no_mod ? TR("modificabile"):""),
(no_mod && no_del ? " ne' ":""), (no_del ? "cancellabile":"")); (no_mod && no_del ? TR(" ne' "):""), (no_del ? TR("cancellabile"):""));
if (transaction) xvt_dm_popup_warning(msg);
{
TTimed_box box("Attenzione", msg, 5, DLG_OK, 32, 5);
box.add_button(DLG_OK, 0, "", -11, -1, 10, 2);
box.run();
}
else
warning_box(msg);
} }
} }
if (no_mod) if (no_mod)

View File

@ -6,6 +6,7 @@
#include <config.h> #include <config.h>
#include <defmask.h> #include <defmask.h>
#include <execp.h>
#include <modaut.h> #include <modaut.h>
#include <postman.h> #include <postman.h>
#include <printer.h> #include <printer.h>
@ -18,7 +19,7 @@
#include "ve1100.h" #include "ve1100.h"
#include <comuni.h> #include <comuni.h>
#include <NDITTE.h> #include <nditte.h>
#define LISTADOC "listadoc" #define LISTADOC "listadoc"
#define FAKETOTFLD 9999 #define FAKETOTFLD 9999
@ -197,7 +198,8 @@ TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva,
TFilename test(nomeform); test.ext("frm"); TFilename test(nomeform); test.ext("frm");
if (!test.custom_path()) if (!test.custom_path())
{ {
error_box(FR("Nome form di stampa '%s' non valido per il tipo documento %s"), (const char*)nomeform, (const char*)tipodoc); error_box(FR("Nome form di stampa '%s' non valido per il tipo documento '%s'"),
(const char*)nomeform, (const char*)tipodoc);
return; return;
} }
} }
@ -385,7 +387,7 @@ void TDocumento_form::print_documento()
_rdocfile->zero(); _rdocfile->zero();
TString80 desc(c.get("DESCCONAIASS")); TString80 desc(c.get("DESCCONAIASS"));
if (desc.empty()) if (desc.empty())
desc = "Contributo CONAI assolto"; desc = TR("Contributo CONAI assolto");
_rdocfile->put(RDOC_DESCR, desc); _rdocfile->put(RDOC_DESCR, desc);
body.update(); body.update();
const word h = body.height(); const word h = body.height();
@ -1262,6 +1264,7 @@ protected:
virtual behaviour on_module_change(const TString &, TString &); // funzione chiamata ad ogni cambio modulo durante la stampa virtual behaviour on_module_change(const TString &, TString &); // funzione chiamata ad ogni cambio modulo durante la stampa
virtual bool query_final_print(void); // funzione chiamata all'inizializzazione per sapere se la stampa è definitiva virtual bool query_final_print(void); // funzione chiamata all'inizializzazione per sapere se la stampa è definitiva
void set_filter(TDocumento_form& frm); void set_filter(TDocumento_form& frm);
static bool codnum_handler(TMask_field& f, KEY key);
static bool date2num_handler(TMask_field& f, KEY key); static bool date2num_handler(TMask_field& f, KEY key);
static bool range_handler(TMask_field& f, KEY key); static bool range_handler(TMask_field& f, KEY key);
static bool tipocf_handler (TMask_field& f, KEY k); static bool tipocf_handler (TMask_field& f, KEY k);
@ -1885,6 +1888,28 @@ bool TStampaDoc_application::range_handler(TMask_field& f, KEY key)
return rt; return rt;
} }
bool TStampaDoc_application::codnum_handler(TMask_field& f, KEY key)
{
bool ok = true;
if (key == K_TAB && !f.empty() && app().has_module(RSAUT))
{
const TCodice_numerazione& cn = cached_numerazione(f.get());
TFilename n;
for (int t = cn.ntipi_doc()-1; t >= 0; t--)
{
const TTipo_documento& td = cached_tipodoc(cn.tipo_doc(t));
if (td.main_print_profile(n, 2)) // Se esiste il .rep allora forse sto usando il programma errato
{
ok = yesno_box(FR("Il tipo documento %s richiede la stampa avanzata del report %s:\nSi desidera continuare ugualmente?"),
(const char*)td.codice(), (const char*)n.name());
if (!ok)
break;
}
}
}
return ok;
}
bool TStampaDoc_application::tipodoc_handler(TMask_field& f, KEY key) bool TStampaDoc_application::tipodoc_handler(TMask_field& f, KEY key)
{ {
TMask& m = f.mask(); TMask& m = f.mask();
@ -1892,19 +1917,16 @@ bool TStampaDoc_application::tipodoc_handler(TMask_field& f, KEY key)
{ {
case K_F9: //caso del bottone di selezione case K_F9: //caso del bottone di selezione
{ {
TArray_sheet as(-1,-1,70,20,TR("Tipi documento"),"Codice|Descrizione@50"); //costruisce uno sheet di selezione dei tipi doc TArray_sheet as(-1,-1,70,20,TR("Tipi documento"),HR("Codice|Descrizione@50")); //costruisce uno sheet di selezione dei tipi doc
const TRectype& recnum = cache().get("%NUM",m.get(101)); //cache sulla tabella numerazione documento con il numero doc immesso nella maschera
const TString80 s2 = recnum.get("S2"); //prende tutto il contenuto del campo S2 della tabella %NUM (numerazione docs) const TCodice_numerazione& cn = cached_numerazione(m.get(101));
for (int i = 0; i < s2.len(); i+=4) for (int t = cn.ntipi_doc()-1; t >= 0; t--)
{ {
const TString4 tipodoc = s2.mid(i,4); //si va di 4 in 4, x' cosi' sono ordinati i tipidoc nel campo S2 const TString4 tipodoc = cn.tipo_doc(t);
if (!tipodoc.blank()) //ovviamente si procede solo se il tipodoc esiste TToken_string row; //classica token_string con codice e descrizione del tipodoc: questa viene scelta nella tabella
{ row.add(tipodoc); //dei tipi docs %TIP
TToken_string row; //classica token_string con codice e descrizione del tipodoc: questa viene scelta nella tabella row.add(cache().get("%TIP", tipodoc, "S0"));
row.add(tipodoc); //dei tipi docs %TIP as.add(row); //..e viene aggiunta allo sheet di selezione
row.add(cache().get("%TIP", tipodoc, "S0"));
as.add(row); //..e viene aggiunta allo sheet di selezione
}
} }
if (as.run() != K_ESC) if (as.run() != K_ESC)
{ {
@ -1916,16 +1938,14 @@ bool TStampaDoc_application::tipodoc_handler(TMask_field& f, KEY key)
case K_ENTER: //caso del bottone invio; + o - come sopra; deve xo' verificare che l'eventuale codice di tipodoc digitato case K_ENTER: //caso del bottone invio; + o - come sopra; deve xo' verificare che l'eventuale codice di tipodoc digitato
if (!f.empty()) //sia valido (esista nel campo S2 della tabella NUM) if (!f.empty()) //sia valido (esista nel campo S2 della tabella NUM)
{ {
const TRectype& recnum = cache().get("%NUM",m.get(101)); const TCodice_numerazione& cn = cached_numerazione(m.get(101));
const TString80 s2 = recnum.get("S2"); for (int t = cn.ntipi_doc()-1; t >= 0; t--)
for (int i = 0; i < s2.len(); i+=4)
{ {
TString4 tipodoc = s2.mid(i,4); const TString& tipodoc = cn.tipo_doc(t);
tipodoc.trim();
if (tipodoc == f.get()) if (tipodoc == f.get())
return true; return true;
} }
return f.error_box(FR("Tipo documento non valido per la numerazione %s"), (const char*)m.get(101)); return f.error_box(FR("Tipo documento non valido per la numerazione %s"), (const char*)cn.codice());
} }
break; break;
@ -1941,7 +1961,7 @@ bool TStampaDoc_application::tipodoc_handler(TMask_field& f, KEY key)
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
bool TStampaDoc_application::filter_clifo(const TRelation* r) bool TStampaDoc_application::filter_clifo(const TRelation* r)
{ {
const long codcf = r->lfile().get_long(CLI_CODCF); const long codcf = r->curr().get_long(CLI_CODCF);
TString8 key; key.format("%06ld", codcf); TString8 key; key.format("%06ld", codcf);
return app()._clifo_sel.is_key(key); return app()._clifo_sel.is_key(key);
} }
@ -1987,6 +2007,7 @@ bool TStampaDoc_application::create()
if (!_is_lista) if (!_is_lista)
{ {
_clifo_sheet = NULL; _clifo_sheet = NULL;
_selection_mask->set_handler(F_CODNUM, codnum_handler);
_selection_mask->set_handler(F_DA_DATADOC, date2num_handler); _selection_mask->set_handler(F_DA_DATADOC, date2num_handler);
_selection_mask->set_handler(F_A_DATADOC, date2num_handler); _selection_mask->set_handler(F_A_DATADOC, date2num_handler);
_selection_mask->set_handler(F_A_NDOC, range_handler); _selection_mask->set_handler(F_A_NDOC, range_handler);

View File

@ -1103,15 +1103,7 @@ bool TReport_doc_app::print_loop(const TString& query, TOutput_mode mode)
else else
{ {
TString msg; msg << TR("Report inesistente: ") << profilo; TString msg; msg << TR("Report inesistente: ") << profilo;
#ifdef xvt_dm_post_error xvt_dm_post_error(msg);
if (is_power_version())
xvt_dm_post_error(msg);
else
#endif
{
statbar_set_title(TASK_WIN, msg);
beep(2);
}
continue; continue;
} }

View File

@ -803,14 +803,14 @@ class TPrice_sheet : public TArray_sheet
protected: protected:
virtual bool get_ini_paragraph(const TEdit_field& f, TString& name) const; virtual bool get_ini_paragraph(const TEdit_field& f, TString& name) const;
virtual void handler(WINDOW win, EVENT* ep); virtual long handler(WINDOW win, EVENT* ep);
TEdit_field& field() { return _fld; } TEdit_field& field() { return _fld; }
public: public:
TPrice_sheet(TEdit_field& f); TPrice_sheet(TEdit_field& f);
}; };
void TPrice_sheet::handler(WINDOW win, EVENT* ep) long TPrice_sheet::handler(WINDOW win, EVENT* ep)
{ {
if (ep->type == E_MOUSE_DOWN) if (ep->type == E_MOUSE_DOWN)
{ {
@ -834,7 +834,7 @@ void TPrice_sheet::handler(WINDOW win, EVENT* ep)
xvt_menu_popup(menu->child, win, p, pa, NULL); xvt_menu_popup(menu->child, win, p, pa, NULL);
xvt_res_free_menu_tree(menu); xvt_res_free_menu_tree(menu);
} }
return; return 0;
} }
break; break;
default: default:
@ -848,19 +848,19 @@ void TPrice_sheet::handler(WINDOW win, EVENT* ep)
{ {
case BROWSE_BAR + 1: case BROWSE_BAR + 1:
save_columns_order(field()); save_columns_order(field());
return; return 0;
case BROWSE_BAR + 2: case BROWSE_BAR + 2:
set_columns_order(NULL); set_columns_order(NULL);
return; return 0;
case BROWSE_BAR + 3: case BROWSE_BAR + 3:
fld(0).on_key(K_F11); fld(0).on_key(K_F11);
return; return 0;
default: default:
break; break;
} }
} }
TArray_sheet::handler(win, ep); return TArray_sheet::handler(win, ep);
} }
bool TPrice_sheet::get_ini_paragraph(const TEdit_field& field, TString& parag) const bool TPrice_sheet::get_ini_paragraph(const TEdit_field& field, TString& parag) const