Riaggiustata gestione stampanti, maschere e risorse
git-svn-id: svn://10.65.10.50/trunk@531 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7deaba2654
commit
2a1f95ad3d
@ -8,12 +8,11 @@
|
|||||||
// in modo che la maschera sia compatibile
|
// in modo che la maschera sia compatibile
|
||||||
// con i metodi di ba2300, usati anche
|
// con i metodi di ba2300, usati anche
|
||||||
// da printer
|
// da printer
|
||||||
#define MSK_1_SAVE 112
|
|
||||||
#define MSK_1_SETUP 333
|
|
||||||
#define MSK_1_ISGRAPHICS 334
|
#define MSK_1_ISGRAPHICS 334
|
||||||
#define MSK_1_SIZE 335
|
#define MSK_1_SIZE 335
|
||||||
#define MSK_1_LINES 336
|
#define MSK_1_LINES 336
|
||||||
#define MSK_1_NPAGES 337
|
#define MSK_1_NPAGES 337
|
||||||
|
#define MSK_1_FONT 338
|
||||||
|
|
||||||
#define MSK_1_PRINTERFILE prn.epf
|
#define MSK_1_PRINTERFILE prn.epf
|
||||||
#define MSK_1_NAMESFILE nms.epf
|
#define MSK_1_NAMESFILE nms.epf
|
||||||
|
@ -1,71 +1,57 @@
|
|||||||
#include <bagn001a.h>
|
#include <bagn001a.h>
|
||||||
|
|
||||||
PAGE "IMPOSTAZIONE STAMPANTE" -1 -1 76 10
|
PAGE "IMPOSTAZIONE STAMPANTE" -1 -1 76 13
|
||||||
|
|
||||||
RADIOBUTTON MSK_1_TYPE 16
|
RADIOBUTTON MSK_1_TYPE 70
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Stampa su..."
|
PROMPT 1 1 "Stampa su..."
|
||||||
HELP "Selezionare il tipo di stampa"
|
HELP "Selezionare il tipo di stampa"
|
||||||
ITEM "0|Stampante"
|
ITEM "0|Stampante"
|
||||||
MESSAGE DISABLE,MSK_1_FILENAME|RESET,MSK_1_FILENAME
|
MESSAGE HIDE,MSK_1_FILENAME|RESET,MSK_1_FILENAME|SHOW,MSK_1_PRINTERS
|
||||||
MESSAGE ENABLE,MSK_1_PRINTERS
|
MESSAGE ENABLE,MSK_1_PRINTERS
|
||||||
MESSAGE ENABLE,MSK_1_CODES
|
MESSAGE ENABLE,MSK_1_CODES
|
||||||
MESSAGE ENABLE,MSK_1_SIZE
|
MESSAGE ENABLE,MSK_1_SIZE
|
||||||
ITEM "1|File"
|
MESSAGE ENABLE,MSK_1_LINES
|
||||||
MESSAGE ENABLE,MSK_1_FILENAME|DISABLE,MSK_1_PRINTERS
|
MESSAGE ENABLE,DLG_SETPRINT
|
||||||
MESSAGE ENABLE,MSK_1_CODES
|
ITEM "2|Visualizzazione"
|
||||||
MESSAGE DISABLE,MSK_1_SIZE
|
MESSAGE HIDE,MSK_1_FILENAME|RESET,MSK_1_FILENAME
|
||||||
ITEM "2|Video"
|
MESSAGE SHOW,MSK_1_PRINTERS|DISABLE,MSK_1_PRINTERS
|
||||||
MESSAGE DISABLE,MSK_1_FILENAME|RESET,MSK_1_FILENAME
|
|
||||||
MESSAGE DISABLE,MSK_1_PRINTERS
|
|
||||||
MESSAGE DISABLE,MSK_1_CODES
|
MESSAGE DISABLE,MSK_1_CODES
|
||||||
MESSAGE DISABLE,MSK_1_SIZE
|
MESSAGE DISABLE,MSK_1_SIZE
|
||||||
|
MESSAGE DISABLE,MSK_1_LINES
|
||||||
|
MESSAGE DISABLE,DLG_SETPRINT
|
||||||
|
ITEM "1|File"
|
||||||
|
MESSAGE SHOW,MSK_1_FILENAME|HIDE,MSK_1_PRINTERS
|
||||||
|
MESSAGE ENABLE,MSK_1_CODES
|
||||||
|
MESSAGE DISABLE,MSK_1_SIZE
|
||||||
|
MESSAGE DISABLE,MSK_1_LINES
|
||||||
|
MESSAGE DISABLE,DLG_SETPRINT
|
||||||
|
FLAGS "Z"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST MSK_1_PRINTERS 40
|
LIST MSK_1_PRINTERS 50
|
||||||
BEGIN
|
BEGIN
|
||||||
/* viene riempito runtime con nomi letti da config */
|
/* viene riempito a run-time con nomi letti da config */
|
||||||
PROMPT 21 1 "Stampante "
|
PROMPT 4 5 "Stampante "
|
||||||
HELP "Selezionare la stampante desiderata"
|
HELP "Selezionare la stampante desiderata"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING MSK_1_FILENAME 40
|
STRING MSK_1_FILENAME 52
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 21 3 "Nome file "
|
PROMPT 4 5 "Nome file "
|
||||||
HELP "Inserire qui il nome del file in caso di stampa su file"
|
HELP "Inserire qui il nome del file in caso di stampa su file"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST MSK_1_CODES 40
|
LIST MSK_1_CODES 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 21 5 "Tipo stampa "
|
PROMPT 4 6 "Tipo stampa "
|
||||||
/* pure */
|
/* pure */
|
||||||
HELP "Selezionare la modalita' nelle quale si desidera la stampa"
|
HELP "Selezionare la modalita' nelle quale si desidera la stampa"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON MSK_1_SETUP 20 1
|
|
||||||
BEGIN
|
|
||||||
PROMPT 33 5 "Imposta stampante... "
|
|
||||||
HELP "Chiama l'Impostazione Stampante di Windows"
|
|
||||||
MESSAGE EXIT,MSK_1_SETUP
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN MSK_1_SAVE
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 6 "Salva la configurazione"
|
|
||||||
HELP "Salva la configurazione corrente della stampante"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN MSK_1_ISGRAPHICS
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 7 "Stampa elementi grafici"
|
|
||||||
HELP "Stampa elementi grafici (linee, box, logo) se la stampante lo consente"
|
|
||||||
END
|
|
||||||
|
|
||||||
LIST MSK_1_SIZE 3
|
LIST MSK_1_SIZE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 5 "Carattere "
|
PROMPT 32 6 "Carattere "
|
||||||
ITEM "7|7"
|
ITEM "7|7"
|
||||||
ITEM "8|8"
|
ITEM "8|8"
|
||||||
ITEM "10|10"
|
ITEM "10|10"
|
||||||
@ -77,7 +63,7 @@ END
|
|||||||
|
|
||||||
LIST MSK_1_LINES 3
|
LIST MSK_1_LINES 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 6 "Linee/Inch "
|
PROMPT 52 6 "Linee/Inch "
|
||||||
ITEM "4|4"
|
ITEM "4|4"
|
||||||
ITEM "5|5"
|
ITEM "5|5"
|
||||||
ITEM "6|6"
|
ITEM "6|6"
|
||||||
@ -88,20 +74,51 @@ BEGIN
|
|||||||
HELP "Selezionare il numero di linee per pollice"
|
HELP "Selezionare il numero di linee per pollice"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
LIST MSK_1_FONT 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 6 "Font "
|
||||||
|
ITEM "1|Courier"
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER MSK_1_NPAGES 3 0
|
NUMBER MSK_1_NPAGES 3 0
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 7 "N.o copie "
|
PROMPT 54 8 "N.o copie "
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN MSK_1_ISGRAPHICS
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 8 "Stampa elementi grafici"
|
||||||
|
HELP "Stampa elementi grafici (linee, box, logo) se la stampante lo consente"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 74 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_SETPRINT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -14 -2 "Imposta"
|
||||||
|
HELP "Chiama l'Impostazione Stampante di Windows"
|
||||||
|
MESSAGE EXIT,DLG_SETPRINT
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_SAVEREC 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -24 -2 ""
|
||||||
|
MESSAGE EXIT,K_INS
|
||||||
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
BUTTON DLG_OK 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 ""
|
PROMPT -34 -2 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 9 2
|
BUTTON DLG_CANCEL 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -1 ""
|
PROMPT -44 -2 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -564,6 +564,9 @@ TPush_button::TPush_button(short left, short top, short right, short bottom,
|
|||||||
case DLG_PRINT:
|
case DLG_PRINT:
|
||||||
capt = format("#%d", BMP_PRINT);
|
capt = format("#%d", BMP_PRINT);
|
||||||
break;
|
break;
|
||||||
|
case DLG_SETPRINT:
|
||||||
|
capt = format("#%d", BMP_SETPRINT);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,7 @@ ACCEL MENU_FILE "f" ALT
|
|||||||
BMP_EDIT bitmap DISCARDABLE f:\p.due\bmp\edit.bmp
|
BMP_EDIT bitmap DISCARDABLE f:\p.due\bmp\edit.bmp
|
||||||
BMP_LINK bitmap DISCARDABLE f:\p.due\bmp\link.bmp
|
BMP_LINK bitmap DISCARDABLE f:\p.due\bmp\link.bmp
|
||||||
BMP_PRINT bitmap DISCARDABLE f:\p.due\bmp\print.bmp
|
BMP_PRINT bitmap DISCARDABLE f:\p.due\bmp\print.bmp
|
||||||
|
BMP_SETPRINT bitmap DISCARDABLE f:\p.due\bmp\setprint.bmp
|
||||||
|
|
||||||
$$$
|
$$$
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define DLG_EDIT 22 /* TAG del bottone Edit */
|
#define DLG_EDIT 22 /* TAG del bottone Edit */
|
||||||
#define DLG_LINK 23 /* TAG del bottone Collega (applicazione) */
|
#define DLG_LINK 23 /* TAG del bottone Collega (applicazione) */
|
||||||
#define DLG_PRINT 24 /* TAG del bottone Stampa */
|
#define DLG_PRINT 24 /* TAG del bottone Stampa */
|
||||||
|
#define DLG_SETPRINT 25 /* TAG del bottone Imposta Stampa */
|
||||||
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
|
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
|
||||||
|
|
||||||
/* @M
|
/* @M
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
|
||||||
#if XVT_OS==XVT_OS_SCOUNIX
|
#if XVT_OS==XVT_OS_SCOUNIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -622,7 +623,7 @@ bool printers_on_key (TMask_field & f, KEY key)
|
|||||||
bool set_windows_print_device (TMask_field& f, KEY key)
|
bool set_windows_print_device (TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
static char szDevice[80];
|
static char szDevice[80];
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE && f.mask().is_running())
|
||||||
{
|
{
|
||||||
if (MainApp()->printer().get_printrcd() != NULL)
|
if (MainApp()->printer().get_printrcd() != NULL)
|
||||||
free_print_rcd (MainApp ()->printer().get_printrcd ());
|
free_print_rcd (MainApp ()->printer().get_printrcd ());
|
||||||
@ -630,8 +631,8 @@ bool set_windows_print_device (TMask_field & f, KEY key)
|
|||||||
TString pdev (pn.get (atoi (f.get())));
|
TString pdev (pn.get (atoi (f.get())));
|
||||||
GetProfileString ("devices", pdev, "", szDevice, sizeof (szDevice));
|
GetProfileString ("devices", pdev, "", szDevice, sizeof (szDevice));
|
||||||
pdev << "," << szDevice;
|
pdev << "," << szDevice;
|
||||||
// WriteProfileString("windows","device", pdev);
|
// scrivi (e semmai lo si risistema poi)
|
||||||
// madonna bona
|
WriteProfileString("windows", "device", pdev);
|
||||||
MainApp()->printer().set_printrcd(get_print_rcd (&(MainApp ()->printer ().get_printrcdsize ())));
|
MainApp()->printer().set_printrcd(get_print_rcd (&(MainApp ()->printer ().get_printrcdsize ())));
|
||||||
MainApp()->printer().set_win_formlen();
|
MainApp()->printer().set_win_formlen();
|
||||||
}
|
}
|
||||||
@ -1156,9 +1157,9 @@ void TPrinter::set()
|
|||||||
}
|
}
|
||||||
|
|
||||||
((TList_field &) (mask.field (MSK_1_PRINTERS))).replace_items (pn1, pn2);
|
((TList_field &) (mask.field (MSK_1_PRINTERS))).replace_items (pn1, pn2);
|
||||||
mask.hide(MSK_1_SETUP);
|
|
||||||
mask.hide(MSK_1_SIZE);
|
mask.hide(MSK_1_SIZE);
|
||||||
mask.hide(MSK_1_LINES);
|
mask.hide(MSK_1_LINES);
|
||||||
|
mask.disable(DLG_SETPRINT);
|
||||||
if (!_multiple_copies) mask.hide(MSK_1_NPAGES);
|
if (!_multiple_copies) mask.hide(MSK_1_NPAGES);
|
||||||
|
|
||||||
pn1 = "";
|
pn1 = "";
|
||||||
@ -1184,12 +1185,12 @@ void TPrinter::set()
|
|||||||
mask.set(MSK_1_FILENAME, _printerfile);
|
mask.set(MSK_1_FILENAME, _printerfile);
|
||||||
mask.set(MSK_1_NPAGES, _ncopies);
|
mask.set(MSK_1_NPAGES, _ncopies);
|
||||||
|
|
||||||
mask.reset (MSK_1_SAVE);
|
KEY k;
|
||||||
|
|
||||||
if (mask.run () == K_ESC)
|
if ((k = mask.run()) == K_ESC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mask.get_bool(MSK_1_SAVE))
|
if (k == K_INS) // premuto REGISTRA
|
||||||
mask.save();
|
mask.save();
|
||||||
|
|
||||||
// get user choices
|
// get user choices
|
||||||
@ -1233,6 +1234,8 @@ void TPrinter::set()
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
_get_windows_printer_names(pn2);
|
_get_windows_printer_names(pn2);
|
||||||
|
char old_default[80];
|
||||||
|
GetProfileString ("windows", "device", ",,,", old_default, sizeof(old_default));
|
||||||
|
|
||||||
for (i = 0; i < pn2.items (); i++)
|
for (i = 0; i < pn2.items (); i++)
|
||||||
pn1.add(i);
|
pn1.add(i);
|
||||||
@ -1257,15 +1260,15 @@ void TPrinter::set()
|
|||||||
mask.set (MSK_1_TYPE, "0");
|
mask.set (MSK_1_TYPE, "0");
|
||||||
|
|
||||||
mask.set_handler (MSK_1_PRINTERS, set_windows_print_device);
|
mask.set_handler (MSK_1_PRINTERS, set_windows_print_device);
|
||||||
mask.reset (MSK_1_SAVE);
|
|
||||||
|
|
||||||
KEY k;
|
KEY k;
|
||||||
int oldprn = _curprn;
|
int oldprn = _curprn;
|
||||||
|
|
||||||
while ((k = mask.run ()) != K_ESC && k != K_ENTER)
|
while ((k = mask.run ()) != K_ESC && k != K_ENTER && k != K_INS)
|
||||||
{
|
{
|
||||||
if (k == MSK_1_SETUP)
|
if (k == DLG_SETPRINT)
|
||||||
{
|
{
|
||||||
|
// l'handler setta default di windows a quella nel listbox e ribecca l'rcd
|
||||||
if (_print_rcd != NULL)
|
if (_print_rcd != NULL)
|
||||||
{
|
{
|
||||||
if (page_setup_dlg(_print_rcd))
|
if (page_setup_dlg(_print_rcd))
|
||||||
@ -1273,13 +1276,18 @@ void TPrinter::set()
|
|||||||
// see if user has changed printer
|
// see if user has changed printer
|
||||||
// determine index of currently selected printer
|
// determine index of currently selected printer
|
||||||
// ACTHUNG! Deep hacking of XVT internals! NON PORTABLE!
|
// ACTHUNG! Deep hacking of XVT internals! NON PORTABLE!
|
||||||
|
if (_print_rcd != NULL)
|
||||||
|
free_print_rcd (_print_rcd);
|
||||||
|
_print_rcd = get_print_rcd(&_print_rcd_size);
|
||||||
for (i = 0; i < pn2.items(); i++)
|
for (i = 0; i < pn2.items(); i++)
|
||||||
if (strcmp((const char *)(_print_rcd + 4), pn2.get(i)) == 0)
|
if (strcmp((const char *)(_print_rcd + 4), pn2.get(i)) == 0)
|
||||||
{
|
{
|
||||||
_curprn = i;
|
_curprn = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mask.set(MSK_1_PRINTERS, pn1.get(_curprn));
|
mask.set(MSK_1_PRINTERS, pn1.get(_curprn));
|
||||||
|
|
||||||
set_win_formlen();
|
set_win_formlen();
|
||||||
}
|
}
|
||||||
mask.set_focus();
|
mask.set_focus();
|
||||||
@ -1288,24 +1296,31 @@ void TPrinter::set()
|
|||||||
beep ();
|
beep ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_curprn = atoi(mask.get(MSK_1_PRINTERS));
|
||||||
|
|
||||||
|
if (k == K_INS)
|
||||||
|
{
|
||||||
|
// tutto resta com'e'
|
||||||
|
mask.save ();
|
||||||
|
}
|
||||||
|
if (k == K_ESC || k == K_ENTER)
|
||||||
|
{
|
||||||
|
// riaggiusta stampante default windows come prima
|
||||||
|
// curprn e rcd sono quelle di prima
|
||||||
|
MainApp()->enable_menu_item(M_FILE_PG_SETUP);
|
||||||
|
WriteProfileString("windows","device", old_default);
|
||||||
|
}
|
||||||
if (k == K_ESC)
|
if (k == K_ESC)
|
||||||
{
|
{
|
||||||
// rimetti come prima
|
|
||||||
// WriteProfileString("windows","device", pdev);
|
|
||||||
if (_print_rcd != NULL)
|
if (_print_rcd != NULL)
|
||||||
free_print_rcd (_print_rcd);
|
free_print_rcd (_print_rcd);
|
||||||
_curprn = oldprn;
|
_curprn = oldprn;
|
||||||
_print_rcd = get_print_rcd(&_print_rcd_size);
|
_print_rcd = get_print_rcd(&_print_rcd_size);
|
||||||
set_win_formlen();
|
set_win_formlen();
|
||||||
MainApp()->enable_menu_item(M_FILE_PG_SETUP);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_curprn = atoi(mask.get(MSK_1_PRINTERS));
|
|
||||||
|
|
||||||
if (mask.get_bool(MSK_1_SAVE))
|
|
||||||
mask.save ();
|
|
||||||
|
|
||||||
_ncopies = atoi (mask.get (MSK_1_NPAGES));
|
_ncopies = atoi (mask.get (MSK_1_NPAGES));
|
||||||
|
|
||||||
switch (atoi (mask.get (MSK_1_TYPE)))
|
switch (atoi (mask.get (MSK_1_TYPE)))
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
#define BMP_DELRECDN 154
|
#define BMP_DELRECDN 154
|
||||||
#define BMP_NEWRECDN 155
|
#define BMP_NEWRECDN 155
|
||||||
#define BMP_QUITDN 164
|
#define BMP_QUITDN 164
|
||||||
|
#define BMP_SETPRINT 165
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user