Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunta gestione limiti di stampa git-svn-id: svn://10.65.10.50/trunk@11947 c028cbd2-c16b-5b4b-a496-9718f37d4682
90 lines
2.3 KiB
C++
Executable File
90 lines
2.3 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;
|
|
|
|
// Called by print(bool)
|
|
virtual bool do_print();
|
|
virtual bool do_preview();
|
|
|
|
public:
|
|
bool main_loop(); // Internal use only
|
|
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; }
|
|
|
|
virtual bool print(bool preview = false);
|
|
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:
|
|
virtual bool print(bool preview = false);
|
|
|
|
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
|