📄 pushboxappview.cpp
字号:
/*
============================================================================
Name : pushBoxView.cpp
Author :
Version :
Copyright : Your copyright notice
Description : Application view
============================================================================
*/
// INCLUDE FILES
#include <coemain.h>
#include "pushBoxAppView.h"
#include <fbs.h>
#include <s32file.h>
#include "f32file.h"
#include <aknutils.h>
#include <pushBox.mbg>
#include "pushBox.hrh"
#include <e32cmn.h>
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CpushBoxAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CpushBoxAppView* CpushBoxAppView::NewL( const TRect& aRect )
{
CpushBoxAppView* self = CpushBoxAppView::NewLC( aRect );
CleanupStack::Pop( self );
return self;
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CpushBoxAppView* CpushBoxAppView::NewLC( const TRect& aRect )
{
CpushBoxAppView* self = new ( ELeave ) CpushBoxAppView;
CleanupStack::PushL( self );
self->ConstructL( aRect );
return self;
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CpushBoxAppView::ConstructL( const TRect& aRect )
{
// Create a window for this application view
CreateWindowL();
//加载位图
TFileName file(KMbmFileName);
User::LeaveIfError (CompleteWithAppPath (file));
User::LeaveIfError(iImage->Load(file,EMbmPushboxMouse));
// Set the windows size
SetRect( aRect );
// Activate the window, which makes it ready to be drawn
ActivateL();
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::CpushBoxAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CpushBoxAppView::CpushBoxAppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::~CpushBoxAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CpushBoxAppView::~CpushBoxAppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CpushBoxAppView::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 );
}
// -----------------------------------------------------------------------------
// CpushBoxAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CpushBoxAppView::SizeChanged()
{
DrawNow();
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -