本文整理汇总了C++中LLScrollListItem::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ LLScrollListItem::setEnabled方法的具体用法?C++ LLScrollListItem::setEnabled怎么用?C++ LLScrollListItem::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLScrollListItem
的用法示例。
在下文中一共展示了LLScrollListItem::setEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
// add item "name" to menu
LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOOL enabled)
{
LLScrollListItem* item = mList->addSimpleElement(name, pos);
item->setEnabled(enabled);
if (!mAllowTextEntry && mLabel.empty())
{
selectFirstItem();
}
return item;
}
示例2: updateFriendItem
// propagate actual relationship to UI.
// Does not resort the UI list because it can be called frequently. JC
BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info)
{
if (!info) return FALSE;
LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
if (!itemp) return FALSE;
bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
bool isOnline = info->isOnline();
std::string fullname;
BOOL have_name = gCacheName->getFullName(agent_id, fullname);
// Name of the status icon to use
std::string statusIcon;
if(isOnline)
{
statusIcon = "icon_avatar_online.tga";
}
else if(isOnlineSIP)
{
statusIcon = ONLINE_SIP_ICON_NAME;
}
itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
// render name of online friends in bold text
((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);
itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));
itemp->getColumn(LIST_VISIBLE_ONLINE_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS));
//unreliable? broken?
itemp->getColumn(LIST_VISIBLE_MAP_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION));
itemp->getColumn(LIST_EDIT_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS));
S32 change_generation = have_name ? info->getChangeSerialNum() : -1;
itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation);
// enable this item, in case it was disabled after user input
itemp->setEnabled(TRUE);
// Do not resort, this function can be called frequently.
return have_name;
}
示例3: updateFriendItem
// propagate actual relationship to UI.
// Does not resort the UI list because it can be called frequently. JC
BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info)
{
if (!info) return FALSE;
LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
if (!itemp) return FALSE;
bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
bool isOnline = info->isOnline();
std::string fullname;
// [Ansariel: Display name support]
//BOOL have_name = gCacheName->getFullName(agent_id, fullname);
LLAvatarName avatar_name;
BOOL have_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
switch (phoenix_name_system)
{
case 0 : fullname = avatar_name.getLegacyName(); break;
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
case 2 : fullname = avatar_name.mDisplayName; break;
default : fullname = avatar_name.getCompleteName(); break;
}
have_name = TRUE;
}
else have_name = FALSE;
// [/Ansariel: Display name support]
// Name of the status icon to use
std::string statusIcon;
if(isOnline)
{
mNumOnline++;
statusIcon = "icon_avatar_online.tga";
}
else if(isOnlineSIP)
{
mNumOnline++;
statusIcon = ONLINE_SIP_ICON_NAME;
}
else
{
mNumOnline--;
}
itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
// render name of online friends in bold text
((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);
itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));
//Notes in the original code imply this may not always work. Good to know. -HgB
itemp->getColumn(LIST_VISIBLE_ONLINE_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS));
itemp->getColumn(LIST_VISIBLE_MAP_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION));
itemp->getColumn(LIST_EDIT_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS));
S32 change_generation = have_name ? info->getChangeSerialNum() : -1;
itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation);
// enable this item, in case it was disabled after user input
itemp->setEnabled(TRUE);
// Do not resort, this function can be called frequently.
return have_name;
}