home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c05 / statbar / statbdoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.8 KB  |  83 lines

  1. // StatBDoc.cpp : implementation of the CStatusBarsDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "StatBar.h"
  6.  
  7. #include "StatBDoc.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CStatusBarsDoc
  17.  
  18. IMPLEMENT_DYNCREATE(CStatusBarsDoc, CDocument)
  19.  
  20. BEGIN_MESSAGE_MAP(CStatusBarsDoc, CDocument)
  21.     //{{AFX_MSG_MAP(CStatusBarsDoc)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CStatusBarsDoc construction/destruction
  29.  
  30. CStatusBarsDoc::CStatusBarsDoc()
  31.     :m_color(RGB(0,0,0))
  32. {
  33.     m_phrase.LoadString(IDS_WELCOME_MSG);
  34. }
  35.  
  36. CStatusBarsDoc::~CStatusBarsDoc()
  37. {
  38. }
  39.  
  40. BOOL CStatusBarsDoc::OnNewDocument()
  41. {
  42.     if (!CDocument::OnNewDocument())
  43.         return FALSE;
  44.  
  45.     // TODO: add reinitialization code here
  46.     // (SDI documents will reuse this document)
  47.  
  48.     return TRUE;
  49. }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CStatusBarsDoc serialization
  53.  
  54. void CStatusBarsDoc::Serialize(CArchive& ar)
  55. {
  56.     if (ar.IsStoring())
  57.     {
  58.         // TODO: add storing code here
  59.     }
  60.     else
  61.     {
  62.         // TODO: add loading code here
  63.     }
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CStatusBarsDoc diagnostics
  68.  
  69. #ifdef _DEBUG
  70. void CStatusBarsDoc::AssertValid() const
  71. {
  72.     CDocument::AssertValid();
  73. }
  74.  
  75. void CStatusBarsDoc::Dump(CDumpContext& dc) const
  76. {
  77.     CDocument::Dump(dc);
  78. }
  79. #endif //_DEBUG
  80.  
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CStatusBarsDoc commands
  83.