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

📄 s60animationcontainer.cpp

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

// INCLUDE FILES
#include <barsread.h>
#include <coemain.h>
#include <aknbitmapanimation.h>
#include <S60Animation.rsg>

#include "S60AnimationContainer.h"



// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// CS60AnimationContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CS60AnimationContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();

    StartL();

    SetRect(aRect);
    ActivateL();
    }

// Destructor
CS60AnimationContainer::~CS60AnimationContainer()
    {
    Stop();
    }

void CS60AnimationContainer::StartL()
    {
    Stop();
    iBitmapAnimation  = CAknBitmapAnimation::NewL();
    TResourceReader reader;
    iCoeEnv->CreateResourceReaderLC(reader, R_S60ANIMATION_BMPANIM_DATA);
    iBitmapAnimation->ConstructFromResourceL(reader);
    iBitmapAnimation->SetContainerWindowL(*this);
    CleanupStack::PopAndDestroy(); // reader 
    iBitmapAnimation ->StartAnimationL();
    }

void CS60AnimationContainer::Stop()
    {
    if(iBitmapAnimation!=NULL)
        {
        iBitmapAnimation->CancelAnimation();
        delete iBitmapAnimation;
        iBitmapAnimation=NULL;
        }
    }

// ---------------------------------------------------------
// CS60AnimationContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CS60AnimationContainer::Draw(const TRect&/* aRect*/) const
    {
    CWindowGc& gc = SystemGc();
    gc.SetBrushColor(KRgbGray);
    gc.Clear();
    }

// End of File  

⌨️ 快捷键说明

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