home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / general / mdidocvw / bncdoc.cpp next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.1 KB  |  106 lines

  1. // BounceDoc.cpp : implementation file
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "MDI.h"
  16. #include "BncDoc.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CBounceDoc
  26.  
  27. IMPLEMENT_DYNCREATE(CBounceDoc, CDocument)
  28.  
  29. CBounceDoc::CBounceDoc()
  30. {
  31. }
  32.  
  33. BOOL CBounceDoc::OnNewDocument()
  34. {
  35.     if (!CDocument::OnNewDocument())
  36.         return FALSE;
  37.  
  38.     m_clrBall = RGB(0, 0, 255);
  39.     m_bFastSpeed = FALSE;
  40.  
  41.     m_bBlue= 1;
  42.     m_bWhite= m_bRed= 0;
  43.     m_bGreen= m_bBlack= m_bCustom= 0;
  44.  
  45.     return TRUE;
  46. }
  47.  
  48. CBounceDoc::~CBounceDoc()
  49. {
  50. }
  51.  
  52.  
  53. BEGIN_MESSAGE_MAP(CBounceDoc, CDocument)
  54.     //{{AFX_MSG_MAP(CBounceDoc)
  55.         // NOTE - the ClassWizard will add and remove mapping macros here.
  56.     //}}AFX_MSG_MAP
  57. END_MESSAGE_MAP()
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CBounceDoc diagnostics
  61.  
  62. #ifdef _DEBUG
  63. void CBounceDoc::AssertValid() const
  64. {
  65.     CDocument::AssertValid();
  66. }
  67.  
  68. void CBounceDoc::Dump(CDumpContext& dc) const
  69. {
  70.     CDocument::Dump(dc);
  71. }
  72. #endif //_DEBUG
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CBounceDoc serialization
  76.  
  77. void CBounceDoc::Serialize(CArchive& ar)
  78. {
  79.     if (ar.IsStoring())
  80.     {
  81.     }
  82.     else
  83.     {
  84.     }
  85. }
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CBounceDoc commands
  89. void CBounceDoc::SetCustomBallColor(COLORREF clr)
  90. {
  91.     m_clrBall= clr;
  92.     UpdateAllViews(NULL);
  93. }
  94.  
  95. void CBounceDoc::SetBallRadius(CSize radius)
  96. {
  97.     m_sizeRadius= radius;
  98.     UpdateAllViews(NULL);
  99. }
  100.  
  101. void CBounceDoc::ClearAllColors()
  102. {
  103.     m_bBlack= m_bBlue= m_bRed= 0;
  104.     m_bWhite= m_bGreen= m_bCustom= 0;
  105. }
  106.