Patch level : 10.0

Files correlati     : ve1.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta anteprima di stampa di vecchi frm con immagini


git-svn-id: svn://10.65.10.50/trunk@18876 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-05-15 09:19:11 +00:00
parent 58cc999903
commit 5706e80edf
10 changed files with 92 additions and 46 deletions

View File

@ -1,6 +1,7 @@
#include <alex.h> #include <alex.h>
#include <automask.h> #include <automask.h>
#include <colors.h> #include <colors.h>
#include <diction.h>
#include <dongle.h> #include <dongle.h>
#include <prefix.h> #include <prefix.h>
#include <recarray.h> #include <recarray.h>
@ -262,6 +263,7 @@ void TAVM_stack_window::update()
clear(NORMAL_BACK_COLOR); clear(NORMAL_BACK_COLOR);
if (_stack != NULL) if (_stack != NULL)
{ {
set_color(NORMAL_COLOR, NORMAL_BACK_COLOR);
for (int i = 0; i < _stack->items(); i++) for (int i = 0; i < _stack->items(); i++)
{ {
const TVariant& var = _stack->peek(i); const TVariant& var = _stack->peek(i);
@ -378,7 +380,7 @@ TAVM_monitor::TAVM_monitor() : TAutomask("Monitor", 1, 50, 20), _ignore_mon(fals
rf->create(103, 27, 10, -3, -4); add_field(rf); rf->create(103, 27, 10, -3, -4); add_field(rf);
_rw = (TAVM_stack_window*)&rf->win(); _rw = (TAVM_stack_window*)&rf->win();
add_boolean(104, 0, "Ignora MON d'ora in poi", 1, -3); add_boolean(104, 0, TR("Ignora MON d'ora in poi"), 1, -3);
add_button(DLG_NEXTREC, 0, "", -14, -1, 10, 2, "", BMP_NEXTREC).set_exit_key(K_F11); add_button(DLG_NEXTREC, 0, "", -14, -1, 10, 2, "", BMP_NEXTREC).set_exit_key(K_F11);
add_button(DLG_LASTREC, 0, "", -24, -1, 10, 2, "", BMP_DARROWR2).set_exit_key(K_F10); add_button(DLG_LASTREC, 0, "", -24, -1, 10, 2, "", BMP_DARROWR2).set_exit_key(K_F10);

View File

@ -5,11 +5,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#define _NO_STDIO #define _NO_STDIO
#include <ctype.h>
#include <string.h> #include <string.h>
#include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h>
#else #else
#ifdef __cplusplus #ifdef __cplusplus
#include <stddef.h> #include <stddef.h>

View File

@ -55,6 +55,7 @@
#define CLASS_OUTLOOK_FIELD 253 #define CLASS_OUTLOOK_FIELD 253
#define CLASS_SLIDER_FIELD 254 #define CLASS_SLIDER_FIELD 254
#define CLASS_PROP_FIELD 255 #define CLASS_PROP_FIELD 255
#define CLASS_MVC_FIELD 256
#define CLASS_TOOL_FIELD 280 #define CLASS_TOOL_FIELD 280
#define CLASS_BUTTON_TOOL 281 #define CLASS_BUTTON_TOOL 281

View File

@ -817,6 +817,11 @@ const TString& ini_get_string(const char* file, const char* paragraph, const cha
tmp.get_buffer(len); tmp.get_buffer(len);
xvt_sys_get_profile_string(file, paragraph, varname, defval, tmp.get_buffer(), tmp.size()); xvt_sys_get_profile_string(file, paragraph, varname, defval, tmp.get_buffer(), tmp.size());
} }
if (tmp[0] == '"')
{
tmp.rtrim(1);
tmp.ltrim(1);
}
return tmp; return tmp;
} }
@ -826,10 +831,22 @@ bool ini_set_string(const char* file, const char* paragraph, const char* name, c
return xvt_sys_set_profile_string(file, paragraph, varname, val) != 0; return xvt_sys_set_profile_string(file, paragraph, varname, val) != 0;
} }
int ini_get_int(const char* file, const char* paragraph, const char* name, int defval, int idx) bool ini_get_bool(const char* file, const char* para, const char* name, bool defval, int idx)
{
const char b = ini_get_string(file, para, name, defval ? "1" : "0", idx)[0];
return strchr("XY1", b) != NULL;
}
bool ini_get_bool(int cfg, const char* para, const char* name, bool defval, int idx)
{
DECLARE_FILENAME(cfg);
return ini_get_bool(filename, para, name, defval, idx);
}
int ini_get_int(const char* file, const char* para, const char* name, int defval, int idx)
{ {
DECLARE_VARNAME(name, idx); DECLARE_VARNAME(name, idx);
return xvt_sys_get_profile_int(file, paragraph, varname, defval); return xvt_sys_get_profile_int(file, para, name, defval);
} }
bool ini_set_int(const char* file, const char* paragraph, const char* name, int val, int idx) bool ini_set_int(const char* file, const char* paragraph, const char* name, int val, int idx)

View File

@ -177,12 +177,14 @@ public:
}; };
// Low level utilities // Low level utilities
bool ini_get_bool (const char* file, const char* para, const char* name, bool defval = false, int idx = -1);
int ini_get_int (const char* file, const char* para, const char* name, int defval = 0, int idx = -1); int ini_get_int (const char* file, const char* para, const char* name, int defval = 0, int idx = -1);
const TString& ini_get_string(const char* file, const char* para, const char* name, const char* defval = "", int idx = -1); const TString& ini_get_string(const char* file, const char* para, const char* name, const char* defval = "", int idx = -1);
bool ini_set_int (const char* file, const char* para, const char* name, int val, int idx = -1); bool ini_set_int (const char* file, const char* para, const char* name, int val, int idx = -1);
bool ini_set_string(const char* file, const char* para, const char* name, const char* val, int idx = -1); bool ini_set_string(const char* file, const char* para, const char* name, const char* val, int idx = -1);
// High level utilities // High level utilities
bool ini_get_bool (int cfg, const char* para, const char* name, bool defval = false, int idx = -1);
int ini_get_int (int cfg, const char* para, const char* name, int defval = 0, int idx = -1); int ini_get_int (int cfg, const char* para, const char* name, int defval = 0, int idx = -1);
const TString& ini_get_string(int cfg, const char* para, const char* name, const char* defval = "", int idx = -1); const TString& ini_get_string(int cfg, const char* para, const char* name, const char* defval = "", int idx = -1);
bool ini_set_int (int cfg, const char* para, const char* name, int val, int idx = -1); bool ini_set_int (int cfg, const char* para, const char* name, int val, int idx = -1);

View File

@ -1083,11 +1083,7 @@ bool TDongle::shown(word code) const
{ {
bool do_test = true; bool do_test = true;
if (code != EEAUT) if (code != EEAUT)
{ do_test = ini_get_bool("install.ini", mod, "Ee");
TConfig cfg("install.ini", mod);
cfg.write_protect();
do_test = cfg.get_bool("Ee");
}
if (do_test) if (do_test)
yes = active(EEAUT); yes = active(EEAUT);
} }

View File

@ -194,7 +194,7 @@ void TImage::draw(WINDOW win, const RCT& dst) const
// Certified 100% // Certified 100%
void TImage::draw(WINDOW win, const RCT& dst, const RCT& src) const void TImage::draw(WINDOW win, const RCT& dst, const RCT& src) const
{ {
xvt_dwin_draw_image(win, _image, &dst, &_src); xvt_dwin_draw_image(win, _image, &dst, &src);
} }
// Certified 99% // Certified 99%

View File

@ -265,6 +265,7 @@ protected:
public: public:
virtual PNT log2dev(long lx, long ly) const; virtual PNT log2dev(long lx, long ly) const;
void update_scroll_range(); void update_scroll_range();
short log2dev(long size) const;
TAssoc_array& alinks() { return _alinks; } TAssoc_array& alinks() { return _alinks; }
TPointer_array& plinks() { return _plinks; } TPointer_array& plinks() { return _plinks; }
@ -274,6 +275,11 @@ public:
virtual ~TPrint_preview_window(); virtual ~TPrint_preview_window();
}; };
short TPrint_preview_window::log2dev(long sz) const
{
return short(sz * _zoom / 60);
}
PNT TPrint_preview_window::log2dev(long lx, long ly) const PNT TPrint_preview_window::log2dev(long lx, long ly) const
{ {
PNT pnt = { short(ly), short(lx) }; PNT pnt = { short(ly), short(lx) };
@ -1416,10 +1422,18 @@ bool TBook::print_page(TWindow& win, size_t page)
win.hide_pen(); win.hide_pen();
else else
{ {
if (preview) int thickness = 0;
win.set_pen(col, width); if (width > 0)
else {
win.set_pen(col, width * _phr / 72); // Converte width in 72' di pollice if (preview)
{
const TPrint_preview_window& pw = (const TPrint_preview_window&)win;
thickness = pw.log2dev(width);
}
else
thickness = width * _phr / 72; // Converte width in 72' di pollice
}
win.set_pen(col, thickness);
} }
continue; continue;
} }

