guictrlsappui.cpp

来自「《基于Symbian OS的手机开发与应用实践》这本书的配套源码。」· C++ 代码 · 共 94 行

CPP
94
字号
/*
* ============================================================================
*  Name     : CGuiCtrlsAppUi from GuiCtrlsAppui.cpp
*  Part of  : GuiCtrls
*  Created  : 15.04.2005 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include "GuiCtrlsAppui.h"
#include "GuiCtrlsView.h"
#include "MenuDemoView.h"
#include <GuiCtrls.rsg>
#include "GuiCtrls.hrh"

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CGuiCtrlsAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CGuiCtrlsAppUi::ConstructL()
    {
    BaseConstructL();

    CGuiCtrlsView* view = new (ELeave) CGuiCtrlsView;
    CleanupStack::PushL( view );
    view->ConstructL();
    AddViewL( view );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view1

    CMenuDemoView* view2 = new (ELeave) CMenuDemoView;
    CleanupStack::PushL( view2);
    view2->ConstructL();
    AddViewL( view2 );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view2
    
    SetDefaultViewL(*view);

    }

// ----------------------------------------------------
// CGuiCtrlsAppUi::~CGuiCtrlsAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CGuiCtrlsAppUi::~CGuiCtrlsAppUi()
    {
   }

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

// ----------------------------------------------------
// CGuiCtrlsAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CGuiCtrlsAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EEikCmdExit:
            {
            Exit();
            break;
            }        
        // TODO: Add Your command handling code here

        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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