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

📄 shapedrawerlistview.cpp

📁 最新官方例子,图形,描述副,基本控件,通讯协议,等等,
💻 CPP
字号:
/**
* 
* @brief Definition of CShapeDrawerListView
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDES

//  Class include
#include "ShapeDrawerListView.h"

// System includes
#include <aknviewappui.h>	// CAknViewAppUi
#include <shapedrawer.rsg>	

// User includes
#include "ShapeDrawerListViewContainer.h"	
#include "ShapeDrawer.hrh"	

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

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

/**
* Symbian OS 2 phase constructor.
* Constructs the CShapeDrawerListView 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 CShapeDrawerListView
*/
CShapeDrawerListView* CShapeDrawerListView::NewL()
	{
	CShapeDrawerListView* self = CShapeDrawerListView::NewLC();
	CleanupStack::Pop(self);
	return self;
	}

/**
* Symbian OS 2 phase constructor.
* Constructs the CShapeDrawerListView 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 CShapeDrawerListView
*/
CShapeDrawerListView* CShapeDrawerListView::NewLC()
	{
	CShapeDrawerListView* self = new (ELeave) CShapeDrawerListView();
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}

CShapeDrawerListView::CShapeDrawerListView() 
	{
	}

/**
* Symbian OS 2nd phase constructor.  
* Uses the superclass constructor to construct the view using the 
* R_EMCCVIEWSWITCHED_VIEW1 resource.
*/ 
void CShapeDrawerListView::ConstructL()
	{
	BaseConstructL(R_SHAPEDRAWER_LISTVIEW);
	}

/**
* Called by the framework
* @return The Uid for this view
*/
TUid CShapeDrawerListView::Id() const
	{
	return TUid::Uid(EShapeDrawerListViewId);
	}

/**
* Called by the framework when the view is activated.  Constructs the 
* container if necessary, setting this view as its MOP parent, and 
* adding it to the control stack.
*/
void CShapeDrawerListView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
										 TUid /*aCustomMessageId*/,
										 const TDesC8& /*aCustomMessage*/)
	{
	if (!iContainer)
		{
		iContainer = CShapeDrawerListViewContainer::NewL(AppUi()->ClientRect(), *this);
		iContainer->SetMopParent(this);
		iContainer->ConstructL(AppUi()->ClientRect());
		AppUi()->AddToStackL(*this, iContainer);

		}	  
	}

/**
* Called by the framework when the view is deactivated.  
* Removes the container from the control stack and deletes it.
*/
void CShapeDrawerListView::DoDeactivate()
	{
	if (iContainer)
		{
		AppUi()->RemoveFromStack(iContainer);
		delete iContainer;
		iContainer = NULL;
		}
	}

/**
* From CEikAppUi, takes care of command handling for this view.
*
* @param aCommand command to be handled
*/
void CShapeDrawerListView::HandleCommandL(TInt aCommand)
	{
	
	switch (aCommand)
		{
		case EAknSoftkeyBack:
			{
			AppUi()->HandleCommandL(EEikCmdExit);
			break;
			}
		case EShapeDrawerRemoveSelectedItem:
			{
			iContainer->RemoveCurrentItemL();
			break;
			}
		default:
			{
			AppUi()->HandleCommandL(aCommand);
			break;
			}
		}
	}

CShapeDrawerAppUi& CShapeDrawerListView::GetAppUi()
	{
	CAknViewAppUi* aAknViewAppUi = AppUi();
	CShapeDrawerAppUi* aShapeDrawerAppUi = reinterpret_cast<CShapeDrawerAppUi*>(aAknViewAppUi);
	return (*aShapeDrawerAppUi);
	}

// End of File

⌨️ 快捷键说明

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