-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColorStatic.h
122 lines (109 loc) · 4.35 KB
/
ColorStatic.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
#if !defined(AFX_COLORSTATIC_H__1E8902A4_E5A0_11D3_A999_CCDB28E9E729__INCLUDED_)
#define AFX_COLORSTATIC_H__1E8902A4_E5A0_11D3_A999_CCDB28E9E729__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ColorStatic.h : header file
//
///////////////////////////////////////////////////////////
//*********************************************************
// Author: Andy good , Beijing, China. Chinese Name:¼ÖÓÀÖ
//*********************************************************
///////////////////////////////////////////////////////////
//*********************************************************
// Use this freely! If you have any good idea,
// please let me know. E-mail:[email protected].
//*********************************************************
///////////////////////////////////////////////////////////
//
#define ROLL_LEFT 0
#define ROLL_RIGHT 1
#define ROLL_UP 2
#define ROLL_DOWN 3
#define ID_ROLLTIMER 1
#define ID_CLOCKTIMER 2
/////////////////////////////////////////////////////////////////////////////
// CColorStatic window
class CColorStatic : public CStatic
{
// Construction
public:
CColorStatic();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorStatic)
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
public:
void SetTextFont(int a,LPCTSTR b);
void SetBkTransparent(bool btranparent=true);
void SetClock(bool bTime=true);
void SetTextHeight(int height);
void SetTextFont(LOGFONT* lf);
void SetTextYPos(int y);
void SetTextXPos(int x);
void VCenterText();
void HCenterText();
void StopRoll();
void BeginRoll(int nStep=5,int nTimer=100);
void SetText(CString sText);
void SetBkColor(COLORREF clBkColor);
void SetTextColor(COLORREF clTextColor);
void SetRollDirection(int direction);
virtual ~CColorStatic();
// Generated message map functions
protected:
bool m_bDCStored;
CDC m_StoreDC;
bool m_bBkTransparent;
bool m_bRollTimerKilled;// Judge if we need to kill the roll timer.
// If you use StopRoll(),we'll not kill timer
// in OnDestroy().
bool m_bRollPosSetted; // Judge if we need to reset the roll position.
// If you called SetText() or SetTextHeight()
// or SetTextFont(), this var will be set to
// false.
bool m_bTextInfoGotten; // judge if we have gotten the text infomation.
// If you called SetText() or SetTextHeight()
// or SetTextFont(), this var will be set to
// false.
bool m_bHCentered; // Judge whether the text should be H centered.
bool m_bVCentered; // Judge whether the text should be V centered.
bool m_bUseSysFont; // Judge whether use the default font.
int m_nRollDirection; // Judge the text's roll direction.
bool m_bUseRoll; // Judge whether we should roll the text.
int m_nScrollYPos; // Judge the text's output x position when rolling.
int m_nScrollXPos; // Judge the text's output y position when rolling.
int m_nLineHeight; // one line's height.
int m_nTextHeight; // The text's height.When it's multi-line,this var
// indicate it's all lines' whole height.
int m_nTextWidth; // The text's width.When it's multi-line,this var
// indicate it's lines'max width.
bool m_bIsSingleLine; // Judge if the text is single-line.
int m_nTextYPos; // The text's output x position.(Use this when the text is not
// rolling.)
int m_nStep; // Every step distance when the is rolling.
int m_nTextXPos; // The text's output y position.(Use this when the text is not
// rolling.)
CString m_sText; // Our static's text.
CFont m_font; // The user defined font.
COLORREF m_clBackColor; // Back color.
COLORREF m_clTextColor; // Text color.
//{{AFX_MSG(CColorStatic)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnPaint();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COLORSTATIC_H__1E8902A4_E5A0_11D3_A999_CCDB28E9E729__INCLUDED_)