📄 helpview.cpp
字号:
/*
* ============================================================================
* Name : CHelpView from CAknView
* Part of : Help
* Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include <HelperGenius.rsg>
#include "HelperGenius.hrh"
#include "HelpView.h"
#include "HelpContainer.h"
#include <akncontext.h> //for CAknContextPane
#include <akntitle.h> //for CAknTitlePane
#include "HelperGeniusAppUi.h"
#include "NoteView.h"
#include "SmsView.h"
#include <HelperGenius.mbg> //for mbm
#include "MyGridView.h"
#include "RegisterView.h"
// ================= MEMBER HelpS =======================
// C++ default constructor can NOT contain any code, that
// might leave.
//
CHelpView* CHelpView::NewL()
{
CHelpView* self = NewLC();
CleanupStack::Pop(self);
return self;
}
CHelpView* CHelpView::NewLC()
{
CHelpView* self = new (ELeave) CHelpView;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CHelpView::CHelpView()
{
}
// EPOC default constructor can leave.
void CHelpView::ConstructL()
{
BaseConstructL(R_HELPOFNOTE_VIEW);
}
// Destructor
CHelpView::~CHelpView()
{
}
// ---------------------------------------------------------
// TUid CHelpView::Id()
// Returns Id of the view.
// ---------------------------------------------------------
TUid CHelpView::Id() const
{
return KHelpId;
}
// ---------------------------------------------------------
// CHelpView::HandleCommandL(TInt aCommand)
// Handles commands
// ---------------------------------------------------------
void CHelpView::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EHelperGeniusCmdNote:
{
if(iTuid.iUid == 1)
AppUi()->ActivateLocalViewL(KRegisterId);
if(iTuid.iUid == 3)
AppUi()->ActivateLocalViewL(KMyGridId);
if(iTuid.iUid == 4)
AppUi()->ActivateLocalViewL(KNoteId);
if(iTuid.iUid == 9)
AppUi()->ActivateLocalViewL(KSmsId);
break;
// _LIT(message,"Command 1");
// CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
// informationNote->ExecuteLD(message);
}
default:
AppUi()->HandleCommandL(aCommand);
break;
}
}
// ---------------------------------------------------------
// CHelpView::HandleClientRectChange()
// Handles client rect change.
// ---------------------------------------------------------
void CHelpView::HandleClientRectChange()
{
if (iContainer)
{
iContainer->SetRect(ClientRect());
}
}
// ---------------------------------------------------------
// CHelpView::DoActivateL(...)
// Creates the Container class object.
// ---------------------------------------------------------
void CHelpView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
TUid aCustomMessageId,
const TDesC8& /*aCustomMessage*/)
{
iTuid = aCustomMessageId;
iContainer = new (ELeave) CHelpContainer;
iContainer->SetMopParent(this);
TRect rc;
rc.SetRect(ClientRect().iTl, TSize(176, 144));
iContainer->ConstructL(rc);
AppUi()->AddToStackL(*this, iContainer);
TBuf<KMaxPath> pathMbm;
#ifdef __WINS__
pathMbm.Copy(_L("z:\\system\\apps\\HelperGenius\\HelperGenius.mbm"));
#else
CHelperGeniusAppUi* pApp = (CHelperGeniusAppUi*)CEikonEnv::Static()->AppUi();
pApp->GetAppPath(pathMbm);
pathMbm.Append(_L("HelperGenius.mbm"));
#endif
CEikStatusPane* statusPane = StatusPane();
//set icon
CAknContextPane* contextPane=(CAknContextPane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidContext));
CFbsBitmap* bitmap = iEikonEnv->CreateBitmapL(pathMbm, EMbmHelpergeniusHelpergenius_icon_20);
CFbsBitmap* bitmapMask = iEikonEnv->CreateBitmapL(pathMbm, EMbmHelpergeniusHelpergenius_mask_20);
//contextPane->SetPicture(bitmap);
contextPane->SetPicture(bitmap, bitmapMask);
TBuf<32> sTmpTitle;
CEikonEnv::Static()->ReadResource(sTmpTitle, R_QTN_MH_HELP_TITLE);
CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
titlePane->SetTextL(sTmpTitle);
}
// ---------------------------------------------------------
// CHelpView::DoDeactivate()
// Deletes the Container class object.
// ---------------------------------------------------------
void CHelpView::DoDeactivate()
{
if (iContainer)
{
AppUi()->RemoveFromStack(iContainer);
delete iContainer;
iContainer = NULL;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -