home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / cube / cubeview.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  2KB  |  76 lines

  1. // cubeview.h : interface of the CCubeView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. class CCubeView : public CView
  14. {
  15. protected: // create from serialization only
  16.     CCubeView();
  17.     DECLARE_DYNCREATE(CCubeView)
  18.  
  19. // Attributes
  20. public:
  21.     CCubeDoc* GetDocument();
  22.  
  23.     CPalette    m_cPalette;
  24.     CPalette    *m_pOldPalette;
  25.     CRect       m_oldRect;
  26.     float       m_fRadius;
  27.     CClientDC   *m_pDC;
  28.  
  29. // Operations
  30. public:
  31.     void Init();
  32.     void CreateRGBPalette(void);
  33.     BOOL bSetupPixelFormat(void);
  34.     unsigned char ComponentFromIndex(int i, UINT nbits, UINT shift);
  35.     void DrawScene(void);
  36.  
  37. // Overrides
  38.     // ClassWizard generated virtual function overrides
  39.     //{{AFX_VIRTUAL(CCubeView)
  40.     public:
  41.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  42.     //}}AFX_VIRTUAL
  43.  
  44. // Implementation
  45. public:
  46.     virtual ~CCubeView();
  47.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  48. #ifdef _DEBUG
  49.     virtual void AssertValid() const;
  50.     virtual void Dump(CDumpContext& dc) const;
  51. #endif
  52.  
  53. protected:
  54.     BOOL    m_play;
  55.  
  56. // Generated message map functions
  57. protected:
  58.     //{{AFX_MSG(CCubeView)
  59.     afx_msg void OnFilePlay();
  60.     afx_msg void OnUpdateFilePlay(CCmdUI* pCmdUI);
  61.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  62.     afx_msg void OnDestroy();
  63.     afx_msg void OnSize(UINT nType, int cx, int cy);
  64.     afx_msg void OnTimer(UINT nIDEvent);
  65.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  66.     //}}AFX_MSG
  67.     DECLARE_MESSAGE_MAP()
  68. };
  69.  
  70. #ifndef _DEBUG  // debug version in cubeview.cpp
  71. inline CCubeDoc* CCubeView::GetDocument()
  72.    { return (CCubeDoc*)m_pDocument; }
  73. #endif
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76.