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();
|
arg.trim(); arg.lower();
|
||||||
|
|
||||||
TConfig campoini(CONFIG_INSTALL, "Main");
|
TConfig campoini(CONFIG_INSTALL, "Main");
|
||||||
TConfig userini(CONFIG_USER, "Printer");
|
TConfig userini(CONFIG_GUI, "Printer");
|
||||||
|
|
||||||
TString prot;
|
TString prot;
|
||||||
switch (dongle().hardware())
|
switch (dongle().hardware())
|
||||||
|
@ -4534,7 +4534,10 @@ void TForm::read(
|
|||||||
TFilename n(_name); n.ext("frm");
|
TFilename n(_name); n.ext("frm");
|
||||||
n.custom_path();
|
n.custom_path();
|
||||||
if (n.exist())
|
if (n.exist())
|
||||||
|
{
|
||||||
_filename = n;
|
_filename = n;
|
||||||
|
printer().set_form_name(n);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fatal_box("Il form '%s' non esiste.",(const char*)n);
|
fatal_box("Il form '%s' non esiste.",(const char*)n);
|
||||||
TScanner scanner(n);
|
TScanner scanner(n);
|
||||||
|
@ -316,7 +316,7 @@ bool get_relapp(int logicnum, TString& app)
|
|||||||
ini.for_each_paragraph(find_relapp, &fi);
|
ini.for_each_paragraph(find_relapp, &fi);
|
||||||
if (fi._app.not_empty())
|
if (fi._app.not_empty())
|
||||||
app = fi._app;
|
app = fi._app;
|
||||||
return fi._app.not_empty();
|
return app.not_empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TCallbackTableinfo
|
struct TCallbackTableinfo
|
||||||
@ -368,6 +368,7 @@ bool get_tabapp(const char * tabname, TString& app)
|
|||||||
app = fi._tabapp;
|
app = fi._tabapp;
|
||||||
if (app.empty())
|
if (app.empty())
|
||||||
app = fi._relapp;
|
app = fi._relapp;
|
||||||
|
|
||||||
if (app.empty())
|
if (app.empty())
|
||||||
{
|
{
|
||||||
app = "ba3 -0";
|
app = "ba3 -0";
|
||||||
@ -3491,7 +3492,7 @@ bool TRectype::get_relapp(TString& app) const
|
|||||||
return ::get_relapp(num(), app);
|
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;
|
bool ok = false;
|
||||||
if (logicnum <= 0)
|
if (logicnum <= 0)
|
||||||
@ -3501,8 +3502,10 @@ bool TRectype::edit(int logicnum, const char * alternate_key_fields) const
|
|||||||
if (*_tab)
|
if (*_tab)
|
||||||
r.settab(_tab);
|
r.settab(_tab);
|
||||||
|
|
||||||
TString app;
|
TString app = hint;
|
||||||
if (r.get_relapp(app))
|
if (app.empty())
|
||||||
|
r.get_relapp(app);
|
||||||
|
if (app.not_empty())
|
||||||
{
|
{
|
||||||
const RecDes* recd = r.rec_des(); // Descrizione del record della testata
|
const RecDes* recd = r.rec_des(); // Descrizione del record della testata
|
||||||
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
|
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;
|
app << " -i" << ininame;
|
||||||
TExternal_app a(app);
|
TExternal_app a(app);
|
||||||
ok = a.run() == 0;
|
ok = a.run() == 0;
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
TConfig ini(ininame, "Transaction");
|
||||||
|
const TString& result = ini.get("Result");
|
||||||
|
ok = result == "OK";
|
||||||
|
}
|
||||||
|
|
||||||
xvt_fsys_removefile(ininame);
|
xvt_fsys_removefile(ininame);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
|
@ -252,7 +252,7 @@ public:
|
|||||||
|
|
||||||
// @cmember Ritorna la relapp che gestisce il file
|
// @cmember Ritorna la relapp che gestisce il file
|
||||||
virtual bool get_relapp(TString& app) const;
|
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.
|
// @cmember Inizializza un record staccato da un file.
|
||||||
void init(int logicnum);
|
void init(int logicnum);
|
||||||
|
@ -321,10 +321,10 @@ void TPrint_application::set_multiple_link (
|
|||||||
printer().setmultiplelink (on);
|
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();
|
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)
|
void TPrint_application::_pp_header (TPrinter& p)
|
||||||
|
@ -219,7 +219,7 @@ protected:
|
|||||||
// @cmember:(INTERNAL) Metahandlers per controllare i links quando si usa la
|
// @cmember:(INTERNAL) Metahandlers per controllare i links quando si usa la
|
||||||
// <c TViswin>; servono per controllare handlers di altre classi e chiamano
|
// <c TViswin>; servono per controllare handlers di altre classi e chiamano
|
||||||
// virtuali di <c TPrintapp>.
|
// 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
|
// @cmember:(INTERNAL) Cerca per il nodo <p head> dove agganciarsi per rispettare la relazione
|
||||||
link_item* _look_print_node(link_item* head, int logicnum);
|
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
|
// @cmember Chiamata quando viene premuto il bottone Collega con la selezione attiva nella
|
||||||
// finestra di anteprima
|
// 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
|
// @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
|
// la stampa. Non viene chaimata nel caso non si voglia interrompere la stampa
|
||||||
virtual bool cancel_hook()
|
virtual bool cancel_hook()
|
||||||
{return TRUE;}
|
{return true;}
|
||||||
|
|
||||||
// @cmember Legata al menu' di stampa della <c TApplication>. Viene ridefinita solo in casi
|
// @cmember Legata al menu' di stampa della <c TApplication>. Viene ridefinita solo in casi
|
||||||
// particolari
|
// particolari
|
||||||
|
@ -172,7 +172,8 @@ typedef void (*PRINTSECTIONHANDLER)(TPrinter& printer);
|
|||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @type LINKHANDLER | Prototipo funzione definita dall'utente per la gestione del link
|
// @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;
|
class TViswin;
|
||||||
|
@ -215,27 +215,26 @@ void TViswin::exec_link()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
bool reload = false;
|
||||||
LINKHANDLER pl = printer().getlinkhandler();
|
LINKHANDLER pl = printer().getlinkhandler();
|
||||||
if (pl)
|
if (pl)
|
||||||
pl(_linkID, _multiple ? (const char*)_multiple_link :
|
reload = pl(_linkID, _multiple ? (const char*)_multiple_link : (const char*)_linktxt);
|
||||||
(const char*)_linktxt);
|
|
||||||
// dai opzione per rifare la stampa se e' arrivato un messaggio
|
if (main_app().class_id() == CLASS_PRINT_APPLICATION)
|
||||||
// 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 (!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?")))
|
||||||
{
|
{
|
||||||
if (yesno_box("Si desidera riaggiornare la stampa?"))
|
TPrint_application& papp = (TPrint_application&)main_app();
|
||||||
{
|
papp.repeat_print();
|
||||||
TPrint_application& papp = (TPrint_application&)main_app();
|
papp.current_cursor()->update();
|
||||||
papp.repeat_print();
|
xvt_statbar_refresh ();
|
||||||
// papp.current_cursor()->freeze(FALSE);
|
stop_run(K_ENTER);
|
||||||
papp.current_cursor()->update();
|
|
||||||
xvt_statbar_refresh ();
|
|
||||||
stop_run(K_ENTER);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // _toplevel
|
} // _toplevel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user