scalablescreendrawingview.cpp
来自「一个界面绘图的例子」· C++ 代码 · 共 71 行
CPP
71 行
// ScalableScreenDrawingView.cpp
// ------------------
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// view class - CScalableScreenDrawingView
//
////////////////////////////////////////////////////////////////////////
#include "ScalableScreenDrawingView.h"
#include "ScalableScreenDrawing.h"
#include <aknutils.h>
// Static constructor
CScalableScreenDrawingView* CScalableScreenDrawingView::NewLC()
{
CScalableScreenDrawingView* self = new (ELeave) CScalableScreenDrawingView;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
// Default constructor
CScalableScreenDrawingView::CScalableScreenDrawingView()
{
iContainer = NULL;
}
// Second-phase constructor
void CScalableScreenDrawingView::ConstructL()
{
BaseConstructL();
}
// Destructor
CScalableScreenDrawingView::~CScalableScreenDrawingView()
{
DoDeactivate();
}
// Destroy control when view is deactivated.
void CScalableScreenDrawingView::DoDeactivate()
{
if(iContainer)
{
AppUi()->RemoveFromStack(iContainer);
delete iContainer;
iContainer = NULL;
}
}
// View creates the control when it is activated.
void CScalableScreenDrawingView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
__ASSERT_ALWAYS(iContainer == NULL, User::Panic(_L("SNOWVIEW"), KErrAlreadyExists));
iContainer = new (ELeave) CScalableScreenDrawingControl();
iContainer->SetMopParent(this);
iContainer->ConstructL( AppUi()->ApplicationRect(), AppUi() ); // For full screen
AppUi()->AddToStackL( *this, iContainer );
}
TUid CScalableScreenDrawingView::Id() const
{
return KScalableScreenDrawingViewId;
}
// End of file.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?