📄 vibraview2.cpp
字号:
/*
============================================================================
Name : CVibraView2 from VibraView2.h
Author :
Version :
Copyright : Your copyright notice
Description : CVibraView2 implementation
============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include <Vibra.rsg>
#include "VibraView2.h"
#include "VibraContainer2.h"
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CVibraView2::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CVibraView2::ConstructL()
{
BaseConstructL( R_VIBRA_VIEW2 );
}
// ---------------------------------------------------------
// CVibraView2::~CVibraView2()
// destructor
// ---------------------------------------------------------
//
CVibraView2::~CVibraView2()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CVibraView2::Id()
//
// ---------------------------------------------------------
//
TUid CVibraView2::Id() const
{
return KView2Id;
}
// ---------------------------------------------------------
// CVibraView2::HandleCommandL(TInt aCommand)
// takes care of view command handling
// ---------------------------------------------------------
//
void CVibraView2::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyOk:
{
iEikonEnv->InfoMsg( _L("view2 ok") );
break;
}
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
default:
{
AppUi()->HandleCommandL( aCommand );
break;
}
}
}
// ---------------------------------------------------------
// CVibraView2::HandleClientRectChange()
// ---------------------------------------------------------
//
void CVibraView2::HandleClientRectChange()
{
if ( iContainer )
{
iContainer->SetRect( ClientRect() );
}
}
// ---------------------------------------------------------
// CVibraView2::DoActivateL(...)
//
// ---------------------------------------------------------
//
void CVibraView2::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = new (ELeave) CVibraContainer2;
iContainer->SetMopParent(this);
iContainer->ConstructL( ClientRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// ---------------------------------------------------------
// CVibraView2::DoDeactivate()
//
// ---------------------------------------------------------
//
void CVibraView2::DoDeactivate()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
iContainer = NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -