Patch level : 2.1 nopatch

Files correlati     : ba8
Ricompilazione Demo : [ ]
Commento            :

Corretto salvataggio parametri sezione:
forza salto pagina e mantinei col successivo


git-svn-id: svn://10.65.10.50/trunk@12004 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-04-27 16:05:40 +00:00
parent dbc8341d80
commit 1a048a256d
6 changed files with 25 additions and 3 deletions

View File

@ -486,6 +486,7 @@ void TSection_properties_mask::vedo_non_vedo()
show(F_X, level == 0 && type != 'H');
show(F_Y, level == 0 && type != 'H');
show(F_GROUP_BY, type == 'H' && level > 1);
show(F_KEEP_WITH_NEXT, level > 1 && type == 'H');
show(F_HIDE_IF_NEEDED, level == 0 && type != 'B');
enable(DLG_DELREC, level > 1);
}
@ -530,6 +531,9 @@ void TSection_properties_mask::set_section(const TReport_section& rs)
set(F_GROUP_BY, rs.grouped_by());
set(F_HIDE_IF_NEEDED, rs.hidden_if_needed() ? "X" : "");
set(F_HIDDEN, rs.hidden() ? "X" : "");
set(F_PAGE_BREAK, rs.page_break());
set(F_KEEP_WITH_NEXT, rs.keep_with_next());
set(F_DISABLED, rs.deactivated() ? "X" : "");
set_font_info(rs.font());
@ -553,6 +557,8 @@ void TSection_properties_mask::get_section(TReport_section& rs) const
rs.group_by(get(F_GROUP_BY));
rs.hide_if_needed(get_bool(F_HIDE_IF_NEEDED));
rs.force_page_break(get_bool(F_PAGE_BREAK));
rs.keep_with_next(get_bool(F_KEEP_WITH_NEXT));
TReport_font f;
if (get_font_info(f))

View File

@ -37,6 +37,7 @@
#define F_GROUP_BY 161
#define F_HIDE_IF_NEEDED 162
#define F_PAGE_BREAK 163
#define F_KEEP_WITH_NEXT 164
#define F_SQL 201
#define F_IMPORT_QRY 202

View File

@ -56,6 +56,11 @@ BEGIN
PROMPT 1 5 "Forza salto pagina"
END
BOOLEAN F_KEEP_WITH_NEXT
BEGIN
PROMPT 21 5 "Mantieni col successivo"
END
BOOLEAN F_HIDE_IF_NEEDED
BEGIN
// Visibile per testa e coda di pagina

View File

@ -598,6 +598,7 @@ void TReport_section::save(TXmlItem& root) const
item.SetAttr("deactivated", _deactivated);
item.SetAttr("hidden_if_needed", hidden_if_needed());
item.SetAttr("pagebreak", _page_break);
item.SetAttr("keep_with_next", keep_with_next());
if (grouped_by().not_empty())
item.AddChild("groupby") << grouped_by();
if (has_font())
@ -619,6 +620,7 @@ void TReport_section::load(const TXmlItem& sec)
set_width(get_num_attr(sec, "width"));
set_height(get_num_attr(sec, "height"));
force_page_break(sec.GetBoolAttr("pagebreak"));
keep_with_next(sec.GetBoolAttr("keep_with_next"));
hide_if_needed(sec.GetBoolAttr("hidden_if_needed"));
show(!sec.GetBoolAttr("hidden"));
activate(!sec.GetBoolAttr("deactivated"));

View File

@ -147,7 +147,8 @@ class TReport_section : public TArray
TPoint _pos; // Posizione assoluta in centesimi, default (0,0)
TPoint _size; // Dimensioni in centesimi, default (0,0)
TString _groupby;
bool _page_break, _hidden_if_needed, _hidden, _deactivated;
bool _page_break, _hidden_if_needed, _keep_with_next;
bool _hidden, _deactivated;
TReport_script _prescript, _postscript;
TReport_font* _font;
@ -186,6 +187,8 @@ public:
bool hidden_if_needed() const { return _hidden_if_needed; }
void hide_if_needed(bool h) { _hidden_if_needed = h; }
bool keep_with_next() const { return _keep_with_next; }
void keep_with_next(bool k) { _keep_with_next = k; }
bool hidden() const { return _hidden; }
bool shown() const { return !hidden(); }
void show(bool on) { _hidden = !on; }

View File

@ -737,7 +737,12 @@ long TReport_printer::print_section(TReport_section& rs)
{
bool page_break = _page_break_allowed && rs.page_break();
if (!page_break)
page_break = (_delta.y + height > _logical_foot_pos);
{
long h = height;
if (rs.keep_with_next())
h += rs.report().section('B', 1).compute_size().y;
page_break = (_delta.y + h > _logical_foot_pos);
}
if (page_break && rs.level() > 0) // Avoid recursion
{
close_page();
@ -767,7 +772,7 @@ bool TReport_printer::print_loop()
const TPoint siz = page_size();
const TPoint res = page_res();
const double pollici_pagina_y = (double)siz.y / (double)res.y;
const double righe_pagina = pollici_pagina_y * _report.lpi();
const double righe_pagina = pollici_pagina_y * _report.lpi();
_logical_page_height = long(righe_pagina*100.0);
const double pollici_pagina_x = (double)siz.x / (double)res.x;