campo-sirio/ba/ba8303.h
guy 1b1b938a7a Patch level : 2.1 nopatch
Files correlati     : ba8.exe
Ricompilazione Demo : [ ]
Commento            :

Anteprima di stampa nuovi report


git-svn-id: svn://10.65.10.50/trunk@11933 c028cbd2-c16b-5b4b-a496-9718f37d4682
2004-04-02 16:09:20 +00:00

85 lines
2.2 KiB
C++
Executable File

#ifndef __REPRINT_H
#define __REPRINT_H
#ifndef __REPORT_H
#include "ba8302.h"
#endif
class TPage_printer : public TWindow
{
PRINT_RCD* _rcd;
long _pw, _ph, _phr, _pvr; // Printer width, height, horizontal and vertical resolution
protected:
word _copies, _pagefrom, _pageto, _page, _lastprinted;
bool _page_is_open;
TMask* _preview_mask; // owned object
TWindow* _preview_window; // referenced object
virtual word pages() const { return 0; }
virtual bool print_loop() pure;
private:
virtual TPoint dev2log(const PNT& p) const; // Never use this!
protected:
virtual PNT log2dev(long lx, long ly) const; // Always override this!
virtual const char* form_name() const;
virtual const char* font_name() const;
virtual int font_size() const;
virtual bool ask_pages();
virtual bool open_page();
virtual bool close_page();
bool page_in_range() const;
public:
bool main_loop(); // Internal use only
virtual bool print(); // Use this ...
virtual bool preview(); // ... and this
virtual void print_page(word page); // Inefficient default implementation
virtual TPoint page_size() const;
virtual TPoint page_res() const;
virtual word last_printed_page() { return _lastprinted; }
bool print_mode() const { return _preview_mask == NULL; }
bool preview_mode() const { return _preview_mask != NULL; }
TPage_printer();
virtual ~TPage_printer();
};
class TReport_printer : public TPage_printer
{
TReport& _report;
TPoint _delta;
long _logical_page_height;
long _logical_foot_pos;
bool _is_last_page, _page_break_allowed;
protected:
virtual const char* form_name() const;
virtual const char* font_name() const;
virtual int font_size() const;
virtual PNT log2dev(long x, long y) const;
virtual bool print_loop();
virtual bool open_page();
virtual bool close_page();
long print_section(TReport_section& rs);
long print_section(char type, int level);
public:
TReport_printer(TReport& r) : _report(r) { }
};
void advanced_draw_rect(TWindow& win, const RCT& r, int border, COLOR fore, COLOR back);
void advanced_draw_text(TWindow& win, const char* text, const RCT& r,
char halign, char valign);
#endif