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

📄 launchjavaappui.cpp

📁 在Symbian平台程序调用J2ME程序.
💻 CPP
字号:
/*
============================================================================
 Name        : CLaunchJavaAppUi from LaunchJavaAppui.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CLaunchJavaAppUi implementation
============================================================================
*/

// INCLUDE FILES
#include "LaunchJavaAppui.h"
#include "LaunchJavaView.h"
#include "LaunchJavaView2.h"
#include <LaunchJava.rsg>
#include "LaunchJava.hrh"

#include <avkon.hrh>

// ----------------------------------------------------------
// CLaunchJavaAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CLaunchJavaAppUi::ConstructL()
    {
    BaseConstructL( EAknEnableSkin );

    // Show tabs for main views from resources
    CEikStatusPane* sp = StatusPane();

    // Fetch pointer to the default navi pane control
    iNaviPane = (CAknNavigationControlContainer*)sp->ControlL( 
        TUid::Uid(EEikStatusPaneUidNavi));

    // Tabgroup has been read from resource and it were pushed to the navi pane. 
    // Get pointer to the navigation decorator with the ResourceDecorator() function. 
    // Application owns the decorator and it has responsibility to delete the object.
    iDecoratedTabGroup = iNaviPane->ResourceDecorator();
    if (iDecoratedTabGroup)
        {
        iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
		iTabGroup->SetObserver( this );
		}

    CLaunchJavaView* view1 = new (ELeave) CLaunchJavaView;

    CleanupStack::PushL( view1 );
    view1->ConstructL();
    AddViewL( view1 );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view1

    CLaunchJavaView2* view2 = new (ELeave) CLaunchJavaView2;

    CleanupStack::PushL( view2 );
    view2->ConstructL();
    AddViewL( view2 );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view2

    SetDefaultViewL(*view1);

    }

// ----------------------------------------------------
// CLaunchJavaAppUi::~CLaunchJavaAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CLaunchJavaAppUi::~CLaunchJavaAppUi()
    {
    delete iDecoratedTabGroup;
   }

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

// ----------------------------------------------------
// CLaunchJavaAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CLaunchJavaAppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode aType)
    {
	if ( iTabGroup == NULL )
        {
        return EKeyWasNotConsumed;
        }

    if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
        {
        return iTabGroup->OfferKeyEventL( aKeyEvent, aType );
        }
    else
        {
        return EKeyWasNotConsumed;
        }
    }

// ----------------------------------------------------
// CLaunchJavaAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CLaunchJavaAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case ELaunchJavaCmdAppTest:
            {
            iEikonEnv->InfoMsg(_L("test"));
            break;
            }

        default:
            break;      
        }
    }

 // ----------------------------------------------------
 // CLaunchJavaAppUi::TabChangedL(TInt aIndex)
 // This method gets called when CAknTabGroup active 
 // tab has changed.
 // ----------------------------------------------------
 //
 void CLaunchJavaAppUi::TabChangedL(TInt aIndex)
     {
     ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(aIndex)));
     }

⌨️ 快捷键说明

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