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

📄 jewelappui.cpp

📁 symbian下的泡泡龙游戏源码,手机游戏开放新手学习的好资料
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CJewelAppUi from JewelAppui.cpp
*  Part of  : Jewel
*  Created  : 02.10.2005 by Thosing
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  : 0.1
*  Copyright: Another
* ============================================================================
*/

// INCLUDE FILES
#include "JewelAppui.h"
#include "JewelView.h"
#include "JewelEngine.h"
#include "JewelStartScreen.h"
#include <Jewel.rsg>
#include "Jewel.hrh"

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CJewelAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CJewelAppUi::ConstructL() {
  BaseConstructL();

  iStartScreen = new (ELeave) CJewelStartScreen;
  iStartScreen->SetMopParent( this );
  iStartScreen->ConstructL( ApplicationRect() );
  AddToStackL( iStartScreen );
  iStartScreen->ActivateL();

  iAppContainer = new (ELeave) CJewelView;
  iAppContainer->SetMopParent( this );
  iAppContainer->ConstructL( ApplicationRect() );
  AddToStackL( iAppContainer );

  iGameStart=EFalse;

}

// ----------------------------------------------------
// CJewelAppUi::~CJewelAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CJewelAppUi::~CJewelAppUi() {
  if (iAppContainer) {
    RemoveFromStack( iAppContainer );
    delete iAppContainer;
  }
  if(iStartScreen) {
    RemoveFromStack(iStartScreen);
    delete iStartScreen;
  }
}

// ------------------------------------------------------------------------------
// CJewelAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
//  This function is called by the EIKON framework just before it displays
//  a menu pane. Its default implementation is empty, and by overriding it,
//  the application can set the state of menu items dynamically according
//  to the state of application data.
// ------------------------------------------------------------------------------
//
void CJewelAppUi::DynInitMenuPaneL(TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/){}

// ----------------------------------------------------
// CJewelAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CJewelAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode aType){
  if(!iGameStart && aType==EEventKeyDown) {
    iAppContainer->ActivateL();
    iGameStart=ETrue;
    iStartScreen->MakeVisible(EFalse);
    iAppContainer->MakeVisible(ETrue);
    iAppContainer->FullLife();
  }
  return EKeyWasNotConsumed;
}

// ----------------------------------------------------
// CJewelAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CJewelAppUi::HandleCommandL(TInt aCommand) {
  switch ( aCommand ) {
    case EAknSoftkeyBack:
    case EEikCmdExit:
      {
        Exit();
        break;
      }
    case EJewelCmdAppTest:
      {
        _LIT(KHIGHSCORE, "High Score:");
        TBuf<21> msg(KHIGHSCORE);
        msg.AppendNum(CJewelEngine::LoadHighScore());
        iEikonEnv->InfoMsg(msg);
        break;
      }

    default:
      break;      
  }
}



// End of File  

⌨️ 快捷键说明

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