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