⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basecontrol.h

📁 一个symbian上成熟的小游戏源码
💻 H
字号:
// BaseControl.h: interface for the CBaseControl class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASECONTROL_H__01C81908_CECA_4640_BAE2_0ABBDDB0F726__INCLUDED_)
#define AFX_BASECONTROL_H__01C81908_CECA_4640_BAE2_0ABBDDB0F726__INCLUDED_

#include <e32base.h>
#include <bitstd.h>
#include <stringloader.h>
//#include "GGBallEnv.h"
#include "TiledLayer.h"
using namespace gamespace;
#include "GGBall.mbg"

class CBaseControl : public CBase
{
protected:
	CBaseControl(const TRect& aRect);
	void ConstructL();

public:
	virtual ~CBaseControl();
	static CBaseControl* NewL(const TRect& aRect);
	static CBaseControl* NewLC(const TRect& aRect);

	virtual void Draw(CBitmapContext & gc) const;
	void DrawText(CBitmapContext& gc,
				  CGraphicsContext::TTextAlign aAlign=CGraphicsContext::ELeft,
				  TInt aLeftMargin=0) const;
	void DrawText(CBitmapContext& gc,const TDesC& aText,
				  CGraphicsContext::TTextAlign aAlign=CGraphicsContext::ELeft,
				  TInt aLeftMargin=0) const;
	void SetText(TInt aResourceId);
	void SetBackground(TInt aEnumBmpBack=-1,TInt aEnumBmpBackMask=-1);

	void Show();
	void Hide();
	TBool Visible() const;
	
	void SetFont(const CFont* aFont);

private:
	void DrawBackground(CBitmapContext & gc) const;

private:
	HBufC* iText;
	TBool iShow;

protected:
	CTiledLayer* iBackground;//背景
	CFbsBitmap* iBmpBack;//背景图片
	CFbsBitmap* iBmpBackMask;
	TRect iRect;
	const CFont* iFont;
};

#endif

⌨️ 快捷键说明

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