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

📄 graphicexameffectview.cpp

📁 国内著名嵌入式培训机构内部资料,内含一些实例代码,包括技术专题书籍
💻 CPP
字号:
/*
============================================================================
 Name        : CGraphicExamEffectView from GraphicExamEffectView.h
 Author      : hou maoqing
 Version     :
 Copyright   : Copyright (c) Hou maoqing 2008
 Description : Declares container control for application.
============================================================================
*/

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <avkon.hrh>
// TODO: Change the following include directive to point to the correct
// resource header file. The current value should be correct if the project
// was created using one of the templates provided by Nokia.
#include  <GraphicExam.rsg>
#include  "GraphicExamEffectView.h"
#include  "GraphicExamEffectContainer.h"
#include "GraphicExam.hrh"

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

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

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

    delete iContainer;
    }

// ---------------------------------------------------------
// TUid CGraphicExamEffectView::Id()
//
// ---------------------------------------------------------
//
TUid CGraphicExamEffectView::Id() const
    {
    return KGraphicExamEffectViewId;
    }

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

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

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

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

// End of File

⌨️ 快捷键说明

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