本文整理汇总了C++中LLCtrlListInterface::getSelectedValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLCtrlListInterface::getSelectedValue方法的具体用法?C++ LLCtrlListInterface::getSelectedValue怎么用?C++ LLCtrlListInterface::getSelectedValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLCtrlListInterface
的用法示例。
在下文中一共展示了LLCtrlListInterface::getSelectedValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCommitGesture
void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
{
LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
if (gestures)
{
S32 index = gestures->getFirstSelectedIndex();
if (index == 0)
{
return;
}
const std::string& trigger = gestures->getSelectedValue().asString();
// pretend the user chatted the trigger string, to invoke
// substitution and logging.
std::string text(trigger);
std::string revised_text;
LLGestureMgr::instance().triggerAndReviseString(text, &revised_text);
revised_text = utf8str_trim(revised_text);
if (!revised_text.empty())
{
// Don't play nodding animation
sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
}
}
mGestureLabelTimer.start();
if (mGestureCombo != NULL)
{
// free focus back to chat bar
mGestureCombo->setFocus(FALSE);
}
}
示例2: onCommitGesture
void LLGestureComboList::onCommitGesture()
{
LLCtrlListInterface* gestures = getListInterface();
if (gestures)
{
S32 sel_index = gestures->getFirstSelectedIndex();
if (sel_index == 0)
{
return;
}
S32 index = gestures->getSelectedValue().asInteger();
if (mViewAllItemIndex == index)
{
// The same behavior as Ctrl+G. EXT-823
LLFloaterReg::toggleInstance("gestures");
gestures->selectFirstItem();
return;
}
if (mGetMoreItemIndex == index)
{
LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL"));
return;
}
if (index<0 || index >= (S32)mGestures.size())
{
llwarns << "out of range gesture index" << llendl;
}
else
{
LLMultiGesture* gesture = mGestures.at(index);
if(gesture)
{
LLGestureMgr::instance().playGesture(gesture);
if(!gesture->mReplaceText.empty())
{
LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE);
}
}
}
}
}
示例3: onCommitSearchResult
void LLFloaterWorldMap::onCommitSearchResult()
{
LLCtrlListInterface *list = childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = it->second;
if (info->isName(sim_name))
{
LLVector3d pos_global = info->getGlobalOrigin();
const F64 SIM_COORD_DEFAULT = 128.0;
LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f);
// Did this value come from a trackURL() request?
if (!mCompletingRegionPos.isExactlyZero())
{
pos_local = mCompletingRegionPos;
mCompletingRegionPos.clear();
}
pos_global.mdV[VX] += (F64)pos_local.mV[VX];
pos_global.mdV[VY] += (F64)pos_local.mV[VY];
pos_global.mdV[VZ] = (F64)pos_local.mV[VZ];
childSetValue("location", sim_name);
trackLocation(pos_global);
setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn();
}
示例4: onCommitSearchResult
// static
void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
{
LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
LLCtrlListInterface *list = self->childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
{
LLSimInfo* info = (*it).second;
std::string info_sim_name = info->mName;
LLStringUtil::toLower(info_sim_name);
if (sim_name == info_sim_name)
{
LLVector3d pos_global = from_region_handle( info->mHandle );
F64 local_x = self->childGetValue("spin x");
F64 local_y = self->childGetValue("spin y");
F64 local_z = self->childGetValue("spin z");
pos_global.mdV[VX] += local_x;
pos_global.mdV[VY] += local_y;
pos_global.mdV[VZ] = local_z;
self->childSetValue("location", sim_name);
self->trackLocation(pos_global);
self->setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn(self);
}
示例5: refreshGestures
void LLGestureComboList::refreshGestures()
{
//store current selection so we can maintain it
LLSD cur_gesture = getValue();
mList->selectFirstItem();
mList->clearRows();
mGestures.clear();
LLGestureMgr::item_map_t::const_iterator it;
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
LLSD::Integer idx(0);
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
{
LLMultiGesture* gesture = (*it).second;
if (gesture)
{
mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx));
mGestures.push_back(gesture);
idx++;
}
}
sortByName();
// store indices for Get More and View All items (idx is the index followed by the last added Gesture)
if (mShowGetMore)
{
mGetMoreItemIndex = idx;
mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex));
}
if (mShowViewAll)
{
mViewAllItemIndex = idx + 1;
mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex));
}
// Insert label after sorting, at top, with separator below it
mList->addSeparator(ADD_TOP);
mList->addSimpleElement(mLabel, ADD_TOP);
if (cur_gesture.isDefined())
{
mList->selectByValue(cur_gesture);
}
else
{
mList->selectFirstItem();
}
LLCtrlListInterface* gestures = getListInterface();
LLMultiGesture* gesture = NULL;
if (gestures)
{
S32 sel_index = gestures->getFirstSelectedIndex();
if (sel_index != 0)
{
S32 index = gestures->getSelectedValue().asInteger();
if (index<0 || index >= (S32)mGestures.size())
{
llwarns << "out of range gesture access" << llendl;
}
else
{
gesture = mGestures.at(index);
}
}
}
if(gesture && LLGestureMgr::instance().isGesturePlaying(gesture))
{
return;
}
mButton->setLabel(mLabel);
}