helpcontainer.cpp

来自「symbian 3nd 实现短信息收发」· C++ 代码 · 共 140 行

CPP
140
字号
/*
* ============================================================================
*  Name     : CHelpContainer from CCoeControl, MCoeControlObserver
*  Part of  : Help
*  Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES
#include <eiklabel.h>  // for example label control
#include <barsread.h>  // for resource reader
#include <eikedwin.h>  // for CEikEdwin
#include <eikgted.h>   // for CEikGlobalTextEditor

#include <FrMes.rsg>
#include "FrMes.hrh"
#include "HelpContainer.h"


// ================= MEMBER FUNCTIONS =======================

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

// EPOC default constructor can leave.
void CHelpContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();
	
	//label sHelp
	TBuf<32> sHelp;	
	iCoeEnv->ReadResource(sHelp, R_QTN_FRMES_LABLE_HELP);
	m_pLabehelp = new (ELeave) CEikLabel;
	m_pLabehelp->SetContainerWindowL(*this);
	m_pLabehelp->SetTextL(sHelp);
	m_pLabehelp->SetExtent(TPoint(20, 40), TSize(120,70));

    SetRect(aRect);
    ActivateL();
}

// Destructor
CHelpContainer::~CHelpContainer()
{
	if(m_pLabehelp)
	{
		delete m_pLabehelp;
		m_pLabehelp = NULL;
	}
}

// ---------------------------------------------------------
// 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 1; // 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
{
	if(aIndex == 0)
		return m_pLabehelp;
	else
	    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.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbCyan);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
}

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