📄 helpcontainer.cpp.bak
字号:
/*
* ============================================================================
* Name : CHelpContainer from CCoeControl, MCoeControlObserver
* Part of : Help
* Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/
// INCLUDE FILES
#include <HelperGenius.rsg>
#include "HelperGenius.hrh"
#include "HelpContainer.h"
#include <eikenv.h>
#include <Helpergenius.mbg>
#include <fbs.h>
#include <AknUtils.h>
// ================= MEMBER HelpS =======================
// C++ default constructor can NOT contain any code, that
// might leave.
//
#define DELPTR(p) if(p!=NULL){ delete p;p=NULL;}
CHelpContainer::CHelpContainer()
{
m_pBitmap = NULL;
}
// EPOC default constructor can leave.
void CHelpContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
m_pBitmap = new (ELeave) CFbsBitmap;
TBuf<KMaxPath> pathMbm;
#ifdef __WINS__
pathMbm.Copy(_L("z:\\system\\apps\\HelperGenius\\HelperGenius.mbm"));
#else
CHelperGeniusAppUi* pApp = (CHelperGeniusAppUi*)CEikonEnv::Static()->AppUi();
pApp->GetAppPath(pathMbm);
pathMbm.Append(_L("HelperGenius.mbm"));
#endif
User::LeaveIfError(CompleteWithAppPath(pathMbm));
User::LeaveIfError(m_pBitmap->Load(pathMbm,EMbmHelpergeniusHelpergenius_icon_17));
SetRect(aRect);
ActivateL();
}
// Destructor
CHelpContainer::~CHelpContainer()
{
DELPTR(m_pBitmap);
}
// ---------------------------------------------------------
// CHelpContainer::FocusTo(TInt aCommand)
// Change foccused control.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelpContainer::FocusTo(TInt aCommand)
{
}
// ---------------------------------------------------------
// CHelpContainer::SizeChanged()
// Called by framework when the view size is changed
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelpContainer::SizeChanged()
{
}
// ---------------------------------------------------------
// CHelpContainer::CountComponentControls() const
// (other items were commented in a header).
// ---------------------------------------------------------
//
TInt CHelpContainer::CountComponentControls() const
{
return 0; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CHelpContainer::ComponentControl(TInt aIndex) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
CCoeControl* CHelpContainer::ComponentControl(TInt aIndex) const
{
return NULL;
}
// ---------------------------------------------------------
// CHelpContainer::Draw(const TRect& aRect) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelpContainer::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
/******添加背景图片*******************************************/
gc.Clear(aRect);
TPoint topLeft(0,0);
// gc.DrawBitmap(TRect(topLeft,TSize(176,208)),m_pBitmap);
gc.BitBlt(topLeft,m_pBitmap,TRect(topLeft,TSize(176,208)));
gc.SetPenStyle(CGraphicsContext::ESolidPen);
gc.SetPenColor(KRgbYellow);
// _LIT(KNAMEA,"Email:");
// TBuf<32> buf(KNAMEA);
const CFont* nor = CEikonEnv::Static()->TitleFont();
gc.UseFont(nor);
_LIT(KADD,"BeiJing");
TBuf<32> sTmpTitle;
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_CAPTION1);
TPoint point(aRect.Width()/3 - 28,aRect.Height()/8);
// gc.DrawText(buf,point);
gc.DrawText(sTmpTitle,point);
point.iY +=25;
point.iX -=26;
sTmpTitle.Zero();
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_CAPTION2);
gc.DrawText(sTmpTitle,point);
point.iY +=25;
// point.iX -=15;
sTmpTitle.Zero();
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_CAPTION3);
gc.DrawText(sTmpTitle,point);
point.iY +=25;
// point.iX +=15;
sTmpTitle.Zero();
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_CAPTION4);
gc.DrawText(sTmpTitle,point);
point.iY +=25;
// point.iX -=15;
sTmpTitle.Zero();
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_CAPTION5);
gc.DrawText(sTmpTitle,point);
gc.DiscardFont();
}
// ---------------------------------------------------------
// CHelpContainer::OfferKeyEventL(...)
// Notify key events to editors.
// (other items were commented in a header).
// ---------------------------------------------------------
//
TKeyResponse CHelpContainer::OfferKeyEventL(
const TKeyEvent& aKeyEvent, TEventCode aType)
{
return EKeyWasNotConsumed;
}
// ---------------------------------------------------------
// CHelpContainer::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelpContainer::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -