newsrolltext.h

来自「Symbian工程 九宫格界面」· C头文件 代码 · 共 40 行

H
40
字号
#ifndef __NEWSROLLTEXT_H__
#define __NEWSROLLTEXT_H__

#include <e32base.h>  // CBase, link against euser.lib
#include <eiklabel.h>

class CNewsRollText : public CEikLabel
{	
public: // Constructors and destructor
 	CNewsRollText();	
	~CNewsRollText();
	//重写绘图函数
	void Draw(const TRect& aRect) const;
	//重写CEikLabel的文本设置函数
	void NewsSetTextL(const TDesC& aText);
	//启动滚动
	void Start();
	//设置背景颜色函数
	void NewsSetBackgroundColor(TRgb aColor);
	void NewsSetExtent(const TPoint &aPosition, const TSize &aSize);
private:
	//定时器回调函数
	static TInt Tick(TAny* p);
	//滚动文本
	void DoScroll();
	//判断滚动是否完成
	TBool IsNeedScroll();
private:
	//保存要显示的文本
	HBufC* iNewsText;
	TPoint iNewsStarPoint;
	TSize iNewsLabelSize;
	//定时器
	CPeriodic* iNewsPeriodicTimer;
	//背景颜色
	TRgb iNewsBackgroundColor;
};

#endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?