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

📄 s60btlabappui.cpp

📁 S60培训教材代码(连载)
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CS60BTLabAppUi from S60BTLabAppUi.cpp
*  Part of  : S60BTLab
*  Created  : 10/14/2002 by 
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: 
* ============================================================================
*/

// INCLUDE FILES
#include "S60BTLabAppUi.h"
#include "S60BTLabAppView.h" 
#include <S60BTLab.rsg>
#include "S60BTLab.hrh"
#include "S60BTLab.pan"

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CS60BTLabAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CS60BTLabAppUi::ConstructL()
    {
    BaseConstructL();

	// create application view
    iAppView = CS60BTLabAppView::NewL(ApplicationRect());    

    AddToStackL(iAppView);
    }

CS60BTLabAppUi::CS60BTLabAppUi()                              
    {
    }


// ----------------------------------------------------
// CS60BTLabAppUi::~CS60BTLabAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CS60BTLabAppUi::~CS60BTLabAppUi()
    {
	// delete the view if it exists
	if (iAppView)
    	{
	    RemoveFromStack(iAppView);
		delete iAppView;
	    iAppView = NULL;
	    }
    }

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

// ----------------------------------------------------
// CS60BTLabAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CS60BTLabAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
	// key events are handled in the app view
    return iAppView->OfferKeyEventL(aKeyEvent, aType);
    }

// ----------------------------------------------------
// CS60BTLabAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CS60BTLabAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
        {
		case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            iAppView->LogL(_L8("Back/exit pressed"));
            Exit();
            break;
            }
		// handle menu commands - see S60BTLab.hrh for menu command IDs
       	case ES60BTLabCmdStartHost:
            // wait for client to join
            iAppView->StartHostL();
			break;

		case ES60BTLabCmdStartClient:
            // search for hosts to join
            iAppView->StartClientL();
			break;

		case ES60BTLabCmdEndGame:
            // quit the game that is currently being played
            iAppView->EndGameL();
			break;

        default:
			// something has gone wrong - panic
            User::Panic (_L("S60BTLab"), ES60BTLabBasicUi);
            break; 
            }
        }

// End of File  

⌨️ 快捷键说明

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