Patch level : 12.0 1070
Files correlati : ba8.exe Commento : Migliorato disegno sfondo generazione report
This commit is contained in:
parent
94d0d2311b
commit
463374db35
@ -2067,36 +2067,44 @@ void TReport_window::draw_field(const TReport_field& rf)
|
||||
void TReport_window::draw_bg()
|
||||
{
|
||||
const TReport_section& rs = curr_section();
|
||||
|
||||
if (_draw_bg && (rs.level() > 0 || rs.type() != 'B'))
|
||||
{
|
||||
const TReport_section* back = _report->find_section('B', 0);
|
||||
|
||||
if (back != NULL && back->items() > 0)
|
||||
{
|
||||
int offset_y = 0;
|
||||
if (rs.type() == 'F')
|
||||
{
|
||||
offset_y = back->height() - rs.height();
|
||||
}
|
||||
else
|
||||
{
|
||||
const int lev = rs.type() == 'B' ? _report->find_max_level('H') : rs.level()-1;
|
||||
for (int i = lev; i > 0; i--)
|
||||
{
|
||||
const TReport_section* h = _report->find_section('H', i);
|
||||
if (h != NULL)
|
||||
offset_y += h->compute_size().y/100;
|
||||
}
|
||||
}
|
||||
|
||||
update_thumb(origin().x, origin().y + offset_y);
|
||||
for (int i = 0; i < back->items(); i++)
|
||||
{
|
||||
const TReport_field& rf = back->field(i);
|
||||
draw_field(rf);
|
||||
}
|
||||
update_thumb(origin().x, origin().y - offset_y);
|
||||
}
|
||||
}
|
||||
if (rs.type() == 'F' && rs.height() > 0)
|
||||
offset_y = printer().formlen() - (rs.height() / 100);
|
||||
else
|
||||
{
|
||||
if (rs.pos_y() > 0)
|
||||
offset_y = rs.pos_y() / 100;
|
||||
else
|
||||
{
|
||||
const int lev = rs.type() == 'B' ? _report->find_max_level('H') : rs.level() -1 ;
|
||||
|
||||
for (int i = lev; i >= 0; i--)
|
||||
{
|
||||
const TReport_section* h = _report->find_section('H', i);
|
||||
if (h != nullptr)
|
||||
offset_y += (h->compute_size().y / 100) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
update_thumb(origin().x, origin().y + offset_y);
|
||||
for (int i = 0; i < back->items(); i++)
|
||||
{
|
||||
const TReport_field& rf = back->field(i);
|
||||
draw_field(rf);
|
||||
}
|
||||
update_thumb(origin().x, origin().y - offset_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TReport_window::update()
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include <report.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PRINTER_H
|
||||
#include <printer.h>
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TReport_tree
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -251,6 +251,8 @@ public:
|
||||
|
||||
int width() const { return _size.x; }
|
||||
int height() const { return _size.y; }
|
||||
int pos_x() const { return _pos.x; }
|
||||
int pos_y() const { return _pos.y; }
|
||||
void set_width(short w) { _size.x = w; }
|
||||
void set_height(short h) { _size.y = h; }
|
||||
const TReport_size& size() const { return _size; }
|
||||
@ -259,6 +261,8 @@ public:
|
||||
const TReport_pnt& pos() const { return _pos; }
|
||||
void set_pos(const TReport_pnt& p) { _pos = p; }
|
||||
|
||||
|
||||
|
||||
void set_fore_color(COLOR c) { _fgcolor = c; }
|
||||
COLOR fore_color() const { return _fgcolor; }
|
||||
void set_back_color(COLOR c) { _bgcolor = c; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user