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

对话框与窗口

开发平台:

Visual C++

  1. // RibbonSampleDoc.cpp : implementation of the CRibbonSampleDoc class
  2. //
  3. #include "stdafx.h"
  4. #include "RibbonSample.h"
  5. #include "RibbonSampleDoc.h"
  6. #include "CntrItem.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CRibbonSampleDoc
  14. IMPLEMENT_DYNCREATE(CRibbonSampleDoc, CRichEditDoc)
  15. BEGIN_MESSAGE_MAP(CRibbonSampleDoc, CRichEditDoc)
  16. //{{AFX_MSG_MAP(CRibbonSampleDoc)
  17. // NOTE - the ClassWizard will add and remove mapping macros here.
  18. //    DO NOT EDIT what you see in these blocks of generated code!
  19. //}}AFX_MSG_MAP
  20. // Enable default OLE container implementation
  21. ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_LINKS, CRichEditDoc::OnUpdateEditLinksMenu)
  22. ON_COMMAND(ID_OLE_EDIT_LINKS, CRichEditDoc::OnEditLinks)
  23. ON_UPDATE_COMMAND_UI_RANGE(ID_OLE_VERB_FIRST, ID_OLE_VERB_LAST, CRichEditDoc::OnUpdateObjectVerbMenu)
  24. END_MESSAGE_MAP()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CRibbonSampleDoc construction/destruction
  27. CRibbonSampleDoc::CRibbonSampleDoc()
  28. {
  29. // TODO: add one-time construction code here
  30. }
  31. CRibbonSampleDoc::~CRibbonSampleDoc()
  32. {
  33. }
  34. BOOL CRibbonSampleDoc::OnNewDocument()
  35. {
  36. if (!CRichEditDoc::OnNewDocument())
  37. return FALSE;
  38. // TODO: add reinitialization code here
  39. // (SDI documents will reuse this document)
  40. return TRUE;
  41. }
  42. CRichEditCntrItem* CRibbonSampleDoc::CreateClientItem(REOBJECT* preo) const
  43. {
  44. // cast away constness of this
  45. return new CRibbonSampleCntrItem(preo, (CRibbonSampleDoc*) this);
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CRibbonSampleDoc serialization
  49. void CRibbonSampleDoc::Serialize(CArchive& ar)
  50. {
  51. if (ar.IsStoring())
  52. {
  53. // TODO: add storing code here
  54. }
  55. else
  56. {
  57. // TODO: add loading code here
  58. }
  59. // Calling the base class CRichEditDoc enables serialization
  60. //  of the container document's COleClientItem objects.
  61. // TODO: set CRichEditDoc::m_bRTF = FALSE if you are serializing as text
  62. CRichEditDoc::Serialize(ar);
  63. }
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CRibbonSampleDoc diagnostics
  66. #ifdef _DEBUG
  67. void CRibbonSampleDoc::AssertValid() const
  68. {
  69. CRichEditDoc::AssertValid();
  70. }
  71. void CRibbonSampleDoc::Dump(CDumpContext& dc) const
  72. {
  73. CRichEditDoc::Dump(dc);
  74. }
  75. #endif //_DEBUG
  76. /////////////////////////////////////////////////////////////////////////////
  77. // CRibbonSampleDoc commands