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


C++ LLFloaterAvatarPicker::childEnable方法代码示例

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


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

示例1: processAvatarPickerReply

// static 
void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void**)
{
	LLUUID	agent_id;
	LLUUID	query_id;
	LLUUID	avatar_id;
	std::string first_name;
	std::string last_name;

	msg->getUUID("AgentData", "AgentID", agent_id);
	msg->getUUID("AgentData", "QueryID", query_id);

	// Not for us
	if (agent_id != gAgent.getID()) return;

	// Dialog already closed
	LLFloaterAvatarPicker *self = sInstance;
	if (!self) return;

	// these are not results from our last request
	if (query_id != self->mQueryID)
	{
		return;
	}

	LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("SearchResults");

	// clear "Searching" label on first results
	search_results->deleteAllItems();

	self->mResultsReturned = TRUE;

	BOOL found_one = FALSE;
	S32 num_new_rows = msg->getNumberOfBlocks("Data");
	for (S32 i = 0; i < num_new_rows; i++)
	{			
		msg->getUUIDFast(  _PREHASH_Data,_PREHASH_AvatarID,	avatar_id, i);
		msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, first_name, i);
		msg->getStringFast(_PREHASH_Data,_PREHASH_LastName,	last_name, i);
	
		std::string avatar_name;
		if (avatar_id.isNull())
		{
			LLStringUtil::format_map_t map;
			map["[TEXT]"] = self->childGetText("Edit");
			avatar_name = self->getString("not_found", map);
			search_results->setEnabled(FALSE);
			self->childDisable("Select");
		}
		else
		{
			avatar_name = first_name + " " + last_name;
			search_results->setEnabled(TRUE);
			found_one = TRUE;
		}
		LLSD element;
		element["id"] = avatar_id; // value
		element["columns"][0]["value"] = avatar_name;
		element["columns"][0]["color"] = gColors.getColor("DefaultListText").getValue();
		search_results->addElement(element);
	}

	if (found_one)
	{
		self->childEnable("Select");
		search_results->selectFirstItem();
		self->onList(search_results, self);
		search_results->setFocus(TRUE);
	}
}
开发者ID:Xara,项目名称:Luna-Viewer,代码行数:70,代码来源:llfloateravatarpicker.cpp

示例2: processAvatarPickerReply

// static 
void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void**)
{
	LLUUID	agent_id;
	LLUUID	query_id;
	LLUUID	avatar_id;
	std::string first_name;
	std::string last_name;

	msg->getUUID("AgentData", "AgentID", agent_id);
	msg->getUUID("AgentData", "QueryID", query_id);

	// Not for us
	if (agent_id != gAgent.getID()) return;
	
	LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker");

	// floater is closed or these are not results from our last request
	if (NULL == floater || query_id != floater->mQueryID)
	{
		return;
	}

	LLScrollListCtrl* search_results = floater->getChild<LLScrollListCtrl>("SearchResults");

	// clear "Searching" label on first results
	if (floater->mNumResultsReturned++ == 0)
	{
		search_results->deleteAllItems();
	}

	BOOL found_one = FALSE;
	S32 num_new_rows = msg->getNumberOfBlocks("Data");
	for (S32 i = 0; i < num_new_rows; i++)
	{			
		msg->getUUIDFast(  _PREHASH_Data,_PREHASH_AvatarID,	avatar_id, i);
		msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, first_name, i);
		msg->getStringFast(_PREHASH_Data,_PREHASH_LastName,	last_name, i);
	
		std::string avatar_name;
		if (avatar_id.isNull())
		{
			LLStringUtil::format_map_t map;
			map["[TEXT]"] = floater->childGetText("Edit");
			avatar_name = floater->getString("not_found", map);
			search_results->setEnabled(FALSE);
			floater->childDisable("ok_btn");
		}
		else
		{
			avatar_name = first_name + " " + last_name;
			search_results->setEnabled(TRUE);
			found_one = TRUE;
		}
		LLSD element;
		element["id"] = avatar_id; // value
		element["columns"][0]["value"] = avatar_name;
		search_results->addElement(element);
	}

	if (found_one)
	{
		floater->childEnable("ok_btn");
		search_results->selectFirstItem();
		floater->onList();
		search_results->setFocus(TRUE);
	}
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:68,代码来源:llfloateravatarpicker.cpp


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