redcontainer.cpp

来自「自己做的一个练习的小例子」· C++ 代码 · 共 80 行

CPP
80
字号

#include <gulicon.h>
#include <aknutils.h>    // definition of AKN_LAF_COLOR()
#include <avkon.hrh>
#include <akntitle.h>
#include <aknnotewrappers.h>

#include "RedContainer.h"


//////////////////////////////////////////////////////////////////////////
CRedContainer::CRedContainer()
{
}

// EPOC default constructor can leave.
void CRedContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();
    SetRect( aRect );
    ActivateL();
}

// destructor
CRedContainer::~CRedContainer()
{
}

void CRedContainer::SizeChanged()
{
}

// ---------------------------------------------------------
// CRedContainer::CountComponentControls() const
// return the number of controls
// ---------------------------------------------------------
//
TInt CRedContainer::CountComponentControls() const
{
	// return number of controls inside this container
	return 0; 
}

// ---------------------------------------------------------
// CRedContainer::ComponentControl(TInt aIndex) const
// return the pointer to specified control.
// ---------------------------------------------------------
//
CCoeControl* CRedContainer::ComponentControl( TInt /*aIndex*/ ) const
{
	return NULL;
}

// ---------------------------------------------------------
// CRedContainer::Draw(const TRect& aRect) const
// handle the message when client region must be redrawn.
// ---------------------------------------------------------
//
void CRedContainer::Draw( const TRect& /*aRect*/ ) const
{
	CWindowGc& gc = SystemGc();
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.SetBrushColor(KRgbRed);
	gc.DrawRect(Rect());
}

// ---------------------------------------------------------
// CAknExGridContainer::OfferKeyEventL(
//           const TKeyEvent& aKeyEvent, TEventCode aType )
// Handles the key events.
// ---------------------------------------------------------
//
TKeyResponse CRedContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType )
{
	return EKeyWasConsumed;
}



⌨️ 快捷键说明

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