view.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:4k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // [!output VIEW_HEADER] : interface of the [!output VIEW_CLASS] class
  2. //
  3. #pragma once
  4. [!if CONTAINER || CONTAINER_SERVER]
  5. class [!output CONTAINER_ITEM_CLASS];
  6. [!endif]
  7. [!if OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW]
  8. class [!output ROWSET_CLASS];
  9. [!endif]
  10. class [!output VIEW_CLASS] : public [!output VIEW_BASE_CLASS]
  11. {
  12. protected: // create from serialization only
  13. [!output VIEW_CLASS]();
  14. DECLARE_DYNCREATE([!output VIEW_CLASS])
  15. [!if OLEDB_RECORD_VIEW || FORM_VIEW || ODBC_RECORD_VIEW]
  16. public:
  17. enum{ IDD = IDD_[!output UPPER_CASE_SAFE_PROJECT_NAME]_FORM };
  18. [!if OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW]
  19. [!output ROWSET_CLASS]* m_pSet;
  20. [!endif]
  21. [!endif]
  22. // Attributes
  23. public:
  24. [!output DOC_CLASS]* GetDocument() const;
  25. [!if CONTAINER || CONTAINER_SERVER]
  26. [!if !RICH_EDIT_VIEW]
  27. // m_pSelection holds the selection to the current [!output CONTAINER_ITEM_CLASS].
  28. // For many applications, such a member variable isn't adequate to
  29. //  represent a selection, such as a multiple selection or a selection
  30. //  of objects that are not [!output CONTAINER_ITEM_CLASS] objects.  This selection
  31. //  mechanism is provided just to help you get started
  32. // TODO: replace this selection mechanism with one appropriate to your app
  33. [!output CONTAINER_ITEM_CLASS]* m_pSelection;
  34. [!endif]
  35. [!endif]
  36. // Operations
  37. public:
  38. // Overrides
  39. public:
  40. [!if OLEDB_RECORD_VIEW]
  41. virtual CRowset<>* OnGetRowset();
  42. [!endif]
  43. [!if ODBC_RECORD_VIEW]
  44. virtual CRecordset* OnGetRecordset();
  45. [!endif]
  46. [!if !TREE_VIEW && !LIST_VIEW && !HTML_VIEW && !HTML_EDITVIEW && !RICH_EDIT_VIEW && !EDIT_VIEW && !FORM_VIEW && !OLEDB_RECORD_VIEW && !ODBC_RECORD_VIEW]
  47. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  48. [!endif]
  49. [!if PRINTING]
  50. [!if TREE_VIEW || LIST_VIEW]
  51. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  52. [!endif]
  53. [!endif]
  54. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  55. protected:
  56. [!if FORM_VIEW || OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW]
  57. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  58. [!endif]
  59. [!if SCROLL_VIEW || CONTAINER || CONTAINER_SERVER || OLEDB_RECORD_VIEW || TREE_VIEW || LIST_VIEW || FORM_VIEW || HTML_VIEW || ODBC_RECORD_VIEW]
  60. virtual void OnInitialUpdate(); // called first time after construct
  61. [!endif]
  62. [!if PRINTING]
  63. [!if !HTML_VIEW && !HTML_EDITVIEW]
  64. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  65. [!endif]
  66. [!if !RICH_EDIT_VIEW && !HTML_VIEW && !HTML_EDITVIEW]
  67. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  68. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  69. [!endif]
  70. [!if FORM_VIEW || ACTIVE_DOC_CONTAINER]
  71. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  72. [!endif]
  73. [!endif]
  74. [!if CONTAINER || CONTAINER_SERVER]
  75. [!if !RICH_EDIT_VIEW]
  76. virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
  77. [!endif]
  78. [!endif]
  79. // Implementation
  80. public:
  81. virtual ~[!output VIEW_CLASS]();
  82. #ifdef _DEBUG
  83. virtual void AssertValid() const;
  84. virtual void Dump(CDumpContext& dc) const;
  85. #endif
  86. protected:
  87. // Generated message map functions
  88. protected:
  89. [!if CONTAINER || CONTAINER_SERVER]
  90. afx_msg void OnDestroy();
  91. [!if !RICH_EDIT_VIEW]
  92. afx_msg void OnSetFocus(CWnd* pOldWnd);
  93. afx_msg void OnSize(UINT nType, int cx, int cy);
  94. afx_msg void OnInsertObject();
  95. afx_msg void OnCancelEditCntr();
  96. afx_msg void OnFilePrint();
  97. [!endif]
  98. [!endif]
  99. [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER]
  100. afx_msg void OnCancelEditSrvr();
  101. [!endif]
  102. [!if PROJECT_STYLE_EXPLORER]
  103. [!if LIST_VIEW]
  104. afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
  105. [!endif]
  106. [!endif]
  107. [!if ACTIVE_DOC_CONTAINER]
  108. afx_msg void OnFilePrintPreview();
  109. afx_msg void OnFilePrintPreviewUIUpdate(CCmdUI* pCmdUI);
  110. [!endif]
  111. [!if HTML_EDITVIEW]
  112. DECLARE_DHTMLEDITING_CMDMAP([!output VIEW_CLASS])
  113. [!endif]
  114. DECLARE_MESSAGE_MAP()
  115. };
  116. #ifndef _DEBUG  // debug version in [!output VIEW_IMPL]
  117. inline [!output DOC_CLASS]* [!output VIEW_CLASS]::GetDocument() const
  118.    { return reinterpret_cast<[!output DOC_CLASS]*>(m_pDocument); }
  119. #endif