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

📄 detailcardcontainer.cpp

📁 symbian 3nd 实现短信息收发
💻 CPP
字号:
#include <FrMes.rsg>
#include "FrMes.hrh"
#include "DetailCardContainer.h"

#include <eikenv.h>//CEikonEnv
#include <eiklabel.h>  // for example label control
// ================= MEMBER FUNCTIONS =======================

// C++ default constructor can NOT contain any code, that
// might leave.
//
CDetailCardContainer::CDetailCardContainer()
{
	m_pLabel	=	NULL;
}

// EPOC default constructor can leave.
void CDetailCardContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();
	
	//label sName
	m_pLabel = new (ELeave) CEikLabel;
	//set Font
	const	CFont*	Font;
	Font	=	CEikonEnv::Static()->TitleFont();//iEikonEnv->NormalFont();
	m_pLabel->SetFont(Font);
	//display label content
	m_pLabel->SetContainerWindowL(*this);
	TBuf<32> sName;	
	iCoeEnv->ReadResource(sName, R_QTN_LABEL_CREATE_TELEPHONE);
	sName.Append(aTelephone);
	m_pLabel->SetTextL(sName);
	m_pLabel->SetExtent(TPoint(20, 40), m_pLabel->MinimumSize());
	
	
    SetRect(aRect);
    ActivateL();
}

// Destructor
CDetailCardContainer::~CDetailCardContainer()
{
	if (m_pLabel) 
	{
		delete	m_pLabel;
		m_pLabel	=	NULL;
	}
}

// ---------------------------------------------------------
// CAknExEditorContainer::FocusTo(TInt aCommand)
// Change foccused control.
// (other items were commented in a header).
// ---------------------------------------------------------
//

void CDetailCardContainer::FocusTo(TInt aCommand)
{
}

// ---------------------------------------------------------
// CDetailCardContainer::SizeChanged()
// Called by framework when the view size is changed
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CDetailCardContainer::SizeChanged()
{
}

// ---------------------------------------------------------
// CDetailCardContainer::CountComponentControls() const
// (other items were commented in a header).
// ---------------------------------------------------------
//
TInt CDetailCardContainer::CountComponentControls() const
{
    return 1; // return nbr of controls inside this container
}

// ---------------------------------------------------------
// CDetailCardContainer::ComponentControl(TInt aIndex) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
CCoeControl* CDetailCardContainer::ComponentControl(TInt aIndex) const
{
	return m_pLabel;
}

// ---------------------------------------------------------
// CDetailCardContainer::Draw(const TRect& aRect) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CDetailCardContainer::Draw(const TRect& aRect) const
{
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbWhite);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
}

// ---------------------------------------------------------
// CDetailCardContainer::OfferKeyEventL(...)
// Notify key events to editors.
// (other items were commented in a header).
// ---------------------------------------------------------
//
TKeyResponse CDetailCardContainer::OfferKeyEventL(
												  const TKeyEvent& aKeyEvent, TEventCode aType)
{
    return EKeyWasNotConsumed;
}


// ---------------------------------------------------------
// CDetailCardContainer::HandleControlEventL(
//     CCoeControl* aControl,TCoeEvent aEventType)
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CDetailCardContainer::HandleControlEventL(
											   CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
}
//=======================
void CDetailCardContainer::SendCardName(TDesC& aPhone)
{
	aTelephone = aPhone;
}
// End of File  

⌨️ 快捷键说明

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