Creditstatic.h
Upload User: wangfu1106
Upload Date: 2014-08-20
Package Size: 193k
Code Size: 4k
Category:

ADO-ODBC

Development Platform:

Visual C++

  1. #if !defined(AFX_CREDITSTATIC_H__4ABD7701_49F5_11D1_9E3C_00A0245800CF__INCLUDED_)
  2. #define AFX_CREDITSTATIC_H__4ABD7701_49F5_11D1_9E3C_00A0245800CF__INCLUDED_
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. // CreditStatic.h : header file
  7. //////////////////////////////////////////////////
  8. //类名:CCreditStatic
  9. //功能:荣誉对话框效果实现
  10. //修改人:徐景周(jingzhou_xu@163.net)
  11. //组织:未来工作室(Future Studio)
  12. //日期:2001.12.1
  13. //////////////////////////////////////////////////
  14. #define DISPLAY_SLOW 0
  15. #define DISPLAY_MEDIUM 1
  16. #define DISPLAY_FAST 2
  17. #define BACKGROUND_COLOR        0
  18. #define TOP_LEVEL_TITLE_COLOR 1
  19. #define TOP_LEVEL_GROUP_COLOR   2
  20. #define GROUP_TITLE_COLOR       3
  21. #define NORMAL_TEXT_COLOR 4
  22. #define TOP_LEVEL_TITLE_HEIGHT 0
  23. #define TOP_LEVEL_GROUP_HEIGHT  1     
  24. #define GROUP_TITLE_HEIGHT     2     
  25. #define NORMAL_TEXT_HEIGHT 3
  26. #define TOP_LEVEL_TITLE 0   // 't'
  27. #define TOP_LEVEL_GROUP         1   // 'n'
  28. #define GROUP_TITLE            2   // 'r'
  29. #define DISPLAY_BITMAP 3   // '^'
  30. #define GRADIENT_NONE 0
  31. #define GRADIENT_RIGHT_DARK 1
  32. #define GRADIENT_RIGHT_LIGHT 2
  33. #define GRADIENT_LEFT_DARK 3
  34. #define GRADIENT_LEFT_LIGHT 4
  35. class CCreditStatic : public CStatic
  36. {
  37. protected:
  38. COLORREF    m_Colors[5];
  39. int         m_TextHeights[4];
  40.      TCHAR       m_Escapes[4];
  41. int         m_DisplaySpeed[3],m_CurrentSpeed;
  42. //  CRect       m_ScrollRect;    // rect of Static Text frame
  43. CStringList m_ArrCredit;
  44. CString m_szWork;
  45. int         m_nCounter;    // work ints
  46. POSITION    m_ArrIndex;
  47. BOOL        m_bFirstTime;
  48. BOOL        m_bDrawText;
  49. int         m_nClip,m_ScrollAmount;
  50. int         m_nCurrentFontHeight;
  51. CBitmap     m_bmpWork;                  // bitmap holder
  52. CBitmap m_BmpMain;                  // bitmap holder
  53. CSize  m_size;                     // drawing helpers
  54. CPoint  m_pt;
  55. BOOL  m_bProcessingBitmap;
  56. CPalette m_pal;
  57. CBitmap m_bitmap;
  58. int m_cxBitmap, m_cyBitmap;
  59. BOOL m_bFirstTurn;
  60. UINT        m_Gradient;
  61. BOOL m_bTransparent;
  62. int n_MaxWidth;
  63. UINT        TimerOn;
  64. // Construction
  65. public:
  66. CCreditStatic();
  67. // Attributes
  68. public:
  69. // Operations
  70. public:
  71. BOOL StartScrolling();
  72. void EndScrolling();
  73. void SetCredits(LPCTSTR credits, char delimiter = '|');
  74. void SetCredits(UINT nID, char delimiter = '|');
  75. void SetSpeed(UINT index, int speed = 0);
  76. void SetColor(UINT index, COLORREF col);
  77. void SetTextHeight(UINT index, int height);
  78. void SetEscape(UINT index, char escape);
  79. void SetGradient(UINT value = GRADIENT_RIGHT_DARK);
  80. BOOL SetBkImage(UINT nIDResource);
  81. BOOL SetBkImage(LPCTSTR lpszResourceName);
  82. void SetTransparent(BOOL bTransparent = TRUE);
  83. // Overrides
  84. // ClassWizard generated virtual function overrides
  85. //{{AFX_VIRTUAL(CCreditStatic)
  86. //}}AFX_VIRTUAL
  87. // Implementation
  88. public:
  89. virtual ~CCreditStatic();
  90. // Generated message map functions
  91. protected:
  92. void MoveCredit(CDC *pDC, CRect& r, CRect& r2, BOOL bCheck);
  93. void AddBackGround(CDC* pDC, CRect& m_ScrollRect, CRect& m_ClientRect);
  94. void DrawCredit(CDC* pDC, CRect& m_ScrollRect);
  95. void FillGradient(CDC *pDC, CRect *m_ScrollRect, CRect *m_FillRect, COLORREF color);
  96. void DrawBitmap(CDC* pDC, CDC* pDC2, CRect *rBitmap);
  97. //{{AFX_MSG(CCreditStatic)
  98. afx_msg void OnPaint();
  99. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  100. afx_msg void OnTimer(UINT nIDEvent);
  101. afx_msg void OnDestroy();
  102. //}}AFX_MSG
  103. DECLARE_MESSAGE_MAP()
  104. };
  105. /////////////////////////////////////////////////////////////////////////////
  106. //{{AFX_INSERT_LOCATION}}
  107. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  108. #endif // !defined(AFX_CREDITSTATIC_H__4ABD7701_49F5_11D1_9E3C_00A0245800CF__INCLUDED_)