From 2e72dcdc4b30a5ede7c40138dd8ff946af7ba111 Mon Sep 17 00:00:00 2001 From: mjjo Date: Sat, 20 Jul 2013 23:27:29 +0000 Subject: [PATCH] --- Common/LCPrinter.h | 110 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Common/LCPrinter.h diff --git a/Common/LCPrinter.h b/Common/LCPrinter.h new file mode 100644 index 0000000..77f0be8 --- /dev/null +++ b/Common/LCPrinter.h @@ -0,0 +1,110 @@ +/*=========================================================================== +==== ==== +==== ==== +============================================================================= +==== ==== +==== File : LCPrinter.h ==== +==== Project name : ==== +==== Project number : ==== +==== Creation date : 14/10/2000 ==== +==== ==== +==== ==== +============================================================================= +===========================================================================*/ + +#ifndef LCPRINTER_H +#define LCPRINTER_H +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + + +//============================================================================ +// Inclusions +//============================================================================ + + +//============================================================================ +// Constants +//============================================================================ + + +//============================================================================ +//============================================================================ +// classe CLCPrinter +/*============================================================================ + +=============================================================================*/ +class CLCPrinter +{ + +//============================================================================ +// Data types +//============================================================================ + public: + +//============================================================================ +// Creators +//============================================================================ + public: + CLCPrinter(); + + private: // Not implemented functions + CLCPrinter &operator = (const CLCPrinter&); + CLCPrinter(const CLCPrinter&); + +//============================================================================ +// Member functions +//============================================================================ + +// Implementation + public: + void OnBeginPrinting(CDC* pDC, + CPrintInfo* pInfo, + const CString& titleStr, + const CString& dateStr); + + void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); + BOOL OnPreparePrinting(CPrintInfo* pInfo, + CView* pView, + CListCtrl* pLC); + void OnPrint(CDC* pDC, CPrintInfo* pInfo); + +// Protected functions + protected: + void ComputeMetrics(CDC *pDC); + void DrawLineAt(CDC *pDC, unsigned int y); + void DrawRow(CDC *pDC, int nItem); + void PrintFooter(CDC *pDC, CPrintInfo *pInfo); + void PrintHeader(CDC *pDC, CPrintInfo *pInfo); + void PrintHeaderControl(CDC *pDC, CPrintInfo *pInfo); + +//============================================================================ +// Member variables +//============================================================================ +protected: + // List Control Pointer + CListCtrl* m_pLC; + + CString m_titleStr; + CString m_dateStr; + + // Font stuff + CFont* m_pOldFont; + CFont m_boldFont; + CFont m_lcFont; + + // Scaling Variables + CRect m_page_rc; + int m_nRowHeight; + int m_nRowsPerPage; + int m_nMaxRowCount; + int m_hcItems; + + // Scaling output to the printer + unsigned int m_ratiox; + unsigned int m_ratioy; +}; + +#endif // LCPRINTER_H +