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

📄 helpview.cpp

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

// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>

#include <EveryDay.rsg>

#include "EveryDay.hrh"
#include "HelpView.h"
#include "HelpContainer.h" 
#include "EveryDayAppUi.h"

#include <akncontext.h>
#include <akntitle.h>
#include <EveryDay.mbg>
#include "RegisterView.h"

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

// C++ default constructor can NOT contain any code, that
// might leave.
//
CHelpView* CHelpView::NewL()
{
    CHelpView* self = NewLC();
    CleanupStack::Pop(self);
    return self;
}

CHelpView* CHelpView::NewLC()
{
    CHelpView* self = new (ELeave) CHelpView;
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
}

CHelpView::CHelpView()
{
}

// EPOC default constructor can leave.
void CHelpView::ConstructL()
{
    //BaseConstructL(R_HELLO_VIEW);
	BaseConstructL(R_SCAN_VIEW);
}

// Destructor
CHelpView::~CHelpView()
{
	
}

// ---------------------------------------------------------
// TUid CHelpView::Id()
// Returns Id of the view.
// ---------------------------------------------------------
TUid CHelpView::Id() const
{
    return KViewId8;
}

// ---------------------------------------------------------
// CHelpView::HandleCommandL(TInt aCommand)
// Handles commands
// ---------------------------------------------------------
void CHelpView::HandleCommandL(TInt aCommand)
{   
	switch(aCommand)
	{
	case EAknSoftkeyBack:
		{
			AppUi()->ActivateLocalViewL(KViewId2);
			break;
		}

	default:
		{
			AppUi()->HandleCommandL(aCommand);
			break;
		}
	}
}
// ---------------------------------------------------------
// CHelpView::HandleClientRectChange()
// Handles client rect change.
// ---------------------------------------------------------
void CHelpView::HandleClientRectChange()
{
    if (iContainer)
	{
        iContainer->SetRect(ClientRect());
	}
}

// ---------------------------------------------------------
// CHelpView::DoActivateL(...)
// Creates the Container class object.
// ---------------------------------------------------------
void CHelpView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
							 TUid /*aCustomMessageId*/,
							 const TDesC8& /*aCustomMessage*/)
{
    iContainer = new (ELeave) CHelpContainer;
    iContainer->SetMopParent(this);
	
	TRect rc;
	rc.SetRect(ClientRect().iTl, TSize(176, 144));
    iContainer->ConstructL(rc);
    AppUi()->AddToStackL(*this, iContainer);

	TBuf<KMaxPath> pathMbm;
#ifdef __WINS__
	pathMbm.Copy(_L("z:\\system\\apps\\EveryDay\\EveryDay.mbm"));
#else
	CEveryDayAppUi* pApp = (CEveryDayAppUi*)CEikonEnv::Static()->AppUi();
	pApp->GetAppPath(pathMbm);
	pathMbm.Append(_L("EveryDay.mbm"));
#endif
	CEikStatusPane* statusPane = StatusPane();
	
	//set icon
	CAknContextPane* contextPane = (CAknContextPane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidContext));
	CFbsBitmap* bitmap = iEikonEnv->CreateBitmapL(pathMbm, EMbmEverydayNotepan_1_icon);
	CFbsBitmap* bitmapMask = iEikonEnv->CreateBitmapL(pathMbm, EMbmEverydayNotepan_1_mask);
	
	//contextPane->SetPicture(bitmap);
	contextPane->SetPicture(bitmap, bitmapMask);
	
	//load chinese words
	TBuf<32> sTmpTitle;
	CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_HELP_TITLE);
	
	CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
	titlePane->SetTextL(sTmpTitle);
}

// ---------------------------------------------------------
// CHelpView::DoDeactivate()
// Deletes the Container class object.
// ---------------------------------------------------------
void CHelpView::DoDeactivate()
{
    if (iContainer)
	{
        AppUi()->RemoveFromStack(iContainer);
		
		delete iContainer;
		iContainer = NULL;
	}
}

// End of File

⌨️ 快捷键说明

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