ReportCreatorView.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 5k
Category:

Graph program

Development Platform:

Visual C++

  1. // ReportCreatorView.h : interface of the CReportCreatorView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__INCLUDED_)
  5. #define AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "ReportEditor/ReportEditor.h"
  10. #include "ReportEditor/HorzRuler.h"
  11. #include "ReportEditor/VertRuler.h"
  12. #include "ReportEditor/CornerBox.h"
  13. #include "ReportCreatorDoc.h"
  14. #include "Dialogs//ReportPagesPreviewDlg.h"
  15. struct MyEditor
  16. {
  17. CReportEditor* editor;
  18. CHorzRuler*    Horz_Ruler;
  19. CVertRuler*    Vert_Ruler;
  20. CCornerBox*    Corner_Box;
  21. MyEditor()
  22. {
  23. editor = NULL;
  24. Horz_Ruler = NULL;
  25. Vert_Ruler = NULL;
  26. Corner_Box = NULL;
  27. };
  28. };
  29. //class CReportPagesPreviewDlg;
  30. class CReportCreatorView : public CView
  31. {
  32. friend class CReportPagesPreviewDlg;
  33. protected: // create from serialization only
  34. CReportCreatorView();
  35. DECLARE_DYNCREATE(CReportCreatorView)
  36. // Attributes
  37. public:
  38. CReportCreatorDoc* GetDocument();
  39. void AddPage(CDiagramEntityContainer* cont, bool vertiacal, bool repaint=true);
  40. int  GetCurrentPage();
  41. void SetCurrentPage(int);
  42. // Operations
  43. public:
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CReportCreatorView)
  47. public:
  48. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  49. virtual void OnPrint(CDC* pDC, CPrintInfo*);
  50. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  51. virtual void OnInitialUpdate();
  52. protected:
  53. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  54. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  55. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. public:
  59. virtual ~CReportCreatorView();
  60. #ifdef _DEBUG
  61. virtual void AssertValid() const;
  62. virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64. protected:
  65. // Generated message map functions
  66. protected:
  67. //{{AFX_MSG(CReportCreatorView)
  68. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  69. afx_msg void OnSize(UINT nType, int cx, int cy);
  70. afx_msg void OnButtonSettings();
  71. afx_msg void OnButtonGrid();
  72. afx_msg void OnUpdateButtonGrid(CCmdUI* pCmdUI);
  73. afx_msg void OnButtonMargin();
  74. afx_msg void OnUpdateButtonMargin(CCmdUI* pCmdUI);
  75. afx_msg void OnButtonSnap();
  76. afx_msg void OnUpdateButtonSnap(CCmdUI* pCmdUI);
  77. afx_msg void OnButtonAddBox();
  78. afx_msg void OnButtonAddLabel();
  79. afx_msg void OnButtonAddLine();
  80. afx_msg void OnEditCopy();
  81. afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  82. afx_msg void OnEditCut();
  83. afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
  84. afx_msg void OnEditPaste();
  85. afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  86. afx_msg void OnEditUndo();
  87. afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  88. afx_msg void OnZoomIn();
  89. afx_msg void OnZoomOut();
  90. afx_msg void OnButtonAlignBottom();
  91. afx_msg void OnUpdateButtonAlignBottom(CCmdUI* pCmdUI);
  92. afx_msg void OnButtonAlignLeft();
  93. afx_msg void OnUpdateButtonAlignLeft(CCmdUI* pCmdUI);
  94. afx_msg void OnButtonAlignRight();
  95. afx_msg void OnUpdateButtonAlignRight(CCmdUI* pCmdUI);
  96. afx_msg void OnButtonAlignTop();
  97. afx_msg void OnUpdateButtonAlignTop(CCmdUI* pCmdUI);
  98. afx_msg void OnButtonSameSize();
  99. afx_msg void OnUpdateButtonSameSize(CCmdUI* pCmdUI);
  100. afx_msg void OnButtonZoomToFit();
  101. afx_msg void OnButtonProperties();
  102. afx_msg void OnButtonAddPicture();
  103. afx_msg void OnDestroy();
  104. afx_msg void OnDelete();
  105. afx_msg void OnInsert();
  106. //}}AFX_MSG
  107. LRESULT OnEditorHScroll( WPARAM, LPARAM );
  108. LRESULT OnEditorVScroll( WPARAM, LPARAM );
  109. LRESULT OnEditorZoom( WPARAM, LPARAM );
  110. LRESULT OnEditorMouse( WPARAM z, LPARAM );
  111. LRESULT OnRulerMeasurements( WPARAM, LPARAM );
  112. DECLARE_MESSAGE_MAP()
  113. private:
  114. CReportPagesPreviewDlg* m_pages_preview_dlg;
  115. public:
  116. void SetPagesPreviewDlg(CReportPagesPreviewDlg* nppd) {m_pages_preview_dlg = nppd;};
  117. private:
  118. // Private data
  119. std::vector<MyEditor> m_editors;
  120. int                     m_current_editor;
  121. int m_screenResolutionX;
  122. void SaveSettings();
  123. public:
  124. int  GetPagesCount() {return (int)m_editors.size();};
  125. virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
  126. afx_msg void OnReportAddPage();
  127. void   InsertPictureToPage(int,HENHMETAFILE,float leftPerc=0.0, 
  128. float topPerc=0.0,
  129. float WidthPerc=100.0, 
  130. float HeightPerc=100.0);
  131. };
  132. #ifndef _DEBUG  // debug version in ReportCreatorView.cpp
  133. inline CReportCreatorDoc* CReportCreatorView::GetDocument()
  134.    { return (CReportCreatorDoc*)m_pDocument; }
  135. #endif
  136. /////////////////////////////////////////////////////////////////////////////
  137. //{{AFX_INSERT_LOCATION}}
  138. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  139. #endif // !defined(AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__INCLUDED_)