GME
13
|
00001 #if !defined(AFX_GMEPRINTDIALOG_H__2E29F7AF_AE75_4ED0_84DA_727658342D1E__INCLUDED_) 00002 #define AFX_GMEPRINTDIALOG_H__2E29F7AF_AE75_4ED0_84DA_727658342D1E__INCLUDED_ 00003 00004 #if _MSC_VER > 1000 00005 #pragma once 00006 #endif // _MSC_VER > 1000 00007 // GmePrintDialog.h : header file 00008 // 00009 00010 #include "GuiMeta.h" 00011 #include "GmeView.h" 00012 #include "PreviewWnd.h" 00013 #include <set> 00014 00015 using namespace std; 00016 00017 00019 // CGmePrintDialog dialog 00020 00021 class CGmePrintDialog : public CPrintDialog 00022 { 00023 // DECLARE_DYNAMIC(CGmePrintDialog) 00024 00025 public: 00026 CGmePrintDialog(CGMEView *view, CGuiMetaModel *guiMeta, BOOL bPrintSetupOnly, 00027 // TRUE for Print Setup, FALSE for Print Dialog 00028 DWORD dwFlags = 0, CWnd* pParentWnd = NULL); 00029 00030 //{{AFX_DATA(CGmePrintDialog) 00031 enum { IDD = IDD_PRINT_DIALOG }; 00032 CPreviewBtn m_demo; 00033 CStatic m_scaletxt; 00034 CButton m_aspSelBtn; 00035 CButton m_aspDeselBtn; 00036 CButton m_landBtn; 00037 CButton m_portBtn; 00038 CButton m_curraspBtn; 00039 CButton m_allaspBtn; 00040 CButton m_selaspBtn; 00041 CButton m_noheaderBtn; 00042 CSliderCtrl m_scaleslider; 00043 CListBox m_asplist; 00044 BOOL m_noheader; 00045 BOOL m_1page; 00046 BOOL m_autorotate; 00047 int m_scale; 00048 //}}AFX_DATA 00049 00050 bool IsPortrait() {return (m_autorotate)? m_autoPortrait: m_portrait;} 00051 bool IsAllAspect() {return m_selasp == ALL_ASP;} 00052 bool IsCurAspect() {return m_selasp == CUR_ASP;} 00053 bool IsSelAspect() {return m_selasp == SEL_ASP;} 00054 bool IsSelectedAspect(CString aspect); 00055 int NumOfSelAspects() 00056 { // if no selected, answers all of them selected 00057 if (m_selasp == CUR_ASP) 00058 return 1; 00059 else 00060 return m_selAspects.size(); 00061 } 00062 bool HasHeader() {return m_noheader == FALSE;} 00063 bool IsAutorotate() {return m_autorotate != FALSE;} 00064 bool IsFitOnePage() {return m_1page != FALSE;} 00065 int NumOfPages() {return m_scale;} 00066 00067 // Overrides 00068 // ClassWizard generated virtual function overrides 00069 //{{AFX_VIRTUAL(CGmePrintDialog) 00070 protected: 00071 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 00072 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); 00073 //}}AFX_VIRTUAL 00074 00075 BOOL OnInitDialog(); 00076 00077 private: 00078 bool m_portrait; 00079 bool m_autoPortrait; 00080 enum {CUR_ASP, ALL_ASP, SEL_ASP} m_selasp; 00081 CGuiMetaModel *m_guiMeta; 00082 CGMEView *m_gmeview; 00083 CRect m_previewrect; 00084 00085 typedef set<CString> AspectList; 00086 AspectList m_selAspects; 00087 00088 CDC *CreatePreviewBitmap(); 00089 00090 protected: 00091 //{{AFX_MSG(CGmePrintDialog) 00092 afx_msg void OnBtndeselect(); 00093 afx_msg void OnBtnselect(); 00094 afx_msg void OnXlandscape(); 00095 afx_msg void OnXportrait(); 00096 afx_msg void OnChknoheader(); 00097 afx_msg void OnFitto1page(); 00098 afx_msg void OnAutorotate(); 00099 afx_msg void OnSelasp1057(); 00100 afx_msg void OnAllasp1058(); 00101 afx_msg void OnCurasp1056(); 00102 afx_msg void OnReverse(); 00103 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 00104 virtual void OnOK(); 00105 //}}AFX_MSG 00106 DECLARE_MESSAGE_MAP() 00107 00108 }; 00109 00110 //{{AFX_INSERT_LOCATION}} 00111 // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 00112 00113 #endif // !defined(AFX_GMEPRINTDIALOG_H__2E29F7AF_AE75_4ED0_84DA_727658342D1E__INCLUDED_)