lianappui.cpp

来自「symbian 的lian-liankan」· C++ 代码 · 共 121 行

CPP
121
字号
/*
* ============================================================================
*  Name     : CLianAppUi from LianAppUi.cpp
*  Part of  : Lian
*  Created  : 2006-3-15 by 
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: 
* ============================================================================
*/

// INCLUDE FILES
#include "LianAppUi.h"
#include "LianContainer.h" 
#include <Lian.rsg>
#include "lian.hrh"

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CLianAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CLianAppUi::ConstructL()
    {
    BaseConstructL();
    iAppContainer = new (ELeave) CLianContainer;
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL( ApplicationRect() );
    AddToStackL( iAppContainer );
    }

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

// ------------------------------------------------------------------------------
// CLianAppUi::::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 CLianAppUi::DynInitMenuPaneL(
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
    {
    }

// ----------------------------------------------------
// CLianAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CLianAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------
// CLianAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CLianAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case EStart:
            {
			iAppContainer->beStart=true;
            break;
			}
		case EEasy:
			{
				iAppContainer->StartGame(4,6);
				break;
			}
		case ENormal:
			{
				iAppContainer->StartGame(6,8);
				break;
			}
		case EHard:
			{
				iAppContainer->StartGame(8,10);
				break;
			}
            
        // TODO: Add Your command handling code here

        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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