newapp11view.cpp

来自「一个很不错的Symbian程序源代码,里面有图片和一些对话框」· C++ 代码 · 共 139 行

CPP
139
字号
/*
============================================================================
 Name        : CNewApp11View from NewApp11View.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CNewApp11View implementation
============================================================================
*/

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <avkon.hrh>
#include  <NewApp11.rsg>
#include  "NewApp11View.h"
#include  "NewApp11Container.h" 
#include  "NewApp11AppUi.h"
#include  <EIKAPPUI.H>

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

// ---------------------------------------------------------
// CNewApp11View::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CNewApp11View::ConstructL()
    {
    BaseConstructL( R_NEWAPP11_VIEW1 );

	
    }
void CNewApp11View::NextCoursor(TInt aStep)
{
	iContainer->NextCoursor(aStep);
 }

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

    delete iContainer;
    }

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

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

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

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

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



⌨️ 快捷键说明

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