当前位置: 首页>>代码示例>>C++>>正文


C++ CInterfaceElement::setActive方法代码示例

本文整理汇总了C++中CInterfaceElement::setActive方法的典型用法代码示例。如果您正苦于以下问题:C++ CInterfaceElement::setActive方法的具体用法?C++ CInterfaceElement::setActive怎么用?C++ CInterfaceElement::setActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CInterfaceElement的用法示例。


在下文中一共展示了CInterfaceElement::setActive方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateThema

// ***************************************************************************
void CEncyclopediaManager::updateThema(uint32 nAlbumName, const CEncyMsgThema &t)
{
	CEncyMsgAlbum *pA = getAlbum(nAlbumName);
	nlassert(pA != NULL);
	CEncyMsgThema *pT = pA->getThema(t.Name);
	// Thema not found add it !
	if (pT == NULL)
	{
		uint32 nBack = (uint32)pA->Themas.size();
		pA->Themas.push_back(CEncyMsgThema());
		pT = &pA->Themas[nBack];

		// If we are not initializing so we must open the encyclopedia on the new thema
		if ( ! _Initializing )
		{
			_AlbumNameSelected = nAlbumName;
			_ThemaNameSelected = t.Name;
			CInterfaceManager *pIM = CInterfaceManager::getInstance();
			CInterfaceElement *pContainer = dynamic_cast<CInterfaceElement*>(pIM->getElementFromId(CONT_ENCY));
			if (pContainer != NULL)
				pContainer->setActive(true);
		}
	}
	nlassert(pT != NULL);
	*pT = t;
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:27,代码来源:encyclopedia_manager.cpp

示例2: rebuildAlbumPage

// ***************************************************************************
void CEncyclopediaManager::rebuildAlbumPage(uint32 albumName)
{
	uint32 i;
	CEncyMsgAlbum *pAlbum = NULL;
	// Select the right album
	for (i = 0; i < _Albums.size(); ++i)
	{
		if (_Albums[i].Name == albumName)
		{
			_AlbumNameSelected = _Albums[i].Name;
			pAlbum = &_Albums[i];
			break;
		}
	}

	if (pAlbum == NULL)
		return;

	// Update the right page
	CInterfaceManager *pIM = CInterfaceManager::getInstance();

	// Hide and show good group
	CInterfaceElement *pIE = pIM->getElementFromId(PAGE_ENCY_ALBUM);
	nlassert(pIE != NULL);
	pIE->setActive(true);
	pIE = pIM->getElementFromId(PAGE_ENCY_HELP);
	pIE->setActive(false);
	pIE = pIM->getElementFromId(PAGE_ENCY_THEMA);
	pIE->setActive(false);

	// Setup title
	CViewTextID *pVT = dynamic_cast<CViewTextID*>(pIM->getElementFromId(PAGE_ENCY_ALBUM ":title"));
	nlassert(pVT != NULL);
	pVT->setTextId(pAlbum->Name);

	// Setup brick reward
	pIM->getDbProp("UI:VARIABLES:ENCY:ALBUMBRICK:SHEET")->setValue32(pAlbum->RewardBrick);
	CViewText *pRBVT = dynamic_cast<CViewText*>(pIM->getElementFromId(PAGE_ENCY_ALBUM ":reward:desc"));
	if (pRBVT != NULL)
	{
		STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
		const ucstring desc(pSMC->getSBrickLocalizedDescription(CSheetId(pAlbum->RewardBrick)));
		pRBVT->setText(desc);
	}
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:46,代码来源:encyclopedia_manager.cpp

示例3: updateUIItemPage

// ****************************************************************************
void CHugeListObs::updateUIItemPage(uint index)
{
	nlassert((uint) _Category < ListTypeCount); // must call setListType
	CInterfaceManager *im = CInterfaceManager::getInstance();
	//
	std::string					 dbPath; // db path for the current item list
	TItemVect					 *items = &_ItemsPages;
	CDBCtrlSheet::TSheetCategory *itemCategory = &_ItemCategory;
	CDBGroupListSheetText		 *listSheet;
	CCDBNodeLeaf				 *itemListCategoryLeaf = NULL;
	switch (_Category)
	{
		case Trading:
		{
			if (BotChatPageAll->Trade->getBuyOnly())
			{
				dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MONEY ":";
				listSheet = dynamic_cast<CDBGroupListSheetText *>(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY_BUY_ONLY));
			}
			else
			{
				dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MONEY ":";
				listSheet = dynamic_cast<CDBGroupListSheetText *>(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY));
			}
			if (!listSheet) return;
			itemListCategoryLeaf = im->getDbProp("UI:TEMP:TYPE_OF_ITEMS_TO_BUY", false);
		}
		break;
		case ItemForMissions:
		{
			dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MISSION ":";
			listSheet = dynamic_cast<CDBGroupListSheetText *>(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MISSION));
			if (!listSheet) return;
			itemListCategoryLeaf = im->getDbProp("UI:TEMP:TYPE_OF_ITEMS_FOR_MISSION", false);
			if (!itemListCategoryLeaf) return;
			// display the group for mission items
			CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_ITEMS_FOR_MISSION);
			if (elm) elm->setActive(true);
		}
		break;
		case Ascensor:
		{
			dbPath = DB_LOCAL_BRANCH_FOR_ASCENSOR ":";
			listSheet = dynamic_cast<CDBGroupListSheetText *>(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_ASCENSOR));
			if (!listSheet) return;
			// display the group for mission items
			CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_ITEMS_FOR_ASCENSOR);
			if (elm) elm->setActive(true);
		}
		break;
		case Missions:
		{
			dbPath = DB_LOCAL_BRANCH_FOR_MISSIONS ":";
			listSheet = dynamic_cast<CDBGroupListSheetText *>(im->getElementFromId(UI_LIST_OF_MISSIONS));
			if (!listSheet) return;
			// display the group for mission items
			CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_MISSIONS);
			if (elm) elm->setActive(true);
		}
		break;
		default:
			nlassert(0); // Provide code for initializing
		break;
	}
	// Copy item into the big local db
	for(uint k = 0; k < TRADE_PAGE_NUM_ITEMS; ++k)
	{
		CCDBNodeLeaf *leaf;
		const CItem &currItem = (*items)[index].Items[k];
		// get branch for the item
		switch(_Category)
		{
			case Trading:
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":QUALITY", false);
				if (leaf) leaf->setValue32(currItem.Quality);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":SLOT_TYPE", false);
				if (leaf) leaf->setValue32(currItem.SlotType);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":SHEET", false);
				if (leaf) leaf->setValue32(currItem.SheetIDOrSkill);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":PRICE", false);
				if (leaf) leaf->setValue32(currItem.Price);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":WEIGHT", false);
				if (leaf) leaf->setValue32(currItem.Weight);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":NAMEID", false);
				if (leaf) leaf->setValue32(currItem.NameId);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":USER_COLOR", false);
				if (leaf) leaf->setValue32(currItem.UserColor);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":ENCHANT", false);
				if (leaf) leaf->setValue32(currItem.Enchant);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":RM_CLASS_TYPE", false);
				if (leaf) leaf->setValue32(currItem.RMClassType);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":RM_FABER_STAT_TYPE", false);
				if (leaf) leaf->setValue32(currItem.RMFaberStatType);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":PREREQUISIT_VALID", false);
				if (leaf) leaf->setValue32(currItem.PrerequisitValid);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":INFO_VERSION", false);
				if (leaf) leaf->setValue32(currItem.InfoVersion);
				leaf = im->getDbProp(dbPath + toString(k + index * TRADE_PAGE_NUM_ITEMS) + ":QUANTITY", false);
				if (leaf) leaf->setValue32(currItem.Quantity);
