📄 horizontalrolltext.h
字号:
#if !defined(AFX_HORIZONTALROLLTEXT_H__4F12A17C_B499_4260_B398_3DC1123DC801__INCLUDED_)
#define AFX_HORIZONTALROLLTEXT_H__4F12A17C_B499_4260_B398_3DC1123DC801__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// HorizontalRollText.h : header file
//
#include "CommDef.h"
/////////////////////////////////////////////////////////////////////////////
// CHorizontalRollText window
class CHorizontalRollText : public CStatic
{
// Construction
public:
CHorizontalRollText();
// Attributes
public:
// Operations
public:
void SetStep(UINT nStep);
void SetTick(UINT uTick);
void Initialize();// 初始化数据成员
void SetTextAlign(UINT nStyle);// 设置文字对齐方式
void GetWindowText( CString& csText ) const;// 重写父类成员GetWindowText
void Paint(CDC *pDC);// 重画
void SetRollMode(UINT nStyle);// 设置MAGIC效果
void SetWindowText(LPCTSTR lpszString);// 重写父类成员SetWindowText
void SetFont(CFont &f); // 设置字体
void SetBkColor(COLORREF crColor);// 设置背景色
void SetTextColor(COLORREF crColor);//设置文字颜色
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHorizontalRollText)
afx_msg void OnPaint();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CHorizontalRollText();
// Generated message map functions
protected:
UINT m_nStep;// 步长:4(1-10)
UINT m_nTick;// 速度:200(50-2000)
void Draw();// 重画bitmap
void GetTextSize();// 计算字符串的宽和高
CDC m_MemDC; // 内存设备环境
UINT m_nStyle; // 当前效果
UINT m_nTextAlign; // 当前对齐方式
CString m_csText; // 当前字符串
CFont m_Font; // 当前字体
int m_nTextWidth; // 字符串的宽度
int m_nTextHeight; // 字符串的高度
COLORREF m_BkColor; // 背景色
COLORREF m_TextColor; // 前景色
CRect m_Rect; // 用户区矩形
CBitmap m_Bmp; // 位图
int m_nX, m_nY; // 当前绘图位置
int m_nBBx, m_nBBy, // BitBlt()的参数
m_nBBWidth, m_nBBHeight,
m_nBBxScr, m_nBByScr;
bool m_bLeft, // 是否正在向左移动
m_bTop; // 是否正在向上移动
//{{AFX_MSG(CHorizontalRollText)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
// 线程控制函数
UINT ThreadProc(LPVOID pPara);
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_HORIZONTALROLLTEXT_H__4F12A17C_B499_4260_B398_3DC1123DC801__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -