PrintPreviewListBox.h
上传用户:hicheon
上传日期:2007-02-06
资源大小:34k
文件大小:3k
源码类别:
ListView/ListBox
开发平台:
Visual C++
- #if !defined(AFX_PRINTPREVIEWLISTBOX_H__2387B38F_AA48_4B5C_A515_C9E487058728__INCLUDED_)
- #define AFX_PRINTPREVIEWLISTBOX_H__2387B38F_AA48_4B5C_A515_C9E487058728__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // PrintPreviewListBox.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CPrintPreviewListBox window
- #include <afxtempl.h>
- /*****************************************************************************/
- /* */
- /* .CLASSNAME: [CPrintPreviewListBox ] */
- /* */
- /* .BASECLASSNAMES: */
- /* CListBox, ..... */
- /* */
- /* .DESCRIPTION: */
- /* ....... */
- /* */
- /* .REPORT */
- /* dd.mm.yy Goran Extended CListBox class */
- /* ........ ......... ................................................... */
- /* */
- /*****************************************************************************/
- class CPrintPreviewListBox : public CListBox
- {
- CFont m_printerFont;
- UINT m_cyPrinter;
- UINT m_nLinesPerPage;
- UINT m_nLinesTotal;
- UINT m_cxOffset;
- UINT m_cxWidth;
- CString m_strTitle;
- bool m_bPrintOnlySelectedItems;
- bool m_bIsMultiselection;
- CArray<int,int> aryListBoxSel;
- CStringArray m_strarFinalArray;
- protected:
- virtual int SetLinesTotal();
- void LineBreaking( CString sSelectedItem );
- virtual void PrintPageHeader (CDC*, UINT);
- virtual void PrintPage (CDC*, UINT);
- // Construction
- public:
- CPrintPreviewListBox();
- DECLARE_DYNCREATE(CPrintPreviewListBox)
- // Attributes
- public:
- // Operations
- public:
- void Print();
- void SetPrintTitle( CString sNewTitle = "Default title" );
- CString GetPrintTitle();
- void SetOnlySelectedItems( bool bOnlySelectedItems );
- bool GetOnlySelectedItems();
- virtual void OnBeginPrinting (CDC*, CPrintInfo*);
- virtual void OnPrint (CDC*, CPrintInfo*);
- virtual void OnEndPrinting (CDC*, CPrintInfo*);
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPrintPreviewListBox)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CPrintPreviewListBox();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CPrintPreviewListBox)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /*****************************************************************************/
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_PRINTPREVIEWLISTBOX_H__2387B38F_AA48_4B5C_A515_C9E487058728__INCLUDED_)
English
