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

📄 demonsymview.cpp

📁 symbian下的一个例子
💻 CPP
字号:
/*
============================================================================
 Name        : CDemonsymView from DemonsymView.h
 Author      : huhao
 Version     :
 Copyright   : baidu
 Description : CDemonsymView implementation
============================================================================
*/

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <avkon.hrh>
#include  <Demonsym.rsg>
#include  "DemonsymView.h"
#include  "DemonsymContainer.h" 

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

// ---------------------------------------------------------
// CDemonsymView::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CDemonsymView::ConstructL()
	{
	BaseConstructL( R_DEMONSYM_VIEW1 );
	}

// ---------------------------------------------------------
// CDemonsymView::~CDemonsymView()
// destructor
// ---------------------------------------------------------
//
CDemonsymView::~CDemonsymView()
	{
	if ( iContainer )
		{
		AppUi()->RemoveFromViewStack( *this, iContainer );
		}

	delete iContainer;
	}

// ---------------------------------------------------------
// TUid CDemonsymView::Id()
//
// ---------------------------------------------------------
//
TUid CDemonsymView::Id() const
	{
	return KViewId;
	}

// ---------------------------------------------------------
// CDemonsymView::HandleCommandL(TInt aCommand)
// takes care of view command handling
// ---------------------------------------------------------
//
void CDemonsymView::HandleCommandL(TInt aCommand)
	{   
	switch ( aCommand )
		{
		case EAknSoftkeyOk:
			{
			iEikonEnv->InfoMsg( _L("view1 ok") );
			break;
			}
		case EAknSoftkeyBack:
			{
			AppUi()->HandleCommandL(EEikCmdExit);
			break;
			}
		default:
			{
			AppUi()->HandleCommandL( aCommand );
			break;
			}
		}
	}

// ---------------------------------------------------------
// CDemonsymView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CDemonsymView::HandleClientRectChange()
	{
	if ( iContainer )
		{
		iContainer->SetRect( ClientRect() );
		}
	}

// ---------------------------------------------------------
// CDemonsymView::DoActivateL(...)
// 
// ---------------------------------------------------------
//
void CDemonsymView::DoActivateL(
   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
	{
	if (!iContainer)
		{
		iContainer = new (ELeave) CDemonsymContainer;
		iContainer->SetMopParent(this);
		iContainer->ConstructL( ClientRect() );
		AppUi()->AddToStackL( *this, iContainer );
		} 
   }

// ---------------------------------------------------------
// CDemonsymView::DoDeactivate()
// 
// ---------------------------------------------------------
//
void CDemonsymView::DoDeactivate()
	{
	if ( iContainer )
		{
		AppUi()->RemoveFromViewStack( *this, iContainer );
		}
	
	delete iContainer;
	iContainer = NULL;
	}

⌨️ 快捷键说明

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