//.........这里部分代码省略.........
开发者ID:AzyxWare,项目名称:ryzom,代码行数:101,代码来源:obs_huge_list.cpp

示例4: rebuildThemaPage

// ***************************************************************************
void CEncyclopediaManager::rebuildThemaPage(uint32 themaName)
{
	uint32 i;
	CEncyMsgThema *pThema = NULL;
	// Select the right album
	for (i = 0; i < _Albums.size(); ++i)
	{
		pThema = _Albums[i].getThema(themaName);
		if (pThema != NULL)
		{
			_AlbumNameSelected = _Albums[i].Name;
			break;
		}
	}

	if (pThema == NULL)
		return;

	// Update the right page
	CInterfaceManager *pIM = CInterfaceManager::getInstance();

	// Hide and show good group
	CInterfaceElement *pIE = pIM->getElementFromId(PAGE_ENCY_ALBUM);
	nlassert(pIE != NULL);
	pIE->setActive(false);
	pIE = pIM->getElementFromId(PAGE_ENCY_HELP);
	pIE->setActive(false);
	pIE = pIM->getElementFromId(PAGE_ENCY_THEMA);
	pIE->setActive(true);

	// Setup title
	CViewTextID *pVT = dynamic_cast<CViewTextID*>(pIM->getElementFromId(PAGE_ENCY_THEMA ":title"));
	nlassert(pVT != NULL);
	pVT->setTextId(pThema->Name);

	// Setup rewards
	pVT = dynamic_cast<CViewTextID*>(pIM->getElementFromId(PAGE_ENCY_THEMA ":reward_text:desc"));
	nlassert(pVT != NULL);
	pVT->setTextId(pThema->RewardText);

	// Setup brick reward
	pIM->getDbProp("UI:VARIABLES:ENCY:REWARDBRICK:SHEET")->setValue32(pThema->RewardSheet);
	CViewText *pRBVT = dynamic_cast<CViewText*>(pIM->getElementFromId(PAGE_ENCY_THEMA ":reward:desc"));
	nlassert(pRBVT != NULL);
	STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
	CEntitySheet *pES = SheetMngr.get(CSheetId(pThema->RewardSheet));
	if (pES != NULL)
	{
		if (pES->type() == CEntitySheet::ITEM)
		{
			const ucstring desc(pSMC->getItemLocalizedDescription(CSheetId(pThema->RewardSheet)));
			pRBVT->setText(desc);
		}
		else if (pES->type() == CEntitySheet::SBRICK)
		{
			const ucstring desc(pSMC->getSBrickLocalizedDescription(CSheetId(pThema->RewardSheet)));
			pRBVT->setText(desc);
		}
		else if (pES->type() == CEntitySheet::SPHRASE)
		{
			const ucstring desc(pSMC->getSPhraseLocalizedDescription(CSheetId(pThema->RewardSheet)));
			pRBVT->setText(desc);
		}
	}

	// Setup the total number of steps
	uint32 nNbSteps = pThema->NbTask - 1; // 0th is the rite
	pIM->getDbProp("UI:VARIABLES:ENCY:STEPS")->setValue32(nNbSteps);

	// Count number of tasks done
	uint32 nNbTaskDone = 0;
	for (i = 0; i < pThema->NbTask; ++i)
		if (pThema->getTaskState((uint8)i) == 2) // 2 == finished
			++nNbTaskDone;
	pIM->getDbProp("UI:VARIABLES:ENCY:DONE")->setValue32(nNbTaskDone);

	// setup rite & tasks
	for (i = 0; i < pThema->NbTask; ++i)
	{
		string sTmp;
		if (i == 0)
			sTmp = PAGE_ENCY_THEMA ":todo2:rite";
		else
			sTmp = PAGE_ENCY_THEMA ":todo:task" + toString(i);

		// setup task description
		CViewTextID *pText = dynamic_cast<CViewTextID*>(pIM->getElementFromId(sTmp+":desc"));
		nlassert(pText != NULL);
		pText->setTextId(pThema->TaskName[i]);

		// setup task NPC name
		CStringPostProcessNPCRemoveTitle *pSPPRT = new CStringPostProcessNPCRemoveTitle;
		pIM->addServerID (sTmp+":npc:uc_hardtext", pThema->TaskNPCName[i], pSPPRT);

		// If the task is not known gray it
		if (pThema->getTaskState((uint8)i) == 0)
			pText->setAlpha(80);
		else
			pText->setAlpha(160);
//.........这里部分代码省略.........
开发者ID:AzyxWare,项目名称:ryzom,代码行数:101,代码来源:encyclopedia_manager.cpp

示例5: update

// ***************************************************************************
void CGuildManager::update()
{
	CInterfaceManager *pIM = CInterfaceManager::getInstance();
	STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();

	// *** Need to rebuild the guild data?
	if (_NeedRebuild)
	{
		_NeedUpdate = true;
		_NeedRebuild = false;

		// Rebuild transfert the database to the local structure

		// Guild stuff
		uint32 oldName = _Guild.NameID;
		_Guild.NameID = pIM->getDbProp("SERVER:GUILD:NAME")->getValue32();
		_Guild.Name = "";
		_InGuild = (_Guild.NameID != 0);
		if (!_InGuild)
			closeAllInterfaces();
		_Guild.Icon = pIM->getDbProp("SERVER:GUILD:ICON")->getValue64();
		_Guild.QuitGuildAvailable = true;

		// Guild Members
		if(_NeedRebuildMembers)
		{
			_NeedUpdateMembers = true;
			_NeedRebuildMembers = false;

			_GuildMembers.clear();
			for (uint32 i = 0; i < MAX_GUILD_MEMBER; ++i)
			{
				sint32 name = pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":NAME")->getValue32();
				if (name != 0)
				{
					SGuildMember gm;
					gm.NameID = name;
					gm.Index = i;
					gm.Grade = (EGSPD::CGuildGrade::TGuildGrade)(pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":GRADE")->getValue32());
					gm.Online = (TCharConnectionState)(pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":ONLINE")->getValue32());
					gm.EnterDate = pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":ENTER_DATE")->getValue32();
					_GuildMembers.push_back(gm);
				}
			}
		}

		// Does the player are newcomer ?
		// Boris 01/09/2006 : removed : now the guild interface is open if
		// is was active before OR if the EGS ask it to the client

		bool playerNewToTheGuild = _NewToTheGuild &&(oldName != _Guild.NameID) && _InGuild;
		if (playerNewToTheGuild)
		{
			// reset the flag
			_NewToTheGuild = false;
			// Don't pop the guild window in ring mode.
			// NB nico : this test should not be necessary, as the guild infos should be filled during the init of the db
			// However, there are situation where this db info is filled after init (should only happen at guild creation time ...)
			// Maybe an EGS  bug ?
			if (R2::getEditor().getMode() == R2::CEditor::NotInitialized)
			{
				CInterfaceElement *pElt;
				// Open the guild info if we are not in the init phase
				if (!IngameDbMngr.initInProgress())
				{
					pElt = pIM->getElementFromId(WIN_GUILD);
					if (pElt != NULL)
						pElt->setActive(true);
				}
				// Browse the forum
				pElt = pIM->getElementFromId(WIN_GUILD_FORUM":content:html");
				if (pElt != NULL)
				{
					CGroupHTML *html = dynamic_cast<CGroupHTML*>(pElt);
					if (html)
						html->browse("home");
				}
			}
		}
	}

	// *** Need to update Names?
	if (_NeedUpdate)
	{
		bool bAllValid = true;
		// Update wait until all the name of members, name of the guild and description are valid

		if (!pSMC->getString (_Guild.NameID, _Guild.Name)) bAllValid = false;

		for (uint i = 0; i < _GuildMembers.size(); ++i)
		{
			if (!pSMC->getString (_GuildMembers[i].NameID, _GuildMembers[i].Name)) bAllValid = false;
			else _GuildMembers[i].Name = CEntityCL::removeTitleAndShardFromName(_GuildMembers[i].Name);
		}

		// If all is valid no more need update and if guild is opened update the interface
		if (bAllValid)
		{
			// Search for UserEntity to find our own grade
//.........这里部分代码省略.........
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:guild_manager.cpp


注:本文中的CInterfaceElement::setActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。