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

📄 settingslistsettingitemlist.cpp

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

// INCLUDE FILES

// Class include
#include "SettingsListSettingItemList.h"

// User include
#include "SettingsListSettings.h"

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

/**
* Constructor.	Takes a copy of the reference to aDifficultyLevel
* @param aDifficultyLevel the level of difficulty which will be set
*/	
CSettingsListSettingItemList::CSettingsListSettingItemList (TSettingsListSettings& aSettings)
: iSettings (aSettings)
	{
	}

/**
*	
* Called by framework when the view size is changed.  Resizes the
* setting list accordingly.
*
*/
void CSettingsListSettingItemList::SizeChanged()
	{
	if (ListBox()) 
		{
		ListBox()->SetRect(Rect());
		}
	}


/**
*	
* Creates the actual setting items for the list, passing
* ownership of them to the calling class.  Each setting
* item has a piece of member data which it sets values in.
*/
CAknSettingItem* CSettingsListSettingItemList::CreateSettingItemL(TInt aIdentifier)
	{
	CAknSettingItem* settingItem = NULL;
	
	switch (aIdentifier)
		{
		case ESettingsListDifficultySettingItem:
			settingItem = new (ELeave) CAknSliderSettingItem(aIdentifier, iSettings.DifficultyLevel());
			break;
		case ESettingsListPlayerNameSettingItem:
			settingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iSettings.PlayerName());
			break;
		case ESettingsListHintsSettingItem:
			settingItem = new (ELeave) CAknBinaryPopupSettingItem (aIdentifier, iSettings.HintsEnabled());
			break;

		}
	return settingItem; // passing ownership
	}

/**
* Causes the edit page for the currently selected setting
* item to be displayed
*/
void CSettingsListSettingItemList::ChangeSelectedItemL()
	{
	EditItemL(ListBox()->CurrentItemIndex(), ETrue);
	}

/**
* Called by the framework whenever an item is selected. 
* Causes the edit page for the currently selected setting item to be displayed and stores
* any changes made.
*/
void CSettingsListSettingItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu)
	{
	CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
	(*SettingItemArray())[aIndex]->StoreL();

	}

⌨️ 快捷键说明

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