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

📄 helpcontainer.cpp

📁 symbian系统上的记事本程序
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CHelpContainer from CCoeControl, MCoeControlObserver
*  Part of  : Hello
*  Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES


#include <EveryDay.rsg>
#include "EveryDay.hrh"
#include "HelpContainer.h"
#include "Common.h"
#include <eikedwin.h>
#include "s32file.h"

#include <aknnotewrappers.h> 
#include <aknviewappui.h>
#include <avkon.hrh>


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

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

// EPOC default constructor can leave.
void CHelpContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();
	// 	HBufC* htemp = HBufC::NewL(256);
	// 	TPtr16 temp = htemp->Des();
	// 	ReadHelpL(temp);
	//	HBufC* hbuf=HBufC::NewL(256);
	TBuf<256> hbuf;
	CEikonEnv::Static()->ReadResource(hbuf, R_QTN_HELP_CONTENT_B);
	m_pHelp = new(ELeave) CEikEdwin;
	m_pHelp->SetContainerWindowL(*this);
	m_pHelp->ConstructL(EAknEditorFlagDefault, 10, 10, 1);
	m_pHelp->SetExtent(TPoint(0,0), TSize(176,144));
	m_pHelp->SetTextL(&hbuf);
	
	
	
    SetRect(aRect);
    ActivateL();
}



// Destructor
CHelpContainer::~CHelpContainer()
{
	MEM_FREE(m_pHelp);
}

// ---------------------------------------------------------
// 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
{
	return m_pHelp;
}

// ---------------------------------------------------------
// 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(KRgbWhite);
    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*/)
{
}
// 
// void CHelpContainer::ReadHelpL(TPtr16 ptemp)
// {
// 	_LIT(KFileInfo, "C:\\help.abc");
// 	RFs& Fession = CEikonEnv::Static()->FsSession();
// 	RFileReadStream ReadhelpStream;
// 
// 	if(KErrNone != ReadhelpStream.Open(Fession, KFileInfo, EFileRead))
// 	{
// 		return ;
// 	}
// 	
// 	ReadhelpStream.PushL();
// 
// 	TInt32 num=0;
// 	num=ReadhelpStream.ReadReal32L();
//  	
// // 	HBufC* phelp= HBufC::NewL(num);
// // 	ptemp = phelp->Des();
// 
// 
// 		ReadhelpStream >> ptemp;		
// 
// 	
// 	ReadhelpStream.Pop();
// 	ReadhelpStream.Release();
// 	
// }

// End of File  

⌨️ 快捷键说明

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