Patch level : 10.0 508
Files correlati : ba0 ve1 bagn001a.msk Ricompilazione Demo : [ ] Commento : Aggiunta possibilita' di forzare l'uso della stampante di default git-svn-id: svn://10.65.10.50/trunk@19614 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5e9a8a3cbe
commit
334fa27728
@ -376,6 +376,9 @@ TInfo_mask::TInfo_mask() : TProperty_sheet(TR("Informazioni"))
|
|||||||
add_prop(TR("Libreria GUI"), strwx);
|
add_prop(TR("Libreria GUI"), strwx);
|
||||||
add_prop(TR("Libreria PDF"), printer);
|
add_prop(TR("Libreria PDF"), printer);
|
||||||
add_prop(TR("Libreria SQL"), strsql);
|
add_prop(TR("Libreria SQL"), strsql);
|
||||||
|
#ifdef WIN32
|
||||||
|
add_prop(TR("Libreria C++"), format("%d %d.%d", _MSC_VER/100, _MSC_VER%100/10, _MSC_VER%10));
|
||||||
|
#endif
|
||||||
|
|
||||||
set_read_only();
|
set_read_only();
|
||||||
freeze(false);
|
freeze(false);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#define MSK_TYPE 101
|
#define MSK_TYPE 101
|
||||||
#define MSK_FILENAME 102
|
#define MSK_FILENAME 102
|
||||||
#define MSK_PRINTERS 103
|
#define MSK_PRINTERS 103
|
||||||
|
#define MSK_DEFAULT 104
|
||||||
#define MSK_ORIENTATION 333
|
#define MSK_ORIENTATION 333
|
||||||
#define MSK_ISGRAPHICS 334
|
#define MSK_ISGRAPHICS 334
|
||||||
#define MSK_SIZE 335
|
#define MSK_SIZE 335
|
||||||
|
@ -1,56 +1,69 @@
|
|||||||
#include <bagn001a.h>
|
#include <bagn001a.h>
|
||||||
|
|
||||||
PAGE "Impostazione Stampante" -1 -1 78 9
|
PAGE "Impostazione Stampante" -1 -1 78 11
|
||||||
|
|
||||||
RADIOBUTTON MSK_TYPE 1 76
|
RADIOBUTTON MSK_TYPE 1 76
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 0 "@bStampa su..."
|
PROMPT 1 0 "@bStampa su..."
|
||||||
ITEM "0|Stampante"
|
ITEM "0|Stampante"
|
||||||
MESSAGE SHOW,MSK_PRINTERS|HIDE,MSK_FILENAME
|
MESSAGE SHOW,1@|HIDE,2@
|
||||||
ITEM "2|Visualizzazione"
|
ITEM "2|Visualizzazione"
|
||||||
MESSAGE SHOW,MSK_PRINTERS|HIDE,MSK_FILENAME
|
MESSAGE SHOW,1@|HIDE,2@
|
||||||
ITEM "1|File su disco"
|
ITEM "1|File su disco"
|
||||||
MESSAGE HIDE,MSK_PRINTERS|SHOW,MSK_FILENAME
|
MESSAGE HIDE,1@|SHOW,2@
|
||||||
ITEM "4|Acrobat"
|
ITEM "4|Acrobat"
|
||||||
MESSAGE SHOW,MSK_PRINTERS|HIDE,MSK_FILENAME
|
MESSAGE SHOW,1@|HIDE,2@
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN MSK_DEFAULT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Utilizzare sempre la stampante predefinita di sistema"
|
||||||
|
MESSAGE FALSE ENABLE,MSK_PRINTERS
|
||||||
|
MESSAGE TRUE DISABLE,MSK_PRINTERS
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
LIST MSK_PRINTERS 64
|
LIST MSK_PRINTERS 64
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 3 "Stampante "
|
PROMPT 1 4 "Stampante "
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING MSK_FILENAME 256 68
|
STRING MSK_FILENAME 256 68
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 3 "File "
|
PROMPT 1 4 "File "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
VALIDATE FILENAME_FUNC
|
VALIDATE FILENAME_FUNC
|
||||||
DSELECT
|
DSELECT
|
||||||
FLAGS "AM"
|
FLAGS "AM"
|
||||||
WARNING "E' necessario specificare un nome di file"
|
WARNING "E' necessario specificare un nome di file"
|
||||||
|
GROUP 2
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 42 5
|
GROUPBOX DLG_NULL 42 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 4 "@bCarattere standard"
|
PROMPT 1 5 "@bCarattere standard"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST MSK_FONT 32
|
LIST MSK_FONT 32
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Font "
|
PROMPT 2 6 "Font "
|
||||||
ITEM "Courier|Courier"
|
ITEM "Courier|Courier"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST MSK_SIZE 3
|
LIST MSK_SIZE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Dimensioni carattere "
|
PROMPT 2 7 "Dimensioni carattere "
|
||||||
ITEM "10|10"
|
ITEM "10|10"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST MSK_LINES 3
|
LIST MSK_LINES 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 7 "Linee per pollice "
|
PROMPT 2 8 "Linee per pollice "
|
||||||
ITEM "4|4"
|
ITEM "4|4"
|
||||||
ITEM "5|5"
|
ITEM "5|5"
|
||||||
ITEM "6|6"
|
ITEM "6|6"
|
||||||
@ -58,23 +71,27 @@ BEGIN
|
|||||||
ITEM "8|8"
|
ITEM "8|8"
|
||||||
ITEM "9|9"
|
ITEM "9|9"
|
||||||
ITEM "10|10"
|
ITEM "10|10"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 33 5
|
GROUPBOX DLG_NULL 33 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 44 4 "@bParametri di stampa"
|
PROMPT 44 5 "@bParametri di stampa"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
RADIOBUTTON MSK_ORIENTATION 1 30
|
RADIOBUTTON MSK_ORIENTATION 1 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 45 4 ""
|
PROMPT 45 5 ""
|
||||||
ITEM "1|Foglio verticale"
|
ITEM "1|Foglio verticale"
|
||||||
ITEM "2|Foglio orizzontale"
|
ITEM "2|Foglio orizzontale"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN MSK_ISGRAPHICS
|
BOOLEAN MSK_ISGRAPHICS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 46 7 "Elementi grafici"
|
PROMPT 46 8 "Elementi grafici"
|
||||||
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -5,13 +5,10 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __OBJECT_H
|
|
||||||
#include <object.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __STRINGS_H
|
#ifndef __STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TImage
|
// TImage
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -128,6 +128,16 @@ bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, lon
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
switch (o.dlg())
|
switch (o.dlg())
|
||||||
{
|
{
|
||||||
|
case MSK_DEFAULT:
|
||||||
|
if (fe_modify)
|
||||||
|
{
|
||||||
|
if (o.get().full())
|
||||||
|
{
|
||||||
|
set_print_rcd(NULL, 0);
|
||||||
|
set(MSK_PRINTERS, _pdev, 0x1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MSK_PRINTERS:
|
case MSK_PRINTERS:
|
||||||
if (fe_modify)
|
if (fe_modify)
|
||||||
{
|
{
|
||||||
@ -205,7 +215,7 @@ bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, lon
|
|||||||
}
|
}
|
||||||
|
|
||||||
TPrinter_setup_mask::TPrinter_setup_mask()
|
TPrinter_setup_mask::TPrinter_setup_mask()
|
||||||
: TAutomask("bagn001a"), _pcd(NULL), _pcd_size(0), _pcd_owned(false)
|
: TAutomask("bagn001a"), _pcd(NULL), _pcd_size(0), _pcd_owned(false), _pdev(128)
|
||||||
{
|
{
|
||||||
TPrinter& pr = printer();
|
TPrinter& pr = printer();
|
||||||
set(MSK_FILENAME, pr.get_printerfile());
|
set(MSK_FILENAME, pr.get_printerfile());
|
||||||
@ -213,6 +223,9 @@ TPrinter_setup_mask::TPrinter_setup_mask()
|
|||||||
const bool can_save = pr._config == "Printer";
|
const bool can_save = pr._config == "Printer";
|
||||||
enable(DLG_OK, can_save);
|
enable(DLG_OK, can_save);
|
||||||
|
|
||||||
|
if (pr.forced_default_printer())
|
||||||
|
set_print_rcd(NULL, 0);
|
||||||
|
else
|
||||||
set_print_rcd(pr._print_rcd, pr._print_rcd_size);
|
set_print_rcd(pr._print_rcd, pr._print_rcd_size);
|
||||||
|
|
||||||
// Crea la lista delle stampanti
|
// Crea la lista delle stampanti
|
||||||
@ -239,7 +252,7 @@ TPrinter_setup_mask::TPrinter_setup_mask()
|
|||||||
|
|
||||||
TList_field& plst = lfield (MSK_PRINTERS);
|
TList_field& plst = lfield (MSK_PRINTERS);
|
||||||
plst.replace_items(pn2, pn2); // Genera printer list
|
plst.replace_items(pn2, pn2); // Genera printer list
|
||||||
set(MSK_PRINTERS, pr._prname);
|
set(MSK_PRINTERS, _pdev);
|
||||||
|
|
||||||
_font = pr._fontname;
|
_font = pr._fontname;
|
||||||
fill_font_list();
|
fill_font_list();
|
||||||
@ -250,6 +263,7 @@ TPrinter_setup_mask::TPrinter_setup_mask()
|
|||||||
set(MSK_LINES, pr._lines_per_inch);
|
set(MSK_LINES, pr._lines_per_inch);
|
||||||
|
|
||||||
set(MSK_ISGRAPHICS, pr.isgraphics() ? "X" : "");
|
set(MSK_ISGRAPHICS, pr.isgraphics() ? "X" : "");
|
||||||
|
set(MSK_DEFAULT, pr.forced_default_printer() ? "X" : "");
|
||||||
|
|
||||||
TButton_tool& sp = (TButton_tool&)field(DLG_SETPRINT);
|
TButton_tool& sp = (TButton_tool&)field(DLG_SETPRINT);
|
||||||
sp.set_exit_key(0); // Evita chiamate ricorsive all'impostazione stampante
|
sp.set_exit_key(0); // Evita chiamate ricorsive all'impostazione stampante
|
||||||
@ -1188,7 +1202,7 @@ void TPrinter::set_printrcd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
if (_prname.not_empty())
|
if (_prname.full())
|
||||||
{
|
{
|
||||||
_print_rcd = xvt_print_create_by_name(&_print_rcd_size, _prname);
|
_print_rcd = xvt_print_create_by_name(&_print_rcd_size, _prname);
|
||||||
ok = xvt_print_is_valid(_print_rcd) != 0;
|
ok = xvt_print_is_valid(_print_rcd) != 0;
|
||||||
@ -1306,7 +1320,7 @@ void TPrinter::read_configuration(
|
|||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
|
|
||||||
_config = parag; // Inizializza nome configurazione
|
_config = parag; // Inizializza nome configurazione
|
||||||
if (_config.empty()) // Se non specificata ...
|
if (_config.blank()) // Se non specificata ...
|
||||||
_config = "Printer"; // ... usa configurazione standard
|
_config = "Printer"; // ... usa configurazione standard
|
||||||
|
|
||||||
TConfig* iniptr = NULL;
|
TConfig* iniptr = NULL;
|
||||||
@ -1329,11 +1343,14 @@ void TPrinter::read_configuration(
|
|||||||
_ch_size = iniptr->get_int("Size", NULL, -1, 10); // Dimensione del font
|
_ch_size = iniptr->get_int("Size", NULL, -1, 10); // Dimensione del font
|
||||||
_lines_per_inch = iniptr->get_int("Lines", NULL, -1, 6); // Linee per pollice
|
_lines_per_inch = iniptr->get_int("Lines", NULL, -1, 6); // Linee per pollice
|
||||||
set_graphics(iniptr->get_bool("Graphic", NULL, -1, true)); // Grafica attiva
|
set_graphics(iniptr->get_bool("Graphic", NULL, -1, true)); // Grafica attiva
|
||||||
|
_force_default = iniptr->get_bool("Default", NULL, -1, false); // Forza stampante di default
|
||||||
|
|
||||||
bool read_rcd = false;
|
bool read_rcd = false;
|
||||||
|
|
||||||
|
if (_prname.full() && !forced_default_printer())
|
||||||
|
{
|
||||||
const TString& host = iniptr->get("Host");
|
const TString& host = iniptr->get("Host");
|
||||||
if (host.not_empty())
|
if (host.full())
|
||||||
{
|
{
|
||||||
char hostname[256];
|
char hostname[256];
|
||||||
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
||||||
@ -1350,6 +1367,7 @@ void TPrinter::read_configuration(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (read_rcd)
|
if (read_rcd)
|
||||||
{
|
{
|
||||||
@ -1389,6 +1407,10 @@ void TPrinter::read_configuration(
|
|||||||
set_printrcd();
|
set_printrcd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_printrcd();
|
||||||
|
}
|
||||||
|
|
||||||
delete iniptr; iniptr = NULL;
|
delete iniptr; iniptr = NULL;
|
||||||
|
|
||||||
@ -1411,7 +1433,6 @@ void TPrinter::read_configuration(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TPrinter::save_configuration(const char* para)
|
void TPrinter::save_configuration(const char* para)
|
||||||
{
|
{
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
@ -1428,6 +1449,7 @@ void TPrinter::save_configuration(const char* para)
|
|||||||
prini.set("Size", _ch_size); // Dimensione del font
|
prini.set("Size", _ch_size); // Dimensione del font
|
||||||
prini.set("Lines", _lines_per_inch); // Linee per pollice
|
prini.set("Lines", _lines_per_inch); // Linee per pollice
|
||||||
prini.set("Graphic", _isgraphics ? "X" : ""); // Grafica attiva
|
prini.set("Graphic", _isgraphics ? "X" : ""); // Grafica attiva
|
||||||
|
prini.set("Default", _force_default ? "X" : ""); // Forza stampante default
|
||||||
|
|
||||||
char hostname[256];
|
char hostname[256];
|
||||||
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
||||||
@ -1810,7 +1832,7 @@ bool TPrinter::set()
|
|||||||
{
|
{
|
||||||
_manual_setup = true;
|
_manual_setup = true;
|
||||||
_print_rcd = mask.get_print_rcd(_print_rcd_size);
|
_print_rcd = mask.get_print_rcd(_print_rcd_size);
|
||||||
xvt_print_get_name(_print_rcd, _prname.get_buffer(80), 80);
|
xvt_print_get_name(_print_rcd, _prname.get_buffer(128), 128);
|
||||||
|
|
||||||
switch (mask.get_int(MSK_TYPE))
|
switch (mask.get_int(MSK_TYPE))
|
||||||
{
|
{
|
||||||
@ -1833,6 +1855,7 @@ bool TPrinter::set()
|
|||||||
|
|
||||||
_lines_per_inch = mask.get_int (MSK_LINES);
|
_lines_per_inch = mask.get_int (MSK_LINES);
|
||||||
_isgraphics = mask.get_bool (MSK_ISGRAPHICS);
|
_isgraphics = mask.get_bool (MSK_ISGRAPHICS);
|
||||||
|
_force_default = mask.get_bool(MSK_DEFAULT);
|
||||||
init_formlen ();
|
init_formlen ();
|
||||||
|
|
||||||
if (k == K_INS)
|
if (k == K_INS)
|
||||||
|
@ -272,9 +272,11 @@ class TPrinter : public TObject
|
|||||||
int _c_offset;
|
int _c_offset;
|
||||||
// @cmember:(INTERNAL) Definizione dell stampa in punti per linea
|
// @cmember:(INTERNAL) Definizione dell stampa in punti per linea
|
||||||
int _dots_per_line;
|
int _dots_per_line;
|
||||||
|
// @cmember:(INTERNAL) Forza stampante di default
|
||||||
|
bool _force_default;
|
||||||
|
|
||||||
// @cmember:(INTERNAL) Setta <p t> con il profilo della stampante
|
// @cmember:(INTERNAL) Setta <p t> con il profilo della stampante
|
||||||
void _get_windows_printer_names(TToken_string& t);
|
//void _get_windows_printer_names(TToken_string& t);
|
||||||
// @cmember:(INTERNAL) Indica se occorre esportare l'header di stampa
|
// @cmember:(INTERNAL) Indica se occorre esportare l'header di stampa
|
||||||
bool _export_header;
|
bool _export_header;
|
||||||
// @cmember:(INTERNAL) Lunghezza dell'header di stampa da esportare
|
// @cmember:(INTERNAL) Lunghezza dell'header di stampa da esportare
|
||||||
@ -631,6 +633,9 @@ public:
|
|||||||
bool is_portrait() const { return !is_landscape(); }
|
bool is_portrait() const { return !is_landscape(); }
|
||||||
|
|
||||||
bool manual_setup() const { return _manual_setup; }
|
bool manual_setup() const { return _manual_setup; }
|
||||||
|
|
||||||
|
void force_default_printer(bool fdp) { _force_default = fdp; }
|
||||||
|
bool forced_default_printer() const { return _force_default; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
@ -177,7 +177,7 @@ RCT& xvtil_align_rect(const RCT& inner, const RCT& outer, char halign, char vali
|
|||||||
const int oh = xvt_rect_get_height(&outer);
|
const int oh = xvt_rect_get_height(&outer);
|
||||||
int iw = xvt_rect_get_width(&inner);
|
int iw = xvt_rect_get_width(&inner);
|
||||||
int ih = xvt_rect_get_height(&inner);
|
int ih = xvt_rect_get_height(&inner);
|
||||||
int ix = 0, iy = 0;
|
int ix = outer.left, iy = outer.top;
|
||||||
if (iw > ow || ih > oh)
|
if (iw > ow || ih > oh)
|
||||||
{
|
{
|
||||||
if (grow == '-' || grow == '*')
|
if (grow == '-' || grow == '*')
|
||||||
@ -252,7 +252,10 @@ void TEvent_manager::push(WINDOW w, const EVENT& e)
|
|||||||
_e[_end] = e;
|
_e[_end] = e;
|
||||||
const int next = (_end+1) % MAX;
|
const int next = (_end+1) % MAX;
|
||||||
if (next == _begin)
|
if (next == _begin)
|
||||||
warning_box(FR("Hey %s, clicca piu' piano!"), (const char*)user());
|
{
|
||||||
|
TString msg; msg.format(FR("Hey %s, clicca piu' piano!"), (const char*)user());
|
||||||
|
xvt_dm_popup_message(msg);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_end = next;
|
_end = next;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user