Patch level : 10.0
Files correlati : ba8 Ricompilazione Demo : [ ] Commento : Riassunto 0001600: Dopo la stampa di un report in orizz ritorna in visual con il foglio in vert. Faccio l'anteprima di un report creato con orientamento foglio orrizzontale fisso, dopo aver stampato ritorna in visualizzazione con l'orientamento del foglio impostato sulla stampante (normalmente in verticale) git-svn-id: svn://10.65.10.50/trunk@20331 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8b32b59892
commit
3e25e35ae6
@ -423,7 +423,9 @@ TInfo_mask::TInfo_mask() : TProperty_sheet(TR("Informazioni"))
|
||||
add_prop(TR("Libreria PDF"), printer);
|
||||
add_prop(TR("Libreria SQL"), strsql);
|
||||
#ifdef _MSC_VER
|
||||
add_prop(TR("Libreria C++"), format("%d %d.%d", _MSC_VER/100, _MSC_VER%100/10, _MSC_VER%10));
|
||||
const int cver = _MSC_VER / 100 - 6;
|
||||
const int csub = _MSC_VER % 100;
|
||||
add_prop(TR("Libreria C++"), format("Microsoft Visual Studio %d.%d", cver, csub));
|
||||
#endif
|
||||
|
||||
set_read_only();
|
||||
|
@ -608,13 +608,19 @@ bool TReport_section::execute_prescript(const TBook& book)
|
||||
|
||||
bool TReport_section::print_tools(TBook& book) const
|
||||
{
|
||||
const bool has_pen = border() > 0;
|
||||
const bool has_brush = pattern() >= PAT_SOLID && back_color() != COLOR_WHITE;
|
||||
const bool has_pen = border() > 0 && fore_color() != COLOR_INVALID;
|
||||
const bool has_brush = pattern() >= PAT_SOLID && back_color() != COLOR_WHITE || pattern() == PAT_SPECIAL;
|
||||
const bool visible = has_pen || has_brush;
|
||||
if (visible)
|
||||
{
|
||||
book.set_pen(fore_color(), border()-1);
|
||||
book.set_brush(back_color(), pattern());
|
||||
if (pattern() == PAT_SPECIAL)
|
||||
{
|
||||
book.set_text_color(fore_color(), back_color()); // Il background serve come base dello shading
|
||||
book.set_brush(shade_color(), pattern(), shade_angle());
|
||||
}
|
||||
else
|
||||
book.set_brush(back_color(), pattern());
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
@ -623,15 +629,13 @@ void TReport_section::print(TBook& book) const
|
||||
{
|
||||
if (shown() && active())
|
||||
{
|
||||
TReport_rct rct; compute_rect(rct);
|
||||
if (_size.x <= 0)
|
||||
rct.set_width(book.logical_page_width());
|
||||
if (type() == 'B' && level() <= 0)
|
||||
rct.set_height(book.logical_page_height());
|
||||
if (print_tools(book))
|
||||
{
|
||||
TReport_rct rct;
|
||||
compute_rect(rct);
|
||||
if (_size.x <= 0)
|
||||
rct.set_width(book.logical_page_width());
|
||||
if (type() == 'B' && level() <= 0)
|
||||
rct.set_height(book.logical_page_height());
|
||||
|
||||
if (radius() > 0)
|
||||
book.draw_round_rectangle(rct, radius());
|
||||
else
|
||||
@ -695,9 +699,18 @@ void TReport_section::save(TXmlItem& root) const
|
||||
if (radius() > 0)
|
||||
item.SetAttr("radius", radius());
|
||||
}
|
||||
if (pattern() != PAT_HOLLOW)
|
||||
item.SetAttr("pattern", pattern());
|
||||
|
||||
switch (pattern())
|
||||
{
|
||||
case PAT_HOLLOW:
|
||||
break;
|
||||
case PAT_SPECIAL:
|
||||
item.SetAttr("sh_angle", shade_angle());
|
||||
set_col_attr(item, "sh_color", shade_color(), COLOR_GRAY);
|
||||
// DO NOT break!
|
||||
default :
|
||||
item.SetAttr("pattern", pattern());
|
||||
break;
|
||||
}
|
||||
item.SetAttr("hidden", _hidden);
|
||||
item.SetAttr("deactivated", _deactivated);
|
||||
item.SetAttr("hidden_if_needed", hidden_if_needed());
|
||||
@ -753,6 +766,11 @@ void TReport_section::load(const TXmlItem& sec)
|
||||
set_radius(sec.GetIntAttr("radius"));
|
||||
set_back_color(get_col_attr(sec, "bg_color", COLOR_WHITE));
|
||||
set_fore_color(get_col_attr(sec, "fg_color", COLOR_BLACK));
|
||||
if (pattern() == PAT_SPECIAL)
|
||||
{
|
||||
set_shade_color(get_col_attr(sec, "sh_color", COLOR_GRAY));
|
||||
set_shade_angle(sec.GetIntAttr("sh_angle"));
|
||||
}
|
||||
|
||||
force_page_break(sec.GetBoolAttr("page_break"));
|
||||
can_break(sec.GetBoolAttr("can_break"));
|
||||
@ -882,8 +900,8 @@ TReport_section::TReport_section(TReport& r, char t, int l)
|
||||
_can_break(false), _keep_with_next(false),
|
||||
_repeat(false), _hidden(false), _deactivated(false),
|
||||
_font(NULL), _print_font(NULL), _recordset(NULL),
|
||||
_bgcolor(COLOR_WHITE), _fgcolor(COLOR_BLACK), _pattern(PAT_HOLLOW),
|
||||
_border(0), _radius(0)
|
||||
_bgcolor(COLOR_WHITE), _fgcolor(COLOR_BLACK), _shcolor(COLOR_GRAY), _pattern(PAT_HOLLOW),
|
||||
_border(0), _radius(0), _shade_angle(0)
|
||||
{ }
|
||||
|
||||
TReport_section::~TReport_section()
|
||||
@ -1216,9 +1234,10 @@ void TReport_field::copy(const TReport_field& rf)
|
||||
_type = rf.type();
|
||||
_rct = rf._rct;
|
||||
set_dynamic_height(rf.dynamic_height());
|
||||
_fgcolor = rf._fgcolor; _bgcolor = rf._bgcolor;
|
||||
_border = rf._border; _radius = rf._radius;
|
||||
_pattern = rf._pattern; _shade_offset = rf._shade_offset;
|
||||
_fgcolor = rf._fgcolor; _bgcolor = rf._bgcolor;
|
||||
_txcolor = rf._txcolor; _shcolor = rf._shcolor;
|
||||
_border = rf._border; _radius = rf._radius; _shade_angle = rf._shade_angle;
|
||||
_pattern = rf._pattern; _shadow_offset = rf._shadow_offset;
|
||||
_halign = rf._halign; _valign = rf._valign;
|
||||
_picture = rf._picture; _field = rf._field;
|
||||
_hidden = rf.hidden();
|
||||
@ -1465,7 +1484,13 @@ bool TReport_field::print_tools(TBook& book) const
|
||||
if (visible)
|
||||
{
|
||||
book.set_pen(fore_color(), border()-1);
|
||||
book.set_brush(back_color(), pattern());
|
||||
if (pattern() == PAT_SPECIAL)
|
||||
{
|
||||
book.set_text_color(text_color(), back_color());
|
||||
book.set_brush(shade_color(), pattern(), shade_angle());
|
||||
}
|
||||
else
|
||||
book.set_brush(back_color(), pattern());
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
@ -1494,13 +1519,14 @@ const TReport_rct& TReport_field::compute_draw_rect(const TBook& book)
|
||||
|
||||
const TReport_rct& TReport_field::print_rect(const TReport_rct& rect, TBook& book) const
|
||||
{
|
||||
if (pattern() == PAT_SOLID && shade_offset() != 0)
|
||||
const int off = shadow_offset();
|
||||
if (off != 0 && pattern() == PAT_SOLID) // Devo stampare l'ombra?
|
||||
{
|
||||
book.set_pen(COLOR_GRAY, 0);
|
||||
const COLOR color = blend_colors(section().back_color(), COLOR_BLACK, 0.5);
|
||||
book.set_pen(color, 0);
|
||||
book.set_brush(color, PAT_SOLID);
|
||||
TReport_rct rct = rect;
|
||||
rct += TReport_size(shade_offset(), shade_offset() * section().report().print_lpi() / print_font().cpi());
|
||||
rct += TReport_size(off, off * section().report().print_lpi() / print_font().cpi());
|
||||
if (radius() > 0)
|
||||
book.draw_round_rectangle(rct, radius());
|
||||
else
|
||||
@ -1514,6 +1540,7 @@ const TReport_rct& TReport_field::print_rect(const TReport_rct& rect, TBook& boo
|
||||
else
|
||||
book.draw_rectangle(rect);
|
||||
}
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
@ -1567,7 +1594,7 @@ void TReport_field::print(TBook& book) const
|
||||
{
|
||||
book.set_font(print_font());
|
||||
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
||||
book.set_text_color(fore_color(), back_color());
|
||||
book.set_text_color(text_color(), back_color());
|
||||
const TReport_rct& pr = print_rect(book);
|
||||
TString8 sec_code; section().code(sec_code);
|
||||
book.draw_text(pr, str, sec_code);
|
||||
@ -1637,7 +1664,7 @@ void TReport_field::print(TBook& book) const
|
||||
{
|
||||
book.set_font(print_font());
|
||||
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
||||
book.set_text_color(fore_color(), back_color());
|
||||
book.set_text_color(text_color(), back_color());
|
||||
TString8 sec_code; section().code(sec_code);
|
||||
|
||||
if (dynamic_height() || _rct.height() > 100) // Multiriga?
|
||||
@ -1712,6 +1739,8 @@ void TReport_field::save(TXmlItem& root) const
|
||||
fld.SetAttr("hide_zero", zeroes_hidden());
|
||||
set_col_attr(fld, "bg_color", back_color(), COLOR_WHITE);
|
||||
set_col_attr(fld, "fg_color", fore_color(), COLOR_BLACK);
|
||||
set_col_attr(fld, "txt_color", text_color(), fore_color());
|
||||
|
||||
if (has_font())
|
||||
_font->save(fld);
|
||||
if (in_group(0))
|
||||
@ -1736,10 +1765,20 @@ void TReport_field::save(TXmlItem& root) const
|
||||
if (radius() > 0)
|
||||
fld.SetAttr("radius", radius());
|
||||
}
|
||||
if (pattern() != PAT_SOLID)
|
||||
fld.SetAttr("pattern", pattern());
|
||||
else
|
||||
fld.SetAttr("shade_offset", shade_offset());
|
||||
|
||||
switch (pattern())
|
||||
{
|
||||
case PAT_HOLLOW:
|
||||
break;
|
||||
case PAT_SPECIAL:
|
||||
fld.SetAttr("sh_angle", shade_angle());
|
||||
set_col_attr(fld, "sh_color", shade_color(), COLOR_GRAY);
|
||||
// DO NOT break!
|
||||
default :
|
||||
fld.SetAttr("pattern", pattern());
|
||||
break;
|
||||
}
|
||||
|
||||
fld.SetAttr("text", picture());
|
||||
fld.SetAttr("codval", codval());
|
||||
fld.SetAttr("link", link());
|
||||
@ -1783,9 +1822,15 @@ bool TReport_field::load(const TXmlItem& fld)
|
||||
set_border(fld.GetIntAttr("border"));
|
||||
set_pattern((PAT_STYLE)fld.GetIntAttr("pattern", PAT_SOLID));
|
||||
set_radius(fld.GetIntAttr("radius"));
|
||||
set_shade_offset(fld.GetIntAttr("shade_offset"));
|
||||
set_shadow_offset(fld.GetIntAttr("shade_offset"));
|
||||
set_back_color(get_col_attr(fld, "bg_color", COLOR_WHITE));
|
||||
set_fore_color(get_col_attr(fld, "fg_color", COLOR_BLACK));
|
||||
set_text_color(get_col_attr(fld, "txt_color", fore_color()));
|
||||
if (pattern() == PAT_SPECIAL)
|
||||
{
|
||||
set_shade_color(get_col_attr(fld, "sh_color", COLOR_GRAY));
|
||||
set_shade_angle(fld.GetIntAttr("sh_angle"));
|
||||
}
|
||||
set_horizontal_alignment(get_chr_attr(fld, "align", 'L'));
|
||||
set_vertical_alignment(get_chr_attr(fld, "valign", 'T'));
|
||||
set_picture(fld.GetAttr("text"));
|
||||
@ -1876,9 +1921,10 @@ int TReport_field::compare(const TSortable& s) const
|
||||
|
||||
TReport_field::TReport_field(TReport_section* sec)
|
||||
: _section(sec), _id(0), _type('T'), _rct(0,0,1000,100),
|
||||
_fgcolor(COLOR_BLACK), _bgcolor(COLOR_WHITE), _pattern(PAT_HOLLOW),
|
||||
_radius(0), _shade_offset(0),
|
||||
_border(0), _halign('L'), _valign('T'),_dynamic_height(false),
|
||||
_txcolor(COLOR_BLACK), _fgcolor(COLOR_BLACK), _bgcolor(COLOR_WHITE),
|
||||
_shcolor(COLOR_GRAY), _pattern(PAT_HOLLOW),
|
||||
_radius(0), _shadow_offset(0), _shade_angle(0),
|
||||
_border(0), _halign('L'), _valign('T'), _dynamic_height(false),
|
||||
_font(NULL), _print_font(NULL),
|
||||
_hidden(false), _deactivated(false), _hide_zeroes(false), _selected(false),
|
||||
_draw_hidden(false), _draw_deactivated(false)
|
||||
@ -2787,7 +2833,6 @@ KEY TReport::run_form(TMask& m)
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
KEY TReport::run_form(const TString& maskname)
|
||||
{
|
||||
TFilename fname = maskname; fname.ext("msk");
|
||||
|
@ -220,8 +220,8 @@ class TReport_section : public TArray
|
||||
TString _condition, _groupby;
|
||||
bool _page_break, _hidden_if_needed, _can_break, _keep_with_next, _repeat;
|
||||
bool _hidden, _deactivated;
|
||||
COLOR _fgcolor, _bgcolor;
|
||||
int _border, _radius;
|
||||
COLOR _fgcolor, _bgcolor, _shcolor;
|
||||
int _border, _radius, _shade_angle;
|
||||
PAT_STYLE _pattern;
|
||||
TReport_script _prescript, _postscript;
|
||||
|
||||
@ -260,12 +260,17 @@ public:
|
||||
COLOR fore_color() const { return _fgcolor; }
|
||||
void set_back_color(COLOR c) { _bgcolor = c; }
|
||||
COLOR back_color() const { return _bgcolor; }
|
||||
void set_shade_color(COLOR c) { _shcolor = c; }
|
||||
COLOR shade_color() const { return _shcolor; }
|
||||
|
||||
void set_border(int b) { _border = b; }
|
||||
short border() const { return _border; }
|
||||
void set_pattern(PAT_STYLE p) { _pattern = p; }
|
||||
PAT_STYLE pattern() const { return _pattern; }
|
||||
void set_radius(int r) { _radius = r; }
|
||||
short radius() const { return _radius; }
|
||||
int radius() const { return _radius; }
|
||||
void set_shade_angle(int a) { _shade_angle = a; }
|
||||
int shade_angle() const { return _shade_angle; }
|
||||
|
||||
bool page_break() const { return _page_break; }
|
||||
void force_page_break(bool pb) { _page_break = pb; }
|
||||
@ -334,8 +339,8 @@ class TReport_field : public TSortable
|
||||
int _id;
|
||||
char _type; // Text, String, Numeric, Price, Valuta, Date, Boolean, Line, Rectangle, Image
|
||||
TReport_rct _rct; // In centesimi
|
||||
COLOR _fgcolor, _bgcolor;
|
||||
int _border, _radius, _shade_offset;
|
||||
COLOR _fgcolor, _bgcolor, _txcolor, _shcolor; // Foreground (pen), background (brush), text, shadow
|
||||
int _border, _radius, _shadow_offset, _shade_angle;
|
||||
PAT_STYLE _pattern;
|
||||
char _halign, _valign;
|
||||
bool _dynamic_height;
|
||||
@ -440,7 +445,6 @@ public:
|
||||
const TString& groups() const;
|
||||
bool in_group(int group) const;
|
||||
|
||||
|
||||
void set_codval(const char* cod) { _codval = cod; }
|
||||
const TString& codval() const { return _codval; }
|
||||
void set_link(const char* l) { _link = l; }
|
||||
@ -450,6 +454,10 @@ public:
|
||||
COLOR fore_color() const { return _fgcolor; }
|
||||
void set_back_color(COLOR c) { _bgcolor = c; }
|
||||
COLOR back_color() const { return _bgcolor; }
|
||||
void set_text_color(COLOR c) { _txcolor = c; }
|
||||
COLOR text_color() const { return _txcolor; }
|
||||
void set_shade_color(COLOR c) { _shcolor = c; }
|
||||
COLOR shade_color() const { return _shcolor; }
|
||||
COLOR link_color() const;
|
||||
|
||||
void set_border(int b) { _border = b; }
|
||||
@ -458,8 +466,10 @@ public:
|
||||
PAT_STYLE pattern() const { return _pattern; }
|
||||
void set_radius(int r) { _radius = r; }
|
||||
short radius() const { return _radius; }
|
||||
void set_shade_offset(int s) { _shade_offset = s; }
|
||||
short shade_offset() const { return _shade_offset; }
|
||||
void set_shadow_offset(int s) { _shadow_offset = s; }
|
||||
int shadow_offset() const { return _shadow_offset; }
|
||||
void set_shade_angle(int a) { _shade_angle = a; }
|
||||
int shade_angle() const { return _shade_angle; }
|
||||
|
||||
void set_horizontal_alignment(char a) { _halign = a; }
|
||||
char horizontal_alignment() const { return _halign; }
|
||||
|
@ -1074,13 +1074,17 @@ void TBook::set_pen(COLOR color, int width, PEN_STYLE style)
|
||||
}
|
||||
}
|
||||
|
||||
void TBook::set_brush(COLOR color, PAT_STYLE pattern)
|
||||
void TBook::set_brush(COLOR color, PAT_STYLE pattern, int shade_angle)
|
||||
{
|
||||
if (_tools.brush.color != color || _tools.brush.pat != pattern)
|
||||
if (_tools.brush.color != color || _tools.brush.pat != pattern || shade_angle != _shade_angle)
|
||||
{
|
||||
_tools.brush.color = color;
|
||||
_tools.brush.pat = pattern;
|
||||
*_out << "<brush color=" << color << " pattern=" << pattern << " />" << endl;
|
||||
_shade_angle = shade_angle;
|
||||
*_out << "<brush color=" << color << " pattern=" << pattern;
|
||||
if (pattern == PAT_SPECIAL)
|
||||
*_out << " shade_angle=" << shade_angle;
|
||||
*_out << " />" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1242,6 +1246,7 @@ bool TBook::print_page(TWindow& win, size_t page)
|
||||
|
||||
WINDOW w = win.win();
|
||||
const bool preview = w != PRINTER_WIN;
|
||||
int shade_angle = 0;
|
||||
RCT visible;
|
||||
if (preview)
|
||||
{
|
||||
@ -1351,13 +1356,14 @@ bool TBook::print_page(TWindow& win, size_t page)
|
||||
}
|
||||
if (str.starts_with("<brush "))
|
||||
{
|
||||
// <brush color=%u pattern=%u />
|
||||
// <brush color=%u pattern=%u shade_angle=%d />
|
||||
const COLOR col = str.get_long(1);
|
||||
const PAT_STYLE pat = (PAT_STYLE)str.get_long();
|
||||
if (pat <= PAT_HOLLOW)
|
||||
win.hide_brush();
|
||||
else
|
||||
win.set_brush(col, pat);
|
||||
shade_angle = (pat == PAT_SPECIAL) ? str.get_int() : 0;
|
||||
continue;
|
||||
}
|
||||
if (str.starts_with("<clip"))
|
||||
@ -1457,7 +1463,21 @@ bool TBook::print_page(TWindow& win, size_t page)
|
||||
}
|
||||
if (str == "<rectangle/>")
|
||||
{
|
||||
xvt_dwin_draw_rect(w, &rct);
|
||||
DRAW_CTOOLS ct; xvt_dwin_get_draw_ctools(w, &ct);
|
||||
if (ct.brush.pat == PAT_SPECIAL)
|
||||
{
|
||||
if (shade_angle >= 0)
|
||||
xvt_dwin_draw_gradient_linear(w, &rct, ct.back_color, ct.brush.color, shade_angle);
|
||||
else
|
||||
xvt_dwin_draw_gradient_circular(w, &rct, ct.back_color, ct.brush.color, NULL);
|
||||
if (ct.pen.style != PAT_HOLLOW)
|
||||
{
|
||||
win.hide_brush();
|
||||
xvt_dwin_draw_rect(w, &rct);
|
||||
}
|
||||
}
|
||||
else
|
||||
xvt_dwin_draw_rect(w, &rct);
|
||||
continue;
|
||||
}
|
||||
if (str.starts_with("<rounded_rectangle"))
|
||||
@ -1834,17 +1854,10 @@ bool TBook::export_excel(TFilename& fname, bool signature)
|
||||
|
||||
bool TBook::init()
|
||||
{
|
||||
long ph, pw, pvr, phr;
|
||||
|
||||
if (is_pdf())
|
||||
{
|
||||
int size;
|
||||
_rcd = xvt_print_create_by_name(&size, XVT_PDF_PRINTER_NAME);
|
||||
if (_page_size.x > _page_size.y) // width > height -> landscape
|
||||
{
|
||||
ph = _page_size.y; pw = _page_size.x;
|
||||
xvt_app_escape (XVT_ESC_SET_PRINTER_INFO, _rcd, &ph, &pw, NULL, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
_rcd = printer().get_printrcd();
|
||||
@ -1852,13 +1865,19 @@ bool TBook::init()
|
||||
if (!xvt_print_is_valid(_rcd))
|
||||
return error_box(TR("Stampante non valida"));
|
||||
|
||||
long ph, pw, pvr, phr;
|
||||
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _rcd, &ph, &pw, &pvr, &phr);
|
||||
|
||||
if (pw <= 0 || ph <= 0)
|
||||
return error_box(TR("Dimensioni pagina NULLE"));
|
||||
if (pvr <= 0 || phr <= 0)
|
||||
return error_box(TR("Risoluzione stampante NULLA"));
|
||||
|
||||
if (_page_size.x > 0 && (_page_size.x > _page_size.y) != (pw > ph)) // Orientamento incongruente
|
||||
{
|
||||
xvt_app_escape (XVT_ESC_SET_PRINTER_INFO, _rcd, &pw, &ph, NULL, NULL); // Scambio dimensioni
|
||||
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _rcd, &ph, &pw, &pvr, &phr); // Rileggo dimensioni e risoluzione
|
||||
}
|
||||
|
||||
_page_size.y = ph * BOOKDPI / pvr;
|
||||
_page_size.x = pw * BOOKDPI / phr;
|
||||
|
||||
@ -2121,9 +2140,7 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies)
|
||||
|
||||
if (p.printtype() == acrobatprinter)
|
||||
{
|
||||
TFilename f;
|
||||
f.tempdir(); f.add("tmp.pdf");
|
||||
f.fremove();
|
||||
TFilename f; f.temp(NULL, "pdf");
|
||||
_pdf_file = f;
|
||||
ok = xvt_print_start_thread(main_loop_callback, (long)this) != 0;
|
||||
if (ok && fsize(f) > 0)
|
||||
@ -2143,7 +2160,10 @@ bool TBook::export_pdf(TFilename& filename, bool signature)
|
||||
bool ok = (pages() > 0) && main_app().has_module(RSAUT); // Controllo paranoico dei permessi
|
||||
if (ok)
|
||||
{
|
||||
filename.fremove(); // Evita problemi di aggiornamento del pdf: deve sempre rigeneralo!
|
||||
// Evita problemi di aggiornamento del pdf: deve sempre rigeneralo!
|
||||
if (filename.exist() && !filename.fremove())
|
||||
return error_box(FR("Impossibile riscrivere %s"), (const char*)filename);
|
||||
|
||||
_pdf_file = filename;
|
||||
_pagefrom = 1;
|
||||
_pageto = 0;
|
||||
@ -2236,8 +2256,8 @@ bool TBook::preview()
|
||||
|
||||
TPreview_mask msk(this);
|
||||
|
||||
//gestino anteprima di stampa;se si ha l'anteprima,una volta lanciata la maschera di stampa, si torna..
|
||||
//..all'anteprima e non alla maschera del programma (decisivo per stampe con elaborazione lunga)
|
||||
// gestione anteprima di stampa;se si ha l'anteprima,una volta lanciata la maschera di stampa, si torna
|
||||
// all'anteprima e non alla maschera del programma (decisivo per stampe con elaborazione lunga)
|
||||
bool go_on = true;
|
||||
while (go_on)
|
||||
{
|
||||
@ -2337,7 +2357,6 @@ void TPrintind::update_bar()
|
||||
}
|
||||
|
||||
TPrintind::TPrintind(long n, const char* msg) : TProgind(n, msg, true, true)
|
||||
|
||||
{
|
||||
if (ADVANCED_GRAPHICS)
|
||||
{
|
||||
@ -2701,7 +2720,6 @@ void TReport_book::add_doc(const TString& name)
|
||||
TBook::add_doc(name);
|
||||
}
|
||||
|
||||
|
||||
bool TReport_book::add(TReport& rep, bool progind)
|
||||
{
|
||||
if (!init(rep))
|
||||
|
@ -21,6 +21,8 @@ class TBook : public TObject
|
||||
TReport_font _font;
|
||||
TRectangle _rect;
|
||||
char _horizontal_alignment, _vertical_alignment;
|
||||
int _shade_angle;
|
||||
|
||||
TReport_image_cache _images;
|
||||
|
||||
size_t _pagefrom, _pageto;
|
||||
@ -58,7 +60,7 @@ public:
|
||||
|
||||
virtual const TFilename & file() const { return _file;}
|
||||
virtual void set_pen(COLOR color, int width = 0, PEN_STYLE style = P_SOLID);
|
||||
virtual void set_brush(COLOR color, PAT_STYLE pattern = PAT_SOLID);
|
||||
virtual void set_brush(COLOR color, PAT_STYLE pattern = PAT_SOLID, int shade_angle = 0);
|
||||
virtual void set_font(const TReport_font& font);
|
||||
virtual void set_text_color(COLOR fore, COLOR back = COLOR_WHITE, bool opaque = false);
|
||||
virtual void set_text_align(char halign ='L', char valign = 'T');
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <applicat.h>
|
||||
#include <diction.h>
|
||||
#include <reputils.h>
|
||||
#include <textset.h>
|
||||
@ -101,6 +102,8 @@ TAS400_report::TAS400_report(TRecordset& asr)
|
||||
void TLog_report::set_title(const char* title)
|
||||
{
|
||||
_title = title;
|
||||
if (_title.blank())
|
||||
_title = main_app().title();
|
||||
}
|
||||
|
||||
bool TLog_report::get_usr_val(const TString& name, TVariant& var) const
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
void set_title(const char* title);
|
||||
void kill_duplicates(bool k = true) {_kill_duplicates = k;}
|
||||
const TString& title() const { return _title; }
|
||||
TLog_report(const char* title, const char* name = "bagn010a");
|
||||
TLog_report(const char* title = "", const char* name = "bagn010a");
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -321,17 +321,17 @@ bool cf_check (
|
||||
HIDDEN bool _cf_val(TMask_field& f, KEY key)
|
||||
{
|
||||
if (f.mask().query_mode())
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
const TString& cf = f.get();
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
|
||||
if (cf.empty()) return TRUE;
|
||||
if (cf.empty()) return true;
|
||||
if (cf.len() == 11 && isdigit(cf[0]))
|
||||
{
|
||||
const TString& stato = f.mask().get(atoi(get_val_param(0)));
|
||||
if (stato.full() && stato != "IT")
|
||||
return TRUE;
|
||||
return true;
|
||||
ok = pi_check (stato, cf);
|
||||
}
|
||||
else
|
||||
@ -341,7 +341,7 @@ HIDDEN bool _cf_val(TMask_field& f, KEY key)
|
||||
if(f.dirty())
|
||||
{
|
||||
ok = f.yesno_box(TR("Codice fiscale errato: lo accetto ugualmente?"));
|
||||
if (ok) f.set_dirty(FALSE);
|
||||
if (ok) f.set_dirty(false);
|
||||
}
|
||||
else
|
||||
ok = true; // Era gia' errato al caricamento quindi lo accetto
|
||||
@ -483,7 +483,9 @@ HIDDEN bool _xt_cf_val(TMask_field& f, KEY key)
|
||||
const int mn = wm.find(cf[8]) + 1;
|
||||
if (mn > 0)
|
||||
{
|
||||
const TDate d(gn, mn, 1900 + atoi(cf.mid(6, 2)));
|
||||
int anno = atoi(cf.mid(6, 2));
|
||||
anno += anno < 5 ? 2000 : 1900;
|
||||
const TDate d(gn, mn, anno);
|
||||
fld_dat.set(d.string());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user