Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.9 KiB

  1. /*************************************************
  2. * blockvw.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // blockvw.h : header file
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CBlockView view
  11. class CBlockView : public COSBView
  12. {
  13. DECLARE_DYNCREATE(CBlockView)
  14. protected:
  15. CBlockView(); // protected constructor used by dynamic creation
  16. // Attributes
  17. public:
  18. CBlockDoc* GetDocument()
  19. {return (CBlockDoc*) m_pDocument;}
  20. // Operations
  21. public:
  22. BOOL NewBackground(CDIB* pDIB);
  23. virtual void Render(CRect* pClipRect = NULL);
  24. void NewSprite(CSprite* pSprite);
  25. void GameOver(BOOL bHighScore=FALSE);
  26. BOOL IsStart() const {return m_bStart;}
  27. void SetSpeed(int iSpeed);
  28. void ForceSpeed(int nSpeed);
  29. // Implementation
  30. protected:
  31. virtual ~CBlockView();
  32. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  33. virtual void OnInitialUpdate(); // first time after construct
  34. // Generated message map functions
  35. //{{AFX_MSG(CBlockView)
  36. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  37. afx_msg void OnDestroy();
  38. afx_msg void OnTimer(UINT nIDEvent);
  39. afx_msg void OnActionFast();
  40. afx_msg void OnActionSlow();
  41. afx_msg void OnActionStop();
  42. afx_msg void OnFileStart();
  43. afx_msg void OnFileSuspend();
  44. afx_msg void OnUpdateFileSuspend(CCmdUI* pCmdUI);
  45. afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  46. afx_msg void OnUpdateActionFast(CCmdUI* pCmdUI);
  47. afx_msg void OnUpdateActionSlow(CCmdUI* pCmdUI);
  48. afx_msg void OnActionNormal();
  49. afx_msg void OnUpdateActionNormal(CCmdUI* pCmdUI);
  50. afx_msg void OnActionNormalfast();
  51. afx_msg void OnUpdateActionNormalfast(CCmdUI* pCmdUI);
  52. afx_msg void OnUpdateActionNormalslow(CCmdUI* pCmdUI);
  53. afx_msg void OnActionNormalslow();
  54. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  55. afx_msg void OnMenuSelect( UINT nItemID, UINT nFl, HMENU hSysMenu );
  56. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  57. afx_msg void OnAppAbout();
  58. afx_msg void OnKillFocus(CWnd* pNewWnd);
  59. afx_msg void OnSetFocus(CWnd* pOldWnd);
  60. //}}AFX_MSG
  61. DECLARE_MESSAGE_MAP()
  62. private:
  63. BOOL m_bMouseCaptured; // TRUE if mouse captured
  64. CBlock* m_pCapturedSprite;// Pointer to captured sprite (for drag)
  65. CPoint m_ptOffset; // offset into hit sprite
  66. UINT m_uiTimer; // timer id
  67. CPoint m_ptCaptured; // point where sprite was captured
  68. int m_iSpeed;
  69. BOOL m_bStart;
  70. BOOL m_bSuspend;
  71. BOOL m_bFocusWnd;
  72. };
  73. #define SPEED_FAST 35
  74. #define SPEED_NORMALFAST 75
  75. #define SPEED_NORMAL 150
  76. #define SPEED_NORMALSLOW 225
  77. #define SPEED_SLOW 300
  78. /////////////////////////////////////////////////////////////////////////////