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

📄 newapp11appui.cpp

📁 一个很不错的Symbian程序源代码,里面有图片和一些对话框
💻 CPP
字号:
/*
============================================================================
 Name        : CNewApp11AppUi from NewApp11Appui.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CNewApp11AppUi implementation
============================================================================
*/

// INCLUDE FILES
#include "NewApp11Appui.h"
#include "NewApp11View.h"
#include "NewApp11View2.h"
#include <NewApp11.rsg>
#include "NewApp11.hrh"
#include <eikspane.h> 
#include <avkon.hrh>


#include "SocketsEngine.h"
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CNewApp11AppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CNewApp11AppUi::ConstructL()
    {
    BaseConstructL();


    // 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 );
		}

    CNewApp11View* view1 = new (ELeave) CNewApp11View;

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

	iAppView1 = view1;

    CNewApp11View2* view2 = new (ELeave) CNewApp11View2;

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

	iAppView2 = view2;

	iAppView1->iAppRect =  ApplicationRect();
	sp->MakeVisible(EFalse);


	

    SetDefaultViewL(*view1);

    }

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

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

// ----------------------------------------------------
// CNewApp11AppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CNewApp11AppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode aType)
    {

	if ( iTabGroup == NULL )
        {
        return EKeyWasNotConsumed;
        }

    if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
        {
        return iTabGroup->OfferKeyEventL( aKeyEvent, aType );
        }
	/*
    else if( aKeyEvent.iCode == EKeyDownArrow)
	{
		iAppView1->NextCoursor(1);
	}
	else if(aKeyEvent.iCode == EKeyUpArrow)
	{
		iAppView1->NextCoursor(-1);
	}
	*/
	else if(aKeyEvent.iCode == EKeyRightShift)
	{
		return EKeyWasNotConsumed;
	}
	
    else
      {
		  if(aKeyEvent.iCode != 0 || aKeyEvent.iScanCode != 0)
		  {
			   return EKeyWasNotConsumed;
		  }
        return EKeyWasNotConsumed;
       }

    }

// ----------------------------------------------------
// CNewApp11AppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CNewApp11AppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case ENewApp11CmdAppTest:
            {
				iAppView2->ConnectServ();
            break;
            }
		case ENewApp11CmdSendTo:
			iAppView2->SendToServer();
			break;
        // TODO: Add Your command handling code here

        default:
            break;      
        }
    }

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

⌨️ 快捷键说明

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