StarWarsCtrl.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #if !defined(AFX_STARWARSCTRL_H__B75B0B9E_367D_11D6_AB38_00D0B70C3D79__INCLUDED_)
  2. #define AFX_STARWARSCTRL_H__B75B0B9E_367D_11D6_AB38_00D0B70C3D79__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // StarWarsCtrl.h : header file
  7. //
  8. #define NUM_STARS 100
  9. class CStarWarsCtrl : public CStatic
  10. {
  11. struct CStar
  12. {
  13. int x;
  14. int y;
  15. int z;
  16. };
  17. CStar m_StarArray[NUM_STARS];
  18. // Construction
  19. public:
  20. CStarWarsCtrl();
  21. // Attributes
  22. public:
  23. // Operations
  24. public:
  25. // Overrides
  26. // ClassWizard generated virtual function overrides
  27. //{{AFX_VIRTUAL(CStarWarsCtrl)
  28. protected:
  29. virtual void PreSubclassWindow();
  30. //}}AFX_VIRTUAL
  31. // Implementation
  32. public:
  33. void SetStarSpeed(int nSpeed);
  34. void SetScrollSpeed(int nSpeed);
  35. virtual ~CStarWarsCtrl();
  36. // Generated message map functions
  37. protected:
  38. int m_nStarsSpeed;
  39. int m_nScrollSpeed;
  40. int m_nScrollPos;
  41. void DoScrollText(CDC *pDC);
  42. void DoStars(CDC *pDC);
  43. void InvalidateCtrl();
  44. CString GetVersionInformation(LPCTSTR lpszModuleName);
  45. CFont m_Font;
  46. CRect m_rectClient;
  47. CDC m_MainDC;
  48. CBitmap m_MainBitmap;
  49. CBitmap *m_pOldBitmap;
  50. CStringArray m_TextLines;
  51. //{{AFX_MSG(CStarWarsCtrl)
  52. afx_msg void OnPaint();
  53. afx_msg void OnSize(UINT nType, int cx, int cy);
  54. afx_msg void OnTimer(UINT nIDEvent);
  55. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  56. //}}AFX_MSG
  57. DECLARE_MESSAGE_MAP()
  58. };
  59. //{{AFX_INSERT_LOCATION}}
  60. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  61. #endif // !defined(AFX_STARWARSCTRL_H__B75B0B9E_367D_11D6_AB38_00D0B70C3D79__INCLUDED_)