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

📄 settingslistcontainer.cpp

📁 in symbian design setting design
💻 CPP
字号:
/**
* 
* @brief Definition of CSettingsListContainer
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "SettingsListContainer.h"

// System includes
#include <SettingsList.rsg> // R_SETTINGSLIST_SETTING_ITEM_LIST

// User includes
#include "settingslistsettingitemlist.h"


// ================= 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 CSettingsListContainer::ConstructL(const TRect& aRect)
	{
	CreateWindowL();
	iSettingItemList = new CSettingsListSettingItemList (iSettings);
	iSettingItemList->SetMopParent(this);
    iSettingItemList->ConstructFromResourceL(R_SETTINGSLIST_SETTING_ITEM_LIST);
	SetRect(aRect);
	ActivateL();
	}
/**
* Symbian OS 2 phase constructor.
* Constructs the CSettingsListContainer 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 CSettingsListContainer
*/
CSettingsListContainer* CSettingsListContainer::NewL(const TRect& aRect)
	{
	CSettingsListContainer* self = CSettingsListContainer::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

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

/** 
* Destructor.  Frees up memory for the settings list.
*/
CSettingsListContainer::~CSettingsListContainer()
	{
	delete iSettingItemList;
	}

/**
* Called by the framework in compound controls	
* @return The number of controls in this CSettingsListContainer
*/
TInt CSettingsListContainer::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* CSettingsListContainer::ComponentControl(TInt aIndex) const
	{
	switch (aIndex)
		{
		case 0:
			return iSettingItemList;
		default:
			return NULL;
		}
	}


/**
* Called by the framework whenever a key event occurs.	
* Passes the key event to the saved games list if it is not null, otherwise returns
* EKeyWasNotConsumed
* @param aKeyEvent the Key event which occured, e.g. select key pressed
* @param aType the type of Key event which occurred, e.g. key up, key down
* @return TKeyResponse EKeyWasNotConsumed if the key was not processed, EKeyWasConsumed if it was
*/
TKeyResponse CSettingsListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
	{
	if (iSettingItemList)
		return iSettingItemList->OfferKeyEventL (aKeyEvent, aType);
	else
		return EKeyWasNotConsumed;
	}

/**
* Asks the setting list to change the currently selected item
*/
void CSettingsListContainer::ChangeSelectedItemL()
	{
	if (iSettingItemList)
		iSettingItemList->ChangeSelectedItemL();
	}


// End of File	

⌨️ 快捷键说明

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