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

📄 bluetoothpmpexamplecontainer.cpp

📁 source codes for point to multi-point Bluetooth transaction in Symbian OS. A good beginning to learn
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CBluetoothPMPExampleContainer from BluetoothPMPExampleContainer.h
*  Part of  : BluetoothPMPExample
*  Created  : 14.01.2004 by Forum Nokia
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include <aknutils.h> 		// Fonts
#include <eiklabel.h>

#include "BluetoothPMPExampleContainer.h"


CBluetoothPMPExampleContainer* CBluetoothPMPExampleContainer::NewL(
	const TRect & aRect)
	{
	CBluetoothPMPExampleContainer* self = 
		NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

CBluetoothPMPExampleContainer* CBluetoothPMPExampleContainer::NewLC(
	const TRect & aRect)
	{
	CBluetoothPMPExampleContainer* self = 
		new (ELeave) CBluetoothPMPExampleContainer;
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}


// ----------------------------------------------------------------------------
// void CBluetoothPMPExampleContainer::ConstructL(const TRect& aRect,
//										CBluetoothPMPExampleEngine* bEngine)
//
// Standard EPOC 2nd phase constructor
// ----------------------------------------------------------------------------
void CBluetoothPMPExampleContainer::ConstructL(const TRect& aRect)
    {
	// create new window,
    CreateWindowL();
	// create label to display status to user
    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL( *this );
    iLabel->SetFont( LatinBold12() );      
    // set window size
    SetRect(aRect);

	_LIT(KInfo, "Bluetooth PMP example\n");
    iLabel->SetTextL( KInfo );

    // activate window
    ActivateL();
    }


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::CBluetoothPMPExampleContainer
//
// constructor
// ----------------------------------------------------------------------------
CBluetoothPMPExampleContainer::CBluetoothPMPExampleContainer():
    iLabel(NULL)
	{
	}


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::~CBluetoothPMPExampleContainer
//
// destructor
// ----------------------------------------------------------------------------
CBluetoothPMPExampleContainer::~CBluetoothPMPExampleContainer()
    {
    delete iLabel;
    iLabel=NULL;
    }


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::SizeChanged()
//
// called by framework when the view size is changed
// ----------------------------------------------------------------------------
void CBluetoothPMPExampleContainer::SizeChanged()
    {
    iLabel->SetRect( Rect() );
    }


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::CountComponentControls() const
// ----------------------------------------------------------------------------
TInt CBluetoothPMPExampleContainer::CountComponentControls() const
    {
    return 1; 
    }


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


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::Draw(const TRect& aRect) const
// ----------------------------------------------------------------------------
void CBluetoothPMPExampleContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbWhite);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
    }


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


// ----------------------------------------------------------------------------
// CBluetoothPMPExampleContainer::ShowMessageL(const TDesC& aMsg)
//
// displays status messages to user
// ----------------------------------------------------------------------------
void CBluetoothPMPExampleContainer::ShowMessageL(const TDesC& aMsg)
	{
	iLabel->SetTextL(aMsg);
	DrawNow();
	}


// End of File  

⌨️ 快捷键说明

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