Patch level : 2.1 50
Files correlati : ba8 Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@12123 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a411b609ba
commit
94f7fc2db2
@ -871,8 +871,8 @@ void TReport_mask::on_print()
|
||||
#else
|
||||
TReport_book book;
|
||||
#endif
|
||||
book.add(_report);
|
||||
book.print_or_preview();
|
||||
if (book.add(_report))
|
||||
book.print_or_preview();
|
||||
}
|
||||
|
||||
TReport_section& TReport_mask::curr_section()
|
||||
|
@ -311,6 +311,7 @@ class TReport_window : public TField_window
|
||||
RCT _rct_drag;
|
||||
|
||||
TArray _clipboard;
|
||||
TReport_image_cache _images;
|
||||
|
||||
protected:
|
||||
virtual void handler(WINDOW win, EVENT* ep);
|
||||
@ -447,10 +448,37 @@ void TReport_window::snap_drag(PNT& pnt) const
|
||||
pnt.v = (pnt.v / ky) * ky;
|
||||
}
|
||||
|
||||
#define POPUP_CUT 20883
|
||||
#define POPUP_COPY 20884
|
||||
#define POPUP_PASTE 20885
|
||||
#define POPUP_DUP 20886
|
||||
#define POPUP_CLEAR 20887
|
||||
#define POPUP_PROPERTIES 20888
|
||||
#define POPUP_NEWFIELD 20889
|
||||
|
||||
bool TReport_window::on_key(KEY k)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
case K_LEFT:
|
||||
offset_selection(TPoint(-50, 0));
|
||||
force_update();
|
||||
return true;
|
||||
case K_RIGHT:
|
||||
offset_selection(TPoint(+50, 0));
|
||||
force_update();
|
||||
return true;
|
||||
case K_DOWN:
|
||||
offset_selection(TPoint(0, +50));
|
||||
force_update();
|
||||
return true;
|
||||
case K_UP:
|
||||
offset_selection(TPoint(0, -50));
|
||||
force_update();
|
||||
return true;
|
||||
case K_DEL:
|
||||
dispatch_e_menu(win(), POPUP_CUT);
|
||||
return true;
|
||||
case K_ENTER:
|
||||
owner().mask().send_key(K_SPACE, F_FLD_PROPERTIES);
|
||||
break;
|
||||
@ -472,14 +500,6 @@ bool TReport_window::on_key(KEY k)
|
||||
return TField_window::on_key(k);
|
||||
}
|
||||
|
||||
#define POPUP_CUT 20883
|
||||
#define POPUP_COPY 20884
|
||||
#define POPUP_PASTE 20885
|
||||
#define POPUP_DUP 20886
|
||||
#define POPUP_CLEAR 20887
|
||||
#define POPUP_PROPERTIES 20888
|
||||
#define POPUP_NEWFIELD 20889
|
||||
|
||||
void TReport_window::popup_menu(EVENT* ep)
|
||||
{
|
||||
MENU_ITEM menu[16]; // Stiamo larghi
|
||||
@ -740,6 +760,34 @@ void TReport_window::draw_grid()
|
||||
line(0, i*k, max*k, i*k);
|
||||
line(i*k, 0, i*k, max*k);
|
||||
}
|
||||
|
||||
const TReport_section& rs = curr_section();
|
||||
int y = rs.height();
|
||||
|
||||
if (y <= 0) // Sezione ad altezza variabile
|
||||
{
|
||||
for (int i = 0; i < rs.items(); i++)
|
||||
{
|
||||
const TReport_field& rf = rs.field(i);
|
||||
const int fy = rf.get_rect().bottom();
|
||||
if (fy > y) y = fy;
|
||||
}
|
||||
const int mod = y % 100;
|
||||
if (mod != 0) y += 100-mod;
|
||||
}
|
||||
if (y > 0) // Disegna barra di fine sezione
|
||||
{
|
||||
const PNT p = log2dev(0, y);
|
||||
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
|
||||
if (p.v < rct.bottom)
|
||||
{
|
||||
hide_pen();
|
||||
set_brush(COLOR_LTGRAY, PAT_DIAGCROSS);
|
||||
rct.top = p.v;
|
||||
xvt_dwin_draw_rect(win(), &rct);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TReport_window::draw_broken_paper(const TReport_field& rf)
|
||||
@ -792,7 +840,7 @@ void TReport_window::draw_field(const TReport_field& rf)
|
||||
TVariant var;
|
||||
_report->evaluate(rf.field(), var, _alfafld);
|
||||
const TString& name = var.as_string();
|
||||
const TImage* img = _report->image(name);
|
||||
const TImage* img = _images.image(name);
|
||||
if (img != NULL && img->ok())
|
||||
img->draw(win(), r);
|
||||
advanced_draw_rect(*this, r, rf.border(), rf.fore_color(), COLOR_WHITE);
|
||||
@ -878,30 +926,10 @@ void TReport_window::update()
|
||||
draw_grid(); // Disegna griglia
|
||||
|
||||
const TReport_section& rs = curr_section();
|
||||
int y = rs.height();
|
||||
const bool is_dynamic = y <= 0; // Sezione ad altezza variabile
|
||||
|
||||
for (int i = 0; i < rs.items(); i++)
|
||||
{
|
||||
const TReport_field& rf = rs.field(i);
|
||||
draw_field(rf);
|
||||
if (is_dynamic)
|
||||
{
|
||||
const int fy = rf.get_rect().bottom();
|
||||
if (fy > y) y = fy;
|
||||
}
|
||||
}
|
||||
|
||||
if (y > 0) // Disegna barra di fine sezione
|
||||
{
|
||||
if (is_dynamic)
|
||||
{
|
||||
const int mod = y % 100;
|
||||
if (mod != 0) y += 100-mod;
|
||||
}
|
||||
hide_pen();
|
||||
set_brush(COLOR_LTGRAY, PAT_DIAGCROSS);
|
||||
bar(0, y, 19600, 6600);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user