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

📄 polytubeappui.cpp

📁 手机 GAME c++ 版
💻 CPP
字号:
////////////////////////////////////////////////////////////////////////
//
// PolyTubeAppUi.cpp
//
// Copyright (c) 2003 Nokia Mobile Phones.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////

#include <avkon.hrh>
#include <eikmenup.h>

#include "PolyTubeAppUi.h"
#include "PolyTubeAppView.h"
#include "PolyTube.hrh"
#include <PolyTube.rsg>

////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

CPolyTubeAppUi::CPolyTubeAppUi()
    {
    }

////////////////////////////////////////////////////////////////////////

// ConstructL is called by the application framework
void CPolyTubeAppUi::ConstructL()
    {
    BaseConstructL();

    //  Create the application view
	iAppView = CPolyTubeAppView::NewL(ApplicationRect());    

    AddToStackL(iAppView);
    }

////////////////////////////////////////////////////////////////////////

CPolyTubeAppUi::~CPolyTubeAppUi()
    {
    if (iAppView)
		{
		RemoveFromStack(iAppView);

		delete iAppView;
		iAppView = NULL;
		}
    }

////////////////////////////////////////////////////////////////////////

void CPolyTubeAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
        {
        case EAknSoftkeyExit:
            Exit();
            break;
		case EPolyTubeGameStart:
			static_cast<CPolyTubeAppView*>(iAppView)->StartGameL();
			break;
		case EPolyTubeGameStop:
			static_cast<CPolyTubeAppView*>(iAppView)->StopGame();
			break;
        default:
            break;
        }
    }

////////////////////////////////////////////////////////////////////////

// The Uikon framework calls this function immediately before the menu pane is activated 
void CPolyTubeAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
	{
	if (aResourceId == R_POLYTUBE_MENUPANE)
		{
		if (static_cast<CPolyTubeAppView*>(iAppView)->IsPlaying())
			{
			aMenuPane->SetItemDimmed(EPolyTubeGameStart, ETrue);
			aMenuPane->SetItemDimmed(EPolyTubeGameStop, EFalse);
			}
		else
			{
			aMenuPane->SetItemDimmed(EPolyTubeGameStart, EFalse);
			aMenuPane->SetItemDimmed(EPolyTubeGameStop, ETrue);
			}
		}
	}

////////////////////////////////////////////////////////////////////////

void CPolyTubeAppUi::HandleForegroundEventL(TBool aForeground)
{
	if (!aForeground)
	{
		iAppView->StopGame();
	}
	else
	{
		iAppView->StartGameL();
	}
}

////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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