View File

@ -947,27 +947,31 @@ bool TProp_field::is_kind_of(word cid) const
void TProp_field::freeze(bool on) void TProp_field::freeze(bool on)
{ {
WINDOW pg = win().win();
if (on) if (on)
xvt_prop_suspend(win().win()); xvt_prop_suspend(pg);
else else
xvt_prop_restart(win().win()); xvt_prop_restart(pg);
} }
bool TProp_field::set_property(const char* name, const char* value, const char* label) bool TProp_field::set_property(const char* name, const char* value, const char* label)
{ {
WINDOW pg = win().win();
XVT_TREEVIEW_NODE node = NULL; XVT_TREEVIEW_NODE node = NULL;
if (name != NULL && value == NULL && label != NULL) WINDOW pg = win().win();
node = xvt_prop_add(pg, NULL, name, NULL, label); // Category! if (pg != NULL_WIN)
else
{ {
if (label && *label) if (name != NULL && value == NULL && label != NULL)
node = xvt_prop_add(pg, "string", name, value, label); // Add property node = xvt_prop_add(pg, NULL, name, NULL, label); // Category!
else else
{ {
node = xvt_prop_find(win().win(), name); if (label && *label)
if (node) node = xvt_prop_add(pg, "string", name, value, label); // Add property
xvt_prop_set_data(pg, node, value); // Set property else
{
node = xvt_prop_find(win().win(), name);
if (node)
xvt_prop_set_data(pg, node, value); // Set property
}
} }
} }
return node != NULL; return node != NULL;
@ -984,10 +988,11 @@ bool TProp_field::set_property(const char* name, long value, const char* label)
return done; return done;
} }
bool TProp_field::set_property(const char* name, COLOR value, const char* label) bool TProp_field::set_property(const char* name, COLOR c, const char* label)
{ {
bool done = false; bool done = false;
TString16 str; str << long(value & 0xFFFFFF); TString16 str;
str.format("%d,%d,%d", XVT_COLOR_GET_RED(c), XVT_COLOR_GET_GREEN(c), XVT_COLOR_GET_BLUE(c));
if (label && *label) if (label && *label)
done = xvt_prop_add(win().win(), "color", name, str, label) != NULL; done = xvt_prop_add(win().win(), "color", name, str, label) != NULL;
else else
@ -1019,9 +1024,11 @@ COLOR TProp_field::get_color_property(const char* name) const
const TString& tmp = get_property(name); const TString& tmp = get_property(name);
if (tmp.full()) if (tmp.full())
{ {
col = atol(tmp); int r = 0, g = 0, b = 0;
if (col == 0) if (sscanf(tmp, "%d,%d,%d", &r, &g, &b) == 3)
col = COLOR_BLACK; col = RGB2COLOR(r,g,b);
else
col = r ? r : COLOR_BLACK;
} }
return col; return col;
} }

View File

