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

📄 vibracontainer2.cpp

📁 symbian 2rd下手机振动的控制和应用
💻 CPP
字号:
/*
============================================================================
 Name        : CVibraContainer2 from VibraContainer2.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Container control implementation
============================================================================
*/

// INCLUDE FILES
#include "VibraContainer2.h"

#include <eiklabel.h>  // for example label control


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

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

	iLabel = new (ELeave) CEikLabel;
	iLabel->SetContainerWindowL( *this );
	iLabel->SetTextL( _L("Example View 2") );

	iToDoLabel = new (ELeave) CEikLabel;
	iToDoLabel->SetContainerWindowL( *this );
	iToDoLabel->SetTextL( _L("Add Your controls\n here") );

	SetRect(aRect);
	ActivateL();
	}

// Destructor
CVibraContainer2::~CVibraContainer2()
	{
	delete iLabel;
	delete iToDoLabel;
	}

// ---------------------------------------------------------
// CVibraContainer2::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CVibraContainer2::SizeChanged()
	{
	// TODO: Add here control resize code etc.
	iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
	iToDoLabel->SetExtent( TPoint(10,100), iToDoLabel->MinimumSize() );
	}

// ---------------------------------------------------------
// CVibraContainer2::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CVibraContainer2::CountComponentControls() const
	{
	return 2; // return nbr of controls inside this container
	}

// ---------------------------------------------------------
// CVibraContainer2::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CVibraContainer2::ComponentControl(TInt aIndex) const
	{
	switch ( aIndex )
		{
		case 0:
			return iLabel;
		case 1:
			return iToDoLabel;
		default:
			return NULL;
		}
	}

// ---------------------------------------------------------
// CVibraContainer2::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CVibraContainer2::Draw(const TRect& aRect) const
	{
	CWindowGc& gc = SystemGc();
	// TODO: Add your drawing code here
	// example code...
	gc.SetPenStyle( CGraphicsContext::ENullPen );
	gc.SetBrushColor( KRgbGray );
	gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
	gc.DrawRect( aRect );
	}

// ---------------------------------------------------------
// CVibraContainer2::HandleControlEventL(
//	 CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CVibraContainer2::HandleControlEventL(
	CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
	{
	// TODO: Add your control event handler code here
	}

⌨️ 快捷键说明

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