📄 dirscraccview3.cpp
字号:
/*
* ============================================================================
* Name : CDirScrAccView3 from DirScrAccView3.h
* Part of : DirScrAcc
* Created : 20.11.2002 by Forum Nokia
* Implementation notes:
* This class defines the view 3, which demonstrates combination of
* Direct Screen API and drawing directly to the frame buffer.
* Note that the clipping region is not taken care of here. You need to handle
* that yourself.
* Initial content was generated by Nokia Series 60 AppWizard.
* Version : 1.0
* Copyright: Nokia Corporation
* ============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include <DirScrAcc.rsg>
#include "DirScrAccView3.h"
#include "DirScrAccContainer3.h"
#include "DirScrAcc.hrh"
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CDirScrAccView3::ConstructL(const TRect& aRect)
// Symbian two-phased constructor
// ---------------------------------------------------------
//
void CDirScrAccView3::ConstructL()
{
BaseConstructL( R_DIRSCRACC_VIEW3 );
iContainer = 0;
}
// ---------------------------------------------------------
// CDirScrAccView3::~CDirScrAccView3()
// Default destructor
// ---------------------------------------------------------
//
CDirScrAccView3::~CDirScrAccView3()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CDirScrAccView3::Id()
// This returns the view ID
// ---------------------------------------------------------
//
TUid CDirScrAccView3::Id() const
{
return KView3Id;
}
// ---------------------------------------------------------
// CDirScrAccView3::HandleCommandL(TInt aCommand)
// Here we handle commands for this view.
// Each view has their own HandleCommandL()
// ---------------------------------------------------------
//
void CDirScrAccView3::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
case EAknSoftkeyOk:
{
if(iContainer->IsDrawing())
iContainer->StopDrawing();
else
iContainer->StartDrawingL();
break;
}
default:
{
AppUi()->HandleCommandL( aCommand );
break;
}
}
}
// ---------------------------------------------------------
// CDirScrAccView3::HandleClientRectChange()
// ---------------------------------------------------------
//
void CDirScrAccView3::HandleClientRectChange()
{
if ( iContainer )
{
iContainer->SetRect( ClientRect() );
}
}
// ---------------------------------------------------------
// CDirScrAccView3::DoActivateL(...)
// This is called when a view needs to be activated.
// This creates container with its controls.
// ---------------------------------------------------------
//
void CDirScrAccView3::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
// Create Container
if (!iContainer)
{
iContainer = new (ELeave) CDirScrAccContainer3;
iContainer->SetMopParent(this);
// use the applicationrect (fullscreen) for drawing
iContainer->ConstructL( AppUi()->ApplicationRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// ---------------------------------------------------------
// CDirScrAccView3::HandleCommandL(TInt aCommand)
// This is called when a view needs to be deactivated.
// This destroys container with its controls.
// ---------------------------------------------------------
//
void CDirScrAccView3::DoDeactivate()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
delete iContainer;
iContainer = NULL;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -