basecontrol.h

来自「一个symbian上成熟的小游戏源码」· C头文件 代码 · 共 59 行

H
59
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?