本文整理汇总了C++中LLScrollListItem类的典型用法代码示例。如果您正苦于以下问题:C++ LLScrollListItem类的具体用法?C++ LLScrollListItem怎么用?C++ LLScrollListItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLScrollListItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSelectedAvatarData
static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names)
{
std::vector<LLScrollListItem*> items = from->getAllSelected();
for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
{
LLScrollListItem* item = *iter;
if (item->getUUID().notNull())
{
avatar_ids.push_back(item->getUUID());
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID());
if (iter != sAvatarNameMap.end())
{
avatar_names.push_back(iter->second);
}
else
{
// the only case where it isn't in the name map is friends
// but it should be in the name cache
LLAvatarName av_name;
LLAvatarNameCache::get(item->getUUID(), &av_name);
avatar_names.push_back(av_name);
}
}
}
}
示例2: onClickTrack
void LLFloaterAvatarList::onClickTrack(void *userdata)
{
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLScrollListItem *item = self->mAvatarList->getFirstSelected();
if (!item) return;
LLUUID agent_id = item->getUUID();
if (self->mTracking && self->mTrackedAvatar == agent_id) {
LLTracker::stopTracking(NULL);
self->mTracking = FALSE;
}
else
{
self->mTracking = TRUE;
self->mTrackedAvatar = agent_id;
// trackAvatar only works for friends allowing you to see them on map...
// LLTracker::trackAvatar(agent_id, self->mAvatars[agent_id].getName());
std::string name = self->mAvatars[agent_id].getName();
if (!self->mUpdate)
{
name += "\n(last known position)";
}
LLTracker::trackLocation(self->mAvatars[agent_id].getPosition(), name, name);
}
}
示例3: onClickRemoveURLFilter
// static
void LLPanelLandMedia::onClickRemoveURLFilter(void *data)
{
LLPanelLandMedia* panelp = (LLPanelLandMedia*)data;
if (panelp && panelp->mURLFilterList)
{
LLParcel* parcel = panelp->mParcel->getParcel();
if (parcel)
{
LLSD list = parcel->getMediaURLFilterList();
std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected();
for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++)
{
LLScrollListItem* item = *iter;
const std::string domain = item->getValue().asString();
for(S32 i = 0; i < list.size(); i++)
{
if (list[i].asString() == domain)
{
list.erase(i);
break;
}
}
}
parcel->setMediaURLFilterList(list);
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
panelp->refresh();
}
}
}
示例4: refresh
// public
void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
const std::string& last, BOOL is_group)
{
//llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " "
// << last << "'" << llendl;
std::string fullname;
if (!is_group)
{
fullname = first + " " + last;
}
else
{
fullname = first;
}
// TODO: scan items for that ID, fix if necessary
item_list::iterator iter;
for (iter = getItemList().begin(); iter != getItemList().end(); iter++)
{
LLScrollListItem* item = *iter;
if (item->getUUID() == id)
{
LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0);
cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex);
((LLScrollListText*)cell)->setText( fullname );
}
}
dirtyColumns();
}
示例5: RevokeSelected
void JCFloaterAnimList::RevokeSelected(void *userdata )
{
JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
LLDynamicArray<LLUUID> ids;
std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
{
LLScrollListItem *item = *itr;
const LLUUID &id = item->getColumn(LIST_OBJECT_UUID)->getValue().asUUID();
if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
{
ids.put(id);
}
}
if( !ids.empty() )
{
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID id = *itr;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RevokePermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, id);
msg->addU32Fast(_PREHASH_ObjectPermissions, U32_MAX);
gAgent.sendReliableMessage();
}
}
}
示例6: onStart
void LLFloaterNewIM::onStart(void* userdata)
{
LLFloaterNewIM* self = (LLFloaterNewIM*) userdata;
LLScrollListItem* item = self->mSelectionList->getFirstSelected();
if(item)
{
const LLScrollListCell* cell = item->getColumn(0);
std::string name(cell->getValue());
// *NOTE: Do a live detrmination of what type of session it
// should be. If we restrict the new im panel to online users,
// then we can remove some of this code.
EInstantMessage type;
EInstantMessage* t = (EInstantMessage*)item->getUserdata();
if(t) type = (*t);
else type = LLIMMgr::defaultIMTypeForAgent(item->getUUID());
gIMMgr->addSession(name, type, item->getUUID());
make_ui_sound("UISndStartIM");
}
else
{
make_ui_sound("UISndInvalidOp");
}
}
示例7: getXML
// virtual
LLXMLNodePtr LLComboBox::getXML(bool save_children) const
{
LLXMLNodePtr node = LLUICtrl::getXML();
node->setName(LL_COMBO_BOX_TAG);
// Attributes
node->createChild("allow_text_entry", TRUE)->setBoolValue(mAllowTextEntry);
node->createChild("max_chars", TRUE)->setIntValue(mMaxChars);
// Contents
std::vector<LLScrollListItem*> data_list = mList->getAllData();
std::vector<LLScrollListItem*>::iterator data_itor;
for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor)
{
LLScrollListItem* item = *data_itor;
LLScrollListCell* cell = item->getColumn(0);
if (cell)
{
LLXMLNodePtr item_node = node->createChild("combo_item", FALSE);
LLSD value = item->getValue();
item_node->createChild("value", TRUE)->setStringValue(value.asString());
item_node->createChild("enabled", TRUE)->setBoolValue(item->getEnabled());
item_node->setStringValue(cell->getValue().asString());
}
}
return node;
}
示例8: onDoubleClick
void FloaterAvatarList::onDoubleClick(void *userdata)
{
FloaterAvatarList *self = (FloaterAvatarList*)userdata;
LLScrollListItem *item = self->mAvatarList->getFirstSelected();
LLUUID agent_id = item->getUUID();
lookAtAvatar(agent_id);
}
示例9: initDefaultGesture
void LLPreviewGesture::initDefaultGesture()
{
LLScrollListItem* item;
item = addStep("Animation");
LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata();
anim->mAnimAssetID = ANIM_AGENT_HELLO;
anim->mAnimName = "Wave";
updateLabel(item);
item = addStep("Wait");
LLGestureStepWait* wait = (LLGestureStepWait*)item->getUserdata();
wait->mFlags = WAIT_FLAG_ALL_ANIM;
updateLabel(item);
item = addStep("Chat");
LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata();
chat_step->mChatText = "Hello, avatar!";
updateLabel(item);
// Start with item list selected
mStepList->selectFirstItem();
// this is *new* content, so we are dirty
mDirty = TRUE;
}
示例10: onList
void LLFloaterHUD::onList(LLUICtrl* ctrl, void* userdata)
{
LLFloaterHUD* self = (LLFloaterHUD*)userdata;
if (!self)
{
return;
}
self->mAvatarIDs.clear();
self->mAvatarNames.clear();
if (!self->mListNames)
{
return;
}
std::vector<LLScrollListItem*> items =
self->mListNames->getAllSelected();
for (
std::vector<LLScrollListItem*>::iterator iter = items.begin();
iter != items.end();
++iter)
{
LLScrollListItem* item = *iter;
self->mAvatarNames.push_back(item->getColumn(0)->getValue().asString());
self->mAvatarIDs.push_back(item->getUUID());
self->childSetEnabled("Select", TRUE);
}
}
示例11: LLSD
void LLPanelGroupInvite::impl::submitInvitations()
{
std::map<LLUUID, LLUUID> role_member_pairs;
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
// Default to everyone role.
LLUUID role_id = LLUUID::null;
if (mRoleNames)
{
role_id = mRoleNames->getCurrentID();
// owner role: display confirmation and wait for callback
if ((role_id == gdatap->mOwnerRole) && (!mConfirmedOwnerInvite))
{
LLSD args;
args["MESSAGE"] = mOwnerWarning;
LLNotificationsUtil::add("GenericAlertYesCancel", args, LLSD(), boost::bind(&LLPanelGroupInvite::impl::inviteOwnerCallback, this, _1, _2));
return; // we'll be called again if user confirms
}
}
bool already_in_group = false;
//loop over the users
std::vector<LLScrollListItem*> items = mInvitees->getAllData();
for (std::vector<LLScrollListItem*>::iterator iter = items.begin();
iter != items.end(); ++iter)
{
LLScrollListItem* item = *iter;
if(LLGroupActions::isAvatarMemberOfGroup(mGroupID, item->getUUID()))
{
already_in_group = true;
continue;
}
role_member_pairs[item->getUUID()] = role_id;
}
if (role_member_pairs.size() > MAX_GROUP_INVITES)
{
// Fail!
LLSD msg;
msg["MESSAGE"] = mTooManySelected;
LLNotificationsUtil::add("GenericAlert", msg);
(*mCloseCallback)(mCloseCallbackUserData);
return;
}
LLGroupMgr::getInstance()->sendGroupMemberInvites(mGroupID, role_member_pairs);
if(already_in_group)
{
LLSD msg;
msg["MESSAGE"] = mAlreadyInGroup;
LLNotificationsUtil::add("GenericAlert", msg);
}
//then close
(*mCloseCallback)(mCloseCallbackUserData);
}
示例12: onBtnLocate
void LLFloaterHUD::onBtnLocate(void* userdata) //some disabled code does not work yet.... for future ref :)
{
LLFloaterHUD* self = (LLFloaterHUD*)userdata;
LLScrollListItem *item = self->mListNames->getFirstSelected();
if ( NULL == item ) return;
LLUUID agent_id = item->getUUID();
handle_lure(agent_id); //Offering a TP does work client side , not working server side without presence!
/*
LLVOAvatar* avatarp = (LLVOAvatar*)item;
std::string tooltip("");
std::string name("");
LLVector3d position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
LLVector3d mypos = gAgent.getPositionGlobal();
LLVector3d delta = mypos - position;
LLTracker::trackAvatar(agent_id, name);
llinfos << "delta = " << delta << "info Kirsten" << llendl;
llinfos << "position = " << position << "info Kirsten" << llendl;
LLTracker::trackLocation(position, name, tooltip);
gAgent.teleportViaLocation( position); */
}
示例13: onNameCache
// callback from the name cache with an owner name to add to the list
void LLPanelScriptLimitsRegionMemory::onNameCache(
const LLUUID& id,
const std::string& first_name,
const std::string& last_name)
{
std::string name = first_name + " " + last_name;
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list");
if(!list)
{
return;
}
std::vector<LLSD>::iterator id_itor;
for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor)
{
LLSD element = *id_itor;
if(element["owner_id"].asUUID() == id)
{
LLScrollListItem* item = list->getItem(element["id"].asUUID());
if(item)
{
item->getColumn(3)->setValue(LLSD(name));
element["columns"][3]["value"] = name;
}
}
}
}
示例14: onActivate
// static
void HBFloaterGroupTitles::onActivate(void* userdata)
{
HBFloaterGroupTitles* self = (HBFloaterGroupTitles*) userdata;
LLScrollListItem *item = self->mTitlesList->getFirstSelected();
if (!item) return;
// Set the group if needed.
LLUUID old_group_id = gAgent.getGroupID();
LLUUID group_id = item->getColumn(LIST_GROUP_ID)->getValue().asUUID();
if (group_id != old_group_id)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ActivateGroup);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, group_id);
gAgent.sendReliableMessage();
}
// Set the title
LLGroupMgr::getInstance()->sendGroupTitleUpdate(group_id, item->getUUID());
// Force a refresh via the observer
if (group_id == LLUUID::null)
{
group_id = old_group_id;
}
LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id);
}
示例15: updateAddLandmarkTooltip
BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, MASK mask)
{
if(mAddLandmarkBtn->parentPointInView(x,y))
{
updateAddLandmarkTooltip();
}
// Let the buttons show their tooltips.
if (LLUICtrl::handleToolTip(x, y, mask))
{
if (mList->getRect().pointInRect(x, y))
{
S32 loc_x, loc_y;
//x,y - contain coordinates related to the location input control, but without taking the expanded list into account
//So we have to convert it again into local coordinates of mList
localPointToOtherView(x,y,&loc_x,&loc_y,mList);
LLScrollListItem* item = mList->hitItem(loc_x,loc_y);
if (item)
{
LLSD value = item->getValue();
if (value.has("tooltip"))
{
LLToolTipMgr::instance().show(value["tooltip"]);
}
}
}
return TRUE;
}
return FALSE;
}