本文整理汇总了C++中LLFloaterAvatarPicker::childDisable方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterAvatarPicker::childDisable方法的具体用法?C++ LLFloaterAvatarPicker::childDisable怎么用?C++ LLFloaterAvatarPicker::childDisable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterAvatarPicker
的用法示例。
在下文中一共展示了LLFloaterAvatarPicker::childDisable方法的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);
}
}
示例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);
}
}