⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rpsappui.cpp

📁 基于symbian UIQ 的一款古老的飞机游戏。对入门学习很有帮助。
💻 CPP
字号:
// Copyright (c) Symbian Ltd 2008. All rights reserved.

// INCLUDE FILES
#include <eikenv.h>
#include <rps_0xA00055FF.rsg>

#include "common.hrh"
#include "rps.hrh"
#include "rpsApplication.h"
#include "rpsAppUi.h"
#include "rpsAppView.h"

TInt gScreenWidth;
TInt gScreenHeight;

// -----------------------------------------------------------------------------
// CRpsAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CRpsAppUi::ConstructL()
	{
	// Initialise app UI with standard value.
	BaseConstructL();
		
	gScreenWidth = ClientRect().Width();
	gScreenHeight = ClientRect().Height();
	
	iGameEngine = CRpsGameEngine::NewL(*this);

	// Create view object
	iAppView = CRpsAppView::NewL(*iGameEngine, ClientRect());
	AddToStackL(iAppView);

	}
// -----------------------------------------------------------------------------
// CRpsAppUi::CRpsAppUi()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CRpsAppUi::CRpsAppUi()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CRpsAppUi::~CRpsAppUi()
// Destructor.
// -----------------------------------------------------------------------------
//
CRpsAppUi::~CRpsAppUi()
	{
	delete iGameEngine;
	if (iAppView)
		{
		RemoveFromStack(iAppView);
		delete iAppView;
		}
	}

// -----------------------------------------------------------------------------
// CRpsAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CRpsAppUi::HandleCommandL( TInt /*aCommand*/ )
	{
	}
// -----------------------------------------------------------------------------
//  Called by the framework when the application status pane
//  size is changed.  Passes the new client rectangle to the
//  AppView
// -----------------------------------------------------------------------------
//
void CRpsAppUi::HandleStatusPaneSizeChange()
	{
	iAppView->SetRect( ClientRect() );
	} 

void CRpsAppUi::UpdateScreen()
	{
	iAppView->DrawNow();
	}

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -