fileexamappview.cpp
来自「国内著名嵌入式培训机构内部资料,内含一些实例代码,包括技术专题书籍」· C++ 代码 · 共 106 行
CPP
106 行
/*
============================================================================
Name : FileExamAppView.cpp
Author : hou maoqing
Copyright : Copyright (c) Hou maoqing 2008
Description : Application view implementation
============================================================================
*/
// INCLUDE FILES
#include <coemain.h>
#include "FileExamAppView.h"
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CFileExamAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CFileExamAppView* CFileExamAppView::NewL(const TRect& aRect)
{
CFileExamAppView* self = CFileExamAppView::NewLC(aRect);
CleanupStack::Pop(self);
return self;
}
// -----------------------------------------------------------------------------
// CFileExamAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CFileExamAppView* CFileExamAppView::NewLC(const TRect& aRect)
{
CFileExamAppView* self = new ( ELeave ) CFileExamAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
return self;
}
// -----------------------------------------------------------------------------
// CFileExamAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CFileExamAppView::ConstructL(const TRect& aRect)
{
// Create a window for this application view
CreateWindowL();
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();
}
// -----------------------------------------------------------------------------
// CFileExamAppView::CFileExamAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CFileExamAppView::CFileExamAppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CFileExamAppView::~CFileExamAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CFileExamAppView::~CFileExamAppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CFileExamAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CFileExamAppView::Draw(const TRect& /*aRect*/) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect drawRect(Rect());
// Clears the screen
gc.Clear(drawRect);
}
// -----------------------------------------------------------------------------
// CFileExamAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CFileExamAppView::SizeChanged()
{
DrawNow();
}
// End of File
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?