@ -17,6 +17,7 @@
#include "ve1100.h" #include "ve1100.h"
#include <comuni.h> #include <comuni.h>
#include <NDITTE.h>
#define LISTADOC "listadoc" #define LISTADOC "listadoc"
#define FAKETOTFLD 9999 #define FAKETOTFLD 9999
@ -1256,7 +1257,7 @@ protected:
virtual bool create(); virtual bool create();
virtual bool destroy(); virtual bool destroy();
virtual void main_loop(); virtual void main_loop();
bool select(void); KEY select(void);
virtual void on_firm_change(void); virtual void on_firm_change(void);
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
@ -1279,7 +1280,7 @@ protected:
public: public:
void print_documento(TDocumento_form& frm); void print_documento(TDocumento_form& frm);
void print_selected(); void print_selected(KEY k);
TStampaDoc_application() : _key(BY_NUM_KEY) {}; TStampaDoc_application() : _key(BY_NUM_KEY) {};
virtual ~TStampaDoc_application() {}; virtual ~TStampaDoc_application() {};
}; };
@ -1337,7 +1338,7 @@ int TStampaDoc_application::numerazione_definitiva(TDocumento& doc) const
return err; return err;
} }
void TStampaDoc_application::print_selected() void TStampaDoc_application::print_selected(KEY k)
{ {
TRelation rel(LF_DOC); TRelation rel(LF_DOC);
rel.add(LF_RIGHEDOC,"CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC"); rel.add(LF_RIGHEDOC,"CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC");
@ -1387,9 +1388,12 @@ void TStampaDoc_application::print_selected()
_definitiva= query_final_print(); // legge il flag di stampa definitiva _definitiva= query_final_print(); // legge il flag di stampa definitiva
} }
TPrinter& pr = printer(); TPrinter& pr = printer();
pr.open();
if (_interattivo)
pr.set_printtype(k == 'A' ? screenvis : winprinter);
pr.open();
TProgind* pi = pr.printtype() != screenvis ? TProgind* pi = pr.printtype() != screenvis ?
new TProgind(cur.items(), TR("Stampa documenti in corso..."),false,true) : new TProgind(cur.items(), TR("Stampa documenti in corso..."),false,true) :
NULL; NULL;
@ -1979,13 +1983,18 @@ bool TStampaDoc_application::create()
_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);
_selection_mask->disable(DLG_EMAIL);
_selection_mask->disable(DLG_SIGNMAIL);
_selection_mask->disable(DLG_PDF);
_selection_mask->disable(DLG_SIGNPDF);
} }
else else
{ {
_clifo_rel = new TRelation(LF_CLIFO); _clifo_rel = new TRelation(LF_CLIFO);
_clifo_cur = new TCursor(_clifo_rel); _clifo_cur = new TCursor(_clifo_rel);
_clifo_sheet = new TCursor_sheet(_clifo_cur, " |CODCF|RAGSOC", TR("Selezione Clienti/Fornitori"), _clifo_sheet = new TCursor_sheet(_clifo_cur, " |CODCF|RAGSOC", TR("Selezione Clienti/Fornitori"),
"@1|Codice@6R|Descrizione@50", 0, 1); HR("@1|Codice@6R|Descrizione@50"), 0, 1);
build_clifo_list(); // Costruisce l'array sheet dei clienti (si parte!!) build_clifo_list(); // Costruisce l'array sheet dei clienti (si parte!!)
_selection_mask->set_handler(F_TIPOCF, tipocf_handler); _selection_mask->set_handler(F_TIPOCF, tipocf_handler);
_selection_mask->set_handler(F_CODFR, fr_cod_handler); _selection_mask->set_handler(F_CODFR, fr_cod_handler);
@ -2018,7 +2027,7 @@ bool TStampaDoc_application::create()
_interattivo = true; _interattivo = true;
} }
print_selected(); print_selected(K_ENTER);
return false; return false;
} }
else else
@ -2050,11 +2059,11 @@ bool TStampaDoc_application::destroy()
void TStampaDoc_application::on_firm_change() void TStampaDoc_application::on_firm_change()
{ {
TLocalisamfile &firmfile= _firmrel->lfile(); TLocalisamfile &firmfile= _firmrel->lfile();
firmfile.put("CODDITTA", get_firm()); firmfile.put(NDT_CODDITTA, get_firm());
_firmrel->read(); _firmrel->read();
} }
bool TStampaDoc_application::select() KEY TStampaDoc_application::select()
{ {
TMask& m = *_selection_mask; TMask& m = *_selection_mask;
@ -2062,8 +2071,8 @@ bool TStampaDoc_application::select()
if (_is_lista) if (_is_lista)
reset_choices(m); reset_choices(m);
const bool ok = m.run() == K_ENTER; const KEY k = m.run();
if (ok) if (k != K_QUIT)
{ {
if (!_is_lista) if (!_is_lista)
{ {
@ -2092,13 +2101,14 @@ bool TStampaDoc_application::select()
else else
_key = BY_NUM_KEY; _key = BY_NUM_KEY;
} }
return ok; return k;
} }
void TStampaDoc_application::main_loop() void TStampaDoc_application::main_loop()
{ {
while (select()) KEY k = K_ENTER;
print_selected(); while ((k = select()) != K_QUIT)
print_selected(k);
} }
// Do all the work! // Do all the work!