📄 detailinfoview.cpp
字号:
/*
* ============================================================================
* Name : CDetailInfoView from CAknView
* Part of : DetailInfo
* Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include <akntitle.h>
#include <FrMes.rsg>
#include "FrMes.hrh"
#include "DetailInfoView.h"
#include "DetailInfoContainer.h"
// ================= MEMBER FUNCTIONS =======================
// C++ default constructor can NOT contain any code, that
// might leave.
//
CDetailInfoView* CDetailInfoView::NewL()
{
CDetailInfoView* self = NewLC();
CleanupStack::Pop(self);
return self;
}
CDetailInfoView* CDetailInfoView::NewLC()
{
CDetailInfoView* self = new (ELeave) CDetailInfoView;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CDetailInfoView::CDetailInfoView()
{
}
// EPOC default constructor can leave.
void CDetailInfoView::ConstructL()
{
BaseConstructL(R_DETAILINFO_VIEW);
}
// Destructor
CDetailInfoView::~CDetailInfoView()
{
if (iContainer)
{
AppUi()->RemoveFromStack(iContainer);
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CDetailInfoView::Id()
// Returns Id of the view.
// ---------------------------------------------------------
TUid CDetailInfoView::Id() const
{
return KDetailInfoViewId;
}
// ---------------------------------------------------------
// CDetailInfoView::HandleCommandL(TInt aCommand)
// Handles commands
// ---------------------------------------------------------
void CDetailInfoView::HandleCommandL(TInt aCommand)
{
if(aCommand == EAknSoftkeyBack)
AppUi()->HandleCommandL(aCommand);
}
// ---------------------------------------------------------
// CDetailInfoView::HandleClientRectChange()
// Handles client rect change.
// ---------------------------------------------------------
void CDetailInfoView::HandleClientRectChange()
{
if (iContainer)
{
iContainer->SetRect(ClientRect());
}
}
// ---------------------------------------------------------
// CDetailInfoView::DoActivateL(...)
// Creates the Container class object.
// ---------------------------------------------------------
void CDetailInfoView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
iContainer = new (ELeave) CDetailInfoContainer;
iContainer->SetMopParent(this);
//===============================modify cba by wzg===============
TRect rc;
rc.SetRect(ClientRect().iTl, TSize(176, 144));
iContainer->ConstructL(rc);
AppUi()->AddToStackL(*this, iContainer);
//modify title by wzg
TBuf<32> sTmpTitle;
CEikStatusPane* statusPane = StatusPane();
CEikonEnv::Static()->ReadResource(sTmpTitle,R_FRMES_VIEW_TITLE_DETAILINFO);
CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
titlePane->SetTextL(sTmpTitle);
}
// ---------------------------------------------------------
// CDetailInfoView::DoDeactivate()
// Deletes the Container class object.
// ---------------------------------------------------------
void CDetailInfoView::DoDeactivate()
{
if (iContainer)
{
AppUi()->RemoveFromStack(iContainer);
}
delete iContainer;
iContainer = NULL;
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -