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

📄 switchtestappui.cpp

📁 《基于Symbian OS的手机开发与应用实践》这本书的配套源码。
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CSwitchTestAppUi from SwitchTestAppUi.cpp
*  Part of  : SwitchTest
*  Created  : 03.12.2005 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include "SwitchTestAppUi.h"
#include "SwitchTestContainer.h" 
#include <SwitchTest.rsg>
#include "switchtest.hrh"

#include <avkon.hrh>
const TUid KUidMultiView = { 0x0DDEB872 };
const TUid KUidListView = {1};
const TUid KCustomMessageUid = {1};
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CSwitchTestAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CSwitchTestAppUi::ConstructL()
    {
    BaseConstructL();

    iAppContainer = new (ELeave) CSwitchTestContainer;
    iAppContainer->SetMopParent( this );
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
    }

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

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

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

// ----------------------------------------------------
// CSwitchTestAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CSwitchTestAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case ESwitchTestCmdAppTest:
            {
            TVwsViewId listView (KUidMultiView, KUidListView);
            
            // 消息数据的构造
            TBuf8<1> buf;
            buf.Append(3);
            
            //切换到ListView视图。(不传递数据的切换方式,这里不使用)
            //ActivateViewL(listView);
            
            //切换到ListView视图,并设置列表的缺省选项 
            ActivateViewL(listView,KCustomMessageUid,buf);

            break;
            }
        // TODO: Add Your command handling code here

        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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