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

📄 dirscraccview1.cpp

📁 symbian平台上如何在屏幕上快速的显示图片
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CDirScrAccView1 from DirScrAccView1.h
*  Part of  : DirScrAcc
*  Created  : 20.11.2002 by Forum Nokia
*  Implementation notes:
*        This class defines the view 1 which demonstrates Direct Screen Access in GUI application. 
*        Initial content was generated by Nokia Series 60 AppWizard.
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <akntabgrp.h>        // For handling tabs
#include  <avkon.hrh>
#include  <DirScrAcc.rsg>
#include  "DirScrAccView1.h"
#include  "DirScrAccView2.h"
#include  "DirScrAccView3.h"
#include  "DirScrAccContainer1.h" 
#include  "dirscracc.hrh"


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

// ---------------------------------------------------------
// CDirScrAccView1::ConstructL(const TRect& aRect)
// Symbiantwo-phased constructor
// ---------------------------------------------------------
//
void CDirScrAccView1::ConstructL()
    {
    BaseConstructL( R_DIRSCRACC_VIEW1 );
    }

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

    delete iContainer;
    }

// ---------------------------------------------------------
// TUid CDirScrAccView1::Id()
// This returns the view ID
// ---------------------------------------------------------
//
TUid CDirScrAccView1::Id() const
    {
    return KView1Id;
    }

// ---------------------------------------------------------
// CDirScrAccView1::HandleCommandL(TInt aCommand)
// Here we handle commands for this view. 
// Each view has their own HandleCommandL()
// ---------------------------------------------------------
//
void CDirScrAccView1::HandleCommandL(TInt aCommand)
    {   
    switch ( aCommand )
        {        
        case EAknSoftkeyBack:
            {
            AppUi()->HandleCommandL(EEikCmdExit);
            break;
            }
        case EDirScrAccCmdView1Cmd1:
            {            
            if(!iContainer->IsDrawing())
                iContainer->StartDrawingL();
            break;
            }
        case EDirScrAccCmdView1Cmd2:
            {    
            if(iContainer->IsDrawing())
               iContainer->StopDrawing();
            break;
            }
        case EDirScrAccCmdView1Cmd3:
            {          
            AppUi()->ActivateLocalViewL(TUid::Uid(2));
            break;
            }
        case EDirScrAccCmdView1Cmd4:
            {
            AppUi()->ActivateLocalViewL(TUid::Uid(3));
            break;
            }
            
        default:
            {
            AppUi()->HandleCommandL( aCommand );
            break;
            }
        }
    }

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

// ---------------------------------------------------------
// CDirScrAccView1::DoActivateL(...)
// This is called when a view needs to be activated. 
// This creates container with its controls.
// ---------------------------------------------------------
//
void CDirScrAccView1::DoActivateL(
   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
    {   
    // Create Container
    if (!iContainer)
        {
        iContainer = new (ELeave) CDirScrAccContainer1;
        iContainer->SetMopParent(this);
        // use the clientrect drawing area (not incl. status and control panes)
        iContainer->ConstructL( ClientRect() ); 
        AppUi()->AddToStackL( *this, iContainer );
        }    
   }

// ---------------------------------------------------------
// CDirScrAccView1::HandleCommandL(TInt aCommand)
// This is called when a view needs to be deactivated. 
// This destroys container with its controls.
// ---------------------------------------------------------
//
void CDirScrAccView1::DoDeactivate()
    {
    if ( iContainer )
        {
        AppUi()->RemoveFromViewStack( *this, iContainer );
        }
    
    delete iContainer;
    iContainer = NULL;
    }

// End of File

⌨️ 快捷键说明

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