Patch level : 2.0 nopatch
Files correlati : printapp con bottone di "Collega" Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@11555 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fedfd15ab1
commit
69f4663a88
@ -85,7 +85,7 @@ TInfo_mask::TInfo_mask()
|
||||
arg.trim(); arg.lower();
|
||||
|
||||
TConfig campoini(CONFIG_INSTALL, "Main");
|
||||
TConfig userini(CONFIG_USER, "Printer");
|
||||
TConfig userini(CONFIG_GUI, "Printer");
|
||||
|
||||
TString prot;
|
||||
switch (dongle().hardware())
|
||||
|
@ -4534,7 +4534,10 @@ void TForm::read(
|
||||
TFilename n(_name); n.ext("frm");
|
||||
n.custom_path();
|
||||
if (n.exist())
|
||||
{
|
||||
_filename = n;
|
||||
printer().set_form_name(n);
|
||||
}
|
||||
else
|
||||
fatal_box("Il form '%s' non esiste.",(const char*)n);
|
||||
TScanner scanner(n);
|
||||
|
@ -316,7 +316,7 @@ bool get_relapp(int logicnum, TString& app)
|
||||
ini.for_each_paragraph(find_relapp, &fi);
|
||||
if (fi._app.not_empty())
|
||||
app = fi._app;
|
||||
return fi._app.not_empty();
|
||||
return app.not_empty();
|
||||
}
|
||||
|
||||
struct TCallbackTableinfo
|
||||
@ -368,6 +368,7 @@ bool get_tabapp(const char * tabname, TString& app)
|
||||
app = fi._tabapp;
|
||||
if (app.empty())
|
||||
app = fi._relapp;
|
||||
|
||||
if (app.empty())
|
||||
{
|
||||
app = "ba3 -0";
|
||||
@ -3491,7 +3492,7 @@ bool TRectype::get_relapp(TString& app) const
|
||||
return ::get_relapp(num(), app);
|
||||
}
|
||||
|
||||
bool TRectype::edit(int logicnum, const char * alternate_key_fields) const
|
||||
bool TRectype::edit(int logicnum, const char* alternate_key_fields, const char* hint) const
|
||||
{
|
||||
bool ok = false;
|
||||
if (logicnum <= 0)
|
||||
@ -3501,8 +3502,10 @@ bool TRectype::edit(int logicnum, const char * alternate_key_fields) const
|
||||
if (*_tab)
|
||||
r.settab(_tab);
|
||||
|
||||
TString app;
|
||||
if (r.get_relapp(app))
|
||||
TString app = hint;
|
||||
if (app.empty())
|
||||
r.get_relapp(app);
|
||||
if (app.not_empty())
|
||||
{
|
||||
const RecDes* recd = r.rec_des(); // Descrizione del record della testata
|
||||
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
|
||||
@ -3536,6 +3539,14 @@ bool TRectype::edit(int logicnum, const char * alternate_key_fields) const
|
||||
app << " -i" << ininame;
|
||||
TExternal_app a(app);
|
||||
ok = a.run() == 0;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
TConfig ini(ininame, "Transaction");
|
||||
const TString& result = ini.get("Result");
|
||||
ok = result == "OK";
|
||||
}
|
||||
|
||||
xvt_fsys_removefile(ininame);
|
||||
|
||||
if (ok)
|
||||
|
@ -252,7 +252,7 @@ public:
|
||||
|
||||
// @cmember Ritorna la relapp che gestisce il file
|
||||
virtual bool get_relapp(TString& app) const;
|
||||
virtual bool edit(int logicnum = 0, const char * alternate_key_fields = NULL) const;
|
||||
virtual bool edit(int logicnum = 0, const char * alternate_key_fields = NULL, const char* hint = NULL) const;
|
||||
|
||||
// @cmember Inizializza un record staccato da un file.
|
||||
void init(int logicnum);
|
||||
|
@ -321,10 +321,10 @@ void TPrint_application::set_multiple_link (
|
||||
printer().setmultiplelink (on);
|
||||
}
|
||||
|
||||
void TPrint_application::_pp_link (int id, const char *text)
|
||||
bool TPrint_application::_pp_link (int id, const char *text)
|
||||
{
|
||||
TPrint_application& prapp = (TPrint_application&)main_app();
|
||||
prapp.process_link(id, text);
|
||||
return prapp.process_link(id, text);
|
||||
}
|
||||
|
||||
void TPrint_application::_pp_header (TPrinter& p)
|
||||
|
@ -219,7 +219,7 @@ protected:
|
||||
// @cmember:(INTERNAL) Metahandlers per controllare i links quando si usa la
|
||||
// <c TViswin>; servono per controllare handlers di altre classi e chiamano
|
||||
// virtuali di <c TPrintapp>.
|
||||
static void _pp_link(int id, const char* s);
|
||||
static bool _pp_link(int id, const char* s);
|
||||
|
||||
// @cmember:(INTERNAL) Cerca per il nodo <p head> dove agganciarsi per rispettare la relazione
|
||||
link_item* _look_print_node(link_item* head, int logicnum);
|
||||
@ -273,12 +273,12 @@ protected:
|
||||
{}
|
||||
// @cmember Chiamata quando viene premuto il bottone Collega con la selezione attiva nella
|
||||
// finestra di anteprima
|
||||
virtual void process_link(int id, const char* text)
|
||||
{}
|
||||
virtual bool process_link(int id, const char* text)
|
||||
{ return false; }
|
||||
// @cmember Chiamata quando l'utente annulla la stampa. Ritornando TRUE viene immediata fermata
|
||||
// la stampa. Non viene chaimata nel caso non si voglia interrompere la stampa
|
||||
virtual bool cancel_hook()
|
||||
{return TRUE;}
|
||||
{return true;}
|
||||
|
||||
// @cmember Legata al menu' di stampa della <c TApplication>. Viene ridefinita solo in casi
|
||||
// particolari
|
||||
|
@ -172,7 +172,8 @@ typedef void (*PRINTSECTIONHANDLER)(TPrinter& printer);
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @type LINKHANDLER | Prototipo funzione definita dall'utente per la gestione del link
|
||||
typedef void (*LINKHANDLER)(int, const char*);
|
||||
// Ritorna true se e' necessario ripetere la stampa
|
||||
typedef bool (*LINKHANDLER)(int, const char*);
|
||||
|
||||
|
||||
class TViswin;
|
||||
|
@ -215,29 +215,28 @@ void TViswin::exec_link()
|
||||
}
|
||||
else
|
||||
{
|
||||
bool reload = false;
|
||||
LINKHANDLER pl = printer().getlinkhandler();
|
||||
if (pl)
|
||||
pl(_linkID, _multiple ? (const char*)_multiple_link :
|
||||
(const char*)_linktxt);
|
||||
// dai opzione per rifare la stampa se e' arrivato un messaggio
|
||||
// dall'applicazione chiamata
|
||||
// schiaffa indi il tutto in una funzione
|
||||
TMailbox m;
|
||||
if (m.next_s(MSG_LN) != NULL)
|
||||
{
|
||||
if (main_app().class_id() == CLASS_PRINT_APPLICATION)
|
||||
{
|
||||
if (yesno_box("Si desidera riaggiornare la stampa?"))
|
||||
{
|
||||
TPrint_application& papp = (TPrint_application&)main_app();
|
||||
papp.repeat_print();
|
||||
// papp.current_cursor()->freeze(FALSE);
|
||||
papp.current_cursor()->update();
|
||||
xvt_statbar_refresh ();
|
||||
stop_run(K_ENTER);
|
||||
}
|
||||
reload = pl(_linkID, _multiple ? (const char*)_multiple_link : (const char*)_linktxt);
|
||||
|
||||
if (main_app().class_id() == CLASS_PRINT_APPLICATION)
|
||||
{
|
||||
if (!reload)
|
||||
{ // Backward compatibility mode
|
||||
// dai opzione per rifare la stampa se e' arrivato un messaggio dall'applicazione chiamata
|
||||
TMailbox m;
|
||||
reload = m.next_s(MSG_LN) != NULL;
|
||||
}
|
||||
}
|
||||
if (reload && yesno_box(TR("Si desidera riaggiornare la stampa?")))
|
||||
{
|
||||
TPrint_application& papp = (TPrint_application&)main_app();
|
||||
papp.repeat_print();
|
||||
papp.current_cursor()->update();
|
||||
xvt_statbar_refresh ();
|
||||
stop_run(K_ENTER);
|
||||
}
|
||||
}
|
||||
} // _toplevel
|
||||
if (_toplevel)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user