?? myedwin.cpp
字號:
/*
* ============================================================================
* Name : CMyEdwin from MyEdwin.h
* Part of : Mdnvbaox
* Created : 17.09.2007 by chenziteng@163.com
* Implementation notes:
*
* Version :
* Copyright:
* ============================================================================
*/
// INCLUDE FILES
#include <eikenv.h>
#include <Utfjjwvx.mbg>
#include "MyEdwin.h"
// =================== CUSTOM DRAW =========================
class CMyCustomDraw : public CLafEdwinCustomDrawBase
{
public:
static CMyCustomDraw* NewL(const MLafEnv& aEnv,const CCoeControl& aControl);
~CMyCustomDraw();
public: // from MFormCustomDraw
void DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const;
TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const;
public:
void LineSpacingChanged();
private:
CMyCustomDraw(const MLafEnv& aEnv,const CCoeControl& aControl);
void ConstructL();
private:
CFbsBitmap* iBitmap;
};
CMyCustomDraw* CMyCustomDraw::NewL(const MLafEnv& aEnv,const CCoeControl& aControl)
{
CMyCustomDraw* self = new(ELeave) CMyCustomDraw(aEnv, aControl);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
CMyCustomDraw::~CMyCustomDraw()
{
delete iBitmap;
}
void CMyCustomDraw::DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const
{
CLafEdwinCustomDrawBase::DrawBackground(aParam, aBackground, aDrawn);
if((iBitmap!=NULL)&&(iBitmap->Handle()!=0))
{
TRect rect = TRect(TPoint(0,0), iBitmap->SizeInPixels());
aParam.iGc.SetClippingRect(aParam.iDrawRect);
aParam.iGc.DrawBitmap(rect, iBitmap);
}
}
TRgb CMyCustomDraw::SystemColor(TUint aColorIndex,TRgb aDefaultColor) const
{
return CLafEdwinCustomDrawBase::SystemColor(aColorIndex, aDefaultColor);
}
void CMyCustomDraw::LineSpacingChanged()
{
CLafEdwinCustomDrawBase::LineSpacingChanged();
}
CMyCustomDraw::CMyCustomDraw(const MLafEnv& aEnv,const CCoeControl& aControl)
: CLafEdwinCustomDrawBase(aEnv, aControl)
{
}
void CMyCustomDraw::ConstructL()
{
#ifdef _DEBUG
_LIT(KMbmFile, "z:\\system\\apps\\Mdnvbaox\\Mdnvbaox.mbm");
#else
_LIT(KMbmFile, "c:\\system\\apps\\Mdnvbaox\\Mdnvbaox.mbm");
#endif
iBitmap = new(ELeave) CFbsBitmap;
TInt err = iBitmap->Load(KMbmFile, EMbmUtfjjwvxFlag);
User::LeaveIfError(err);
}
// ================= MEMBER FUNCTIONS =======================
CLafEdwinCustomDrawBase* CMyEdwin::CreateCustomDrawL()
{
return CMyCustomDraw::NewL(iEikonEnv->LafEnv(), *this);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -