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

📄 tcpipimpexcontainer.cpp

📁 一个tcp/ip的程序,实现上传和下载等功能
💻 CPP
字号:
/**
*
* @brief Definition of CTcpipImpExContainer
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "TcpipImpExContainer.h"

// System includes
#include <eiklabel.h> // CEikLabel
#include <TcpipImpEx.rsg> // R_LABEL_TEXT
#include <stringloader.h> // StringLoader

// CONSTANTS


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

/**
* Symbian OS 2nd phase constructor.  Creates a Window for the controls, which it contains.
* Constructs a label and adds it to the window, which it then activates.
* @param aRect The rectangle for this window
*/
void CTcpipImpExContainer::ConstructL(const TRect& aRect)
	{
	const TPoint KLabelPosition  = TPoint(10,10);
	const TSize  KLabelSize      = TSize(150,20);


	CreateWindowL();

	iLabel = new (ELeave) CEikLabel;
	iLabel->SetContainerWindowL(*this);

	HBufC* labelText;
	labelText = StringLoader::LoadLC(R_NOT_CONNECTED_TEXT);	// Pushes labelText onto the Cleanup Stack.
	iLabel->SetTextL(*labelText);
    iLabel->SetExtent(KLabelPosition, KLabelSize);


	CleanupStack::PopAndDestroy(labelText);

	SetRect(aRect);
	ActivateL();
	}

/**
* Symbian OS 2 phase constructor.
* Constructs the CTcpipImpExContainer using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
*
* @param aRect The rectangle for this window
* @return The newly constructed CTcpipImpExContainer
*/
CTcpipImpExContainer* CTcpipImpExContainer::NewL(const TRect& aRect)
	{
	CTcpipImpExContainer* self = CTcpipImpExContainer::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

/**
* Symbian OS 2 phase constructor.
* Constructs the CTcpipImpExContainer using the constructor and ConstructL
* method, leaving the constructed object on the CleanupStack before returning it.
*
* @param aRect The rectangle for this window
* @return The newly constructed CTcpipImpExContainer
*/
CTcpipImpExContainer* CTcpipImpExContainer::NewLC(const TRect& aRect)
	{
	CTcpipImpExContainer* self = new (ELeave) CTcpipImpExContainer;
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

/**
* Destructor.  Frees up memory for the iLabel.
*/
CTcpipImpExContainer::~CTcpipImpExContainer()
	{
	delete iLabel;
	}



/**
* Called by the framework in compound controls
* @return The number of controls in this CTcpipImpExContainer
*/
TInt CTcpipImpExContainer::CountComponentControls() const
	{
	return 1; // return number of controls inside this container
	}

/**
* Called by the framework in compound controls
* @param The index of the control to return
* @return The control for aIndex
*/
CCoeControl* CTcpipImpExContainer::ComponentControl(TInt aIndex) const
	{
	switch (aIndex)
		{
		case 0:
			return iLabel;
		default:
			return NULL;
		}
	}

/**
* Called by the framework to draw this control.  Clears the area in
* aRect.
* @param aRect in which to draw
*/
void CTcpipImpExContainer::Draw(const TRect& aRect) const
	{
	CWindowGc& gc = SystemGc();
	gc.Clear(aRect);
	}

void CTcpipImpExContainer::UpdateLabelL(const TDesC& aLabelText)
	{
	iLabel->SetTextL(aLabelText);
    iLabel->DrawDeferred();

	}

// End of File

⌨️ 快捷键说明

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