📄 titlepaneview1.cpp
字号:
/**
*
* @brief Definition of CTitlePaneView1
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
// INCLUDES
// Class include
#include "TitlePaneView1.h"
// System includes
#include <aknviewappui.h> // CAknViewAppUi
#include <TitlePane.rsg> // R_TitlePane_VIEW1
// User includes
#include "TitlePaneContainer1.h" // CTitlePaneContainer1
#include "TitlePane.hrh" // TTitlePaneViewNumber
// ================= MEMBER FUNCTIONS =======================
/**
* Destructor. Frees up memory for the iLabel.
*/
CTitlePaneView1::~CTitlePaneView1()
{
delete iContainer;
}
/**
* Symbian OS 2 phase constructor.
* Constructs the CTitlePaneView1 using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
*
* @param aRect The rectangle for this window
* @return The newly constructed CTitlePaneView1
*/
CTitlePaneView1* CTitlePaneView1::NewL()
{
CTitlePaneView1* self = CTitlePaneView1::NewLC();
CleanupStack::Pop(self);
return self;
}
/**
* Symbian OS 2 phase constructor.
* Constructs the CTitlePaneView1 using the constructor and ConstructL
* method, leaving the constructed object on the CleanupStack before returning it.
*
* @param aRect The rectangle for this window
* @return The newly constructed CTitlePaneView1
*/
CTitlePaneView1* CTitlePaneView1::NewLC()
{
CTitlePaneView1* self = new (ELeave) CTitlePaneView1();
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
/**
* Symbian OS 2nd phase constructor.
* Uses the superclass constructor to construct the view using the
* R_TitlePane_VIEW1 resource.
*/
void CTitlePaneView1::ConstructL()
{
BaseConstructL(R_TITLEPANE_VIEW1);
}
/**
* Called by the framework
* @return The Uid for this view
*/
TUid CTitlePaneView1::Id() const
{
return TUid::Uid(ETitlePaneView1Id);
}
/**
* Called by the framework when the view is activated. Constructs the
* container if necessary, setting this view as its MOP parent, and
* adding it to the control stack.
*/
void CTitlePaneView1::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = CTitlePaneContainer1::NewL(ClientRect());
iContainer->SetMopParent(this);
AppUi()->AddToStackL(*this, iContainer);
}
}
/**
* Called by the framework when the view is deactivated.
* Removes the container from the control stack and deletes it.
*/
void CTitlePaneView1::DoDeactivate()
{
if (iContainer)
{
AppUi()->RemoveFromStack(iContainer);
delete iContainer;
iContainer = NULL;
}
}
/**
* From CAknView, takes care of command handling for this view.
*
* @param aCommand command to be handled
*/
void CTitlePaneView1::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
default:
{
AppUi()->HandleCommandL(aCommand);
}
}
}
/**
* From CAknView, makes the container redraw when the status pane's size has
* been changed, e.g. by changing its visibility
*
*/
void CTitlePaneView1::HandleStatusPaneSizeChange()
{
iContainer->SetRect (ClientRect());
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -