bitmaprotatorappui.cpp

来自「symbian开发例子程序,来自书籍 symbian os c++手机应用程序开」· C++ 代码 · 共 104 行

CPP
104
字号
/*
* ============================================================================
*  Name     : CBitmapRotatorAppUi from BitmapRotatorAppui.cpp
*  Part of  : BitmapRotator
*  Created  : 30.01.2006 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include "BitmapRotatorAppui.h"
#include "BitmapRotatorContainer.h" 
#include <BitmapRotator.rsg>
#include "BitmapRotator.hrh"

#include <avkon.hrh>

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

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

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

// ----------------------------------------------------
// CBitmapRotatorAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CBitmapRotatorAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case EBitmapRotatorRotateLeft:
            {
            TKeyEvent keyEvent = {0, EStdKeyLeftArrow, 0, 0};
            TEventCode eventCode = EEventKey;
            iAppContainer->OfferKeyEventL(keyEvent, eventCode);
            break;
            }
        case EBitmapRotatorRotateRight:
            {
            TKeyEvent keyEvent = {0, EStdKeyRightArrow, 0, 0};
            TEventCode eventCode = EEventKey;
            iAppContainer->OfferKeyEventL(keyEvent, eventCode);
            break;
            }
        case EBitmapRotatorMirrorHorizontal:
            {
            TKeyEvent keyEvent = {0, EStdKeyUpArrow, 0, 0};
            TEventCode eventCode = EEventKey;
            iAppContainer->OfferKeyEventL(keyEvent, eventCode);
            break;
            }
        case EBitmapRotatorMirrorVertical:
            {
            TKeyEvent keyEvent = {0, EStdKeyDownArrow, 0, 0};
            TEventCode eventCode = EEventKey;
            iAppContainer->OfferKeyEventL(keyEvent, eventCode);
            break;
            }
         default:
            break;      
        }
    }



// End of File  

⌨️ 快捷键说明

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