From 5706e80edfd1f0cef1536e050a653428b23cfa64 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 15 May 2009 09:19:11 +0000 Subject: [PATCH] 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 --- include/alex.cpp | 4 +++- include/ccommon.h | 3 --- include/classes.h | 1 + include/config.cpp | 21 +++++++++++++++++++-- include/config.h | 2 ++ include/dongle.cpp | 6 +----- include/image.cpp | 2 +- include/reprint.cpp | 22 ++++++++++++++++++---- include/treectrl.cpp | 39 +++++++++++++++++++++++---------------- ve/ve1100.cpp | 38 ++++++++++++++++++++++++-------------- 10 files changed, 92 insertions(+), 46 deletions(-) diff --git a/include/alex.cpp b/include/alex.cpp index 5904e9ba8..ae2dc412e 100755 --- a/include/alex.cpp +++ b/include/alex.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,7 @@ void TAVM_stack_window::update() clear(NORMAL_BACK_COLOR); if (_stack != NULL) { + set_color(NORMAL_COLOR, NORMAL_BACK_COLOR); for (int i = 0; i < _stack->items(); 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); _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_LASTREC, 0, "", -24, -1, 10, 2, "", BMP_DARROWR2).set_exit_key(K_F10); diff --git a/include/ccommon.h b/include/ccommon.h index 40c75f234..d94334c5e 100755 --- a/include/ccommon.h +++ b/include/ccommon.h @@ -5,11 +5,8 @@ #include #include #define _NO_STDIO -#include #include -#include #include -#include #else #ifdef __cplusplus #include diff --git a/include/classes.h b/include/classes.h index 22e6d9582..db1bb9057 100755 --- a/include/classes.h +++ b/include/classes.h @@ -55,6 +55,7 @@ #define CLASS_OUTLOOK_FIELD 253 #define CLASS_SLIDER_FIELD 254 #define CLASS_PROP_FIELD 255 +#define CLASS_MVC_FIELD 256 #define CLASS_TOOL_FIELD 280 #define CLASS_BUTTON_TOOL 281 diff --git a/include/config.cpp b/include/config.cpp index 0aa17ca9b..02af703a1 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -817,6 +817,11 @@ const TString& ini_get_string(const char* file, const char* paragraph, const cha tmp.get_buffer(len); 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; } @@ -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; } -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); - 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) diff --git a/include/config.h b/include/config.h index 9b977a261..12d2a9ec8 100755 --- a/include/config.h +++ b/include/config.h @@ -177,12 +177,14 @@ public: }; // 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); 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_string(const char* file, const char* para, const char* name, const char* val, int idx = -1); // 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); 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); diff --git a/include/dongle.cpp b/include/dongle.cpp index 7a50cdbea..89af366fd 100755 --- a/include/dongle.cpp +++ b/include/dongle.cpp @@ -1083,11 +1083,7 @@ bool TDongle::shown(word code) const { bool do_test = true; if (code != EEAUT) - { - TConfig cfg("install.ini", mod); - cfg.write_protect(); - do_test = cfg.get_bool("Ee"); - } + do_test = ini_get_bool("install.ini", mod, "Ee"); if (do_test) yes = active(EEAUT); } diff --git a/include/image.cpp b/include/image.cpp index 0e1be491b..056b12e5c 100755 --- a/include/image.cpp +++ b/include/image.cpp @@ -194,7 +194,7 @@ void TImage::draw(WINDOW win, const RCT& dst) const // Certified 100% 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% diff --git a/include/reprint.cpp b/include/reprint.cpp index 227dc4429..dcc9c2a12 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -265,6 +265,7 @@ protected: public: virtual PNT log2dev(long lx, long ly) const; void update_scroll_range(); + short log2dev(long size) const; TAssoc_array& alinks() { return _alinks; } TPointer_array& plinks() { return _plinks; } @@ -274,6 +275,11 @@ public: 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 pnt = { short(ly), short(lx) }; @@ -1416,10 +1422,18 @@ bool TBook::print_page(TWindow& win, size_t page) win.hide_pen(); else { - if (preview) - win.set_pen(col, width); - else - win.set_pen(col, width * _phr / 72); // Converte width in 72' di pollice + int thickness = 0; + if (width > 0) + { + 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; } diff --git a/include/treectrl.cpp b/include/treectrl.cpp index 9d78ea63e..dfff7cc5b 100755 --- a/include/treectrl.cpp +++ b/include/treectrl.cpp @@ -947,27 +947,31 @@ bool TProp_field::is_kind_of(word cid) const void TProp_field::freeze(bool on) { + WINDOW pg = win().win(); if (on) - xvt_prop_suspend(win().win()); + xvt_prop_suspend(pg); else - xvt_prop_restart(win().win()); + xvt_prop_restart(pg); } bool TProp_field::set_property(const char* name, const char* value, const char* label) { - WINDOW pg = win().win(); XVT_TREEVIEW_NODE node = NULL; - if (name != NULL && value == NULL && label != NULL) - node = xvt_prop_add(pg, NULL, name, NULL, label); // Category! - else + WINDOW pg = win().win(); + if (pg != NULL_WIN) { - if (label && *label) - node = xvt_prop_add(pg, "string", name, value, label); // Add property + if (name != NULL && value == NULL && label != NULL) + node = xvt_prop_add(pg, NULL, name, NULL, label); // Category! else { - node = xvt_prop_find(win().win(), name); - if (node) - xvt_prop_set_data(pg, node, value); // Set property + if (label && *label) + node = xvt_prop_add(pg, "string", name, value, label); // Add property + else + { + node = xvt_prop_find(win().win(), name); + if (node) + xvt_prop_set_data(pg, node, value); // Set property + } } } return node != NULL; @@ -984,10 +988,11 @@ bool TProp_field::set_property(const char* name, long value, const char* label) 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; - 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) done = xvt_prop_add(win().win(), "color", name, str, label) != NULL; else @@ -1019,9 +1024,11 @@ COLOR TProp_field::get_color_property(const char* name) const const TString& tmp = get_property(name); if (tmp.full()) { - col = atol(tmp); - if (col == 0) - col = COLOR_BLACK; + int r = 0, g = 0, b = 0; + if (sscanf(tmp, "%d,%d,%d", &r, &g, &b) == 3) + col = RGB2COLOR(r,g,b); + else + col = r ? r : COLOR_BLACK; } return col; } diff --git a/ve/ve1100.cpp b/ve/ve1100.cpp index f65623f45..5ee958fbe 100755 --- a/ve/ve1100.cpp +++ b/ve/ve1100.cpp @@ -17,6 +17,7 @@ #include "ve1100.h" #include +#include #define LISTADOC "listadoc" #define FAKETOTFLD 9999 @@ -1256,7 +1257,7 @@ protected: virtual bool create(); virtual bool destroy(); virtual void main_loop(); - bool select(void); + KEY select(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 bool query_final_print(void); // funzione chiamata all'inizializzazione per sapere se la stampa è definitiva @@ -1279,7 +1280,7 @@ protected: public: void print_documento(TDocumento_form& frm); - void print_selected(); + void print_selected(KEY k); TStampaDoc_application() : _key(BY_NUM_KEY) {}; virtual ~TStampaDoc_application() {}; }; @@ -1337,7 +1338,7 @@ int TStampaDoc_application::numerazione_definitiva(TDocumento& doc) const return err; } -void TStampaDoc_application::print_selected() +void TStampaDoc_application::print_selected(KEY k) { TRelation rel(LF_DOC); 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 } - TPrinter& pr = printer(); - pr.open(); + TPrinter& pr = printer(); + if (_interattivo) + pr.set_printtype(k == 'A' ? screenvis : winprinter); + + pr.open(); TProgind* pi = pr.printtype() != screenvis ? new TProgind(cur.items(), TR("Stampa documenti in corso..."),false,true) : NULL; @@ -1979,13 +1983,18 @@ bool TStampaDoc_application::create() _selection_mask->set_handler(F_DA_DATADOC, date2num_handler); _selection_mask->set_handler(F_A_DATADOC, date2num_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 { _clifo_rel = new TRelation(LF_CLIFO); _clifo_cur = new TCursor(_clifo_rel); _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!!) _selection_mask->set_handler(F_TIPOCF, tipocf_handler); _selection_mask->set_handler(F_CODFR, fr_cod_handler); @@ -2018,7 +2027,7 @@ bool TStampaDoc_application::create() _interattivo = true; } - print_selected(); + print_selected(K_ENTER); return false; } else @@ -2050,11 +2059,11 @@ bool TStampaDoc_application::destroy() void TStampaDoc_application::on_firm_change() { TLocalisamfile &firmfile= _firmrel->lfile(); - firmfile.put("CODDITTA", get_firm()); + firmfile.put(NDT_CODDITTA, get_firm()); _firmrel->read(); } -bool TStampaDoc_application::select() +KEY TStampaDoc_application::select() { TMask& m = *_selection_mask; @@ -2062,8 +2071,8 @@ bool TStampaDoc_application::select() if (_is_lista) reset_choices(m); - const bool ok = m.run() == K_ENTER; - if (ok) + const KEY k = m.run(); + if (k != K_QUIT) { if (!_is_lista) { @@ -2092,13 +2101,14 @@ bool TStampaDoc_application::select() else _key = BY_NUM_KEY; } - return ok; + return k; } void TStampaDoc_application::main_loop() { - while (select()) - print_selected(); + KEY k = K_ENTER; + while ((k = select()) != K_QUIT) + print_selected(k); } // Do all the work!