本文整理汇总了C++中LLInventoryPanel::setSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryPanel::setSelection方法的具体用法?C++ LLInventoryPanel::setSelection怎么用?C++ LLInventoryPanel::setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryPanel
的用法示例。
在下文中一共展示了LLInventoryPanel::setSelection方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setImageID
void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
{
if( mImageAssetID != image_id && mActive)
{
mNoCopyTextureSelected = FALSE;
mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
mImageAssetID = image_id;
LLUUID item_id = findItemID(mImageAssetID, FALSE);
if (item_id.isNull())
{
mInventoryPanel->clearSelection();
}
else
{
LLInventoryItem* itemp = gInventory.getItem(image_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
// no copy texture
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
mNoCopyTextureSelected = TRUE;
}
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
}
}
}
示例2: setImageID
void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
{
if( mImageAssetID != image_id && mActive)
{
mNoCopyTextureSelected = FALSE;
mIsDirty = TRUE;
mImageAssetID = image_id;
LLUUID item_id = findItemID(mImageAssetID, FALSE);
if (item_id.isNull())
{
mInventoryPanel->clearSelection();
}
else
{
LLInventoryItem* itemp = gInventory.getItem(image_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
// no copy texture
childSetValue("apply_immediate_check", FALSE);
mNoCopyTextureSelected = TRUE;
}
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
}
}
}
示例3: setImageID
void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
{
if( mImageAssetID != image_id && mActive)
{
mNoCopyTextureSelected = FALSE;
mIsDirty = TRUE;
mImageAssetID = image_id;
LLUUID item_id = findItemID(mImageAssetID, FALSE);
if (item_id.isNull())
{
mInventoryPanel->getRootFolder()->clearSelection();
}
else
{
LLInventoryItem* itemp = gInventory.getItem(image_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()) && !EffervescenceSpecialFunctionalitySwitch)
{
// no copy texture
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
mNoCopyTextureSelected = TRUE;
}
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
}
}
}
示例4: on_new_single_inventory_upload_complete
void on_new_single_inventory_upload_complete(
LLAssetType::EType asset_type,
LLInventoryType::EType inventory_type,
const std::string inventory_type_string,
const LLUUID& item_folder_id,
const std::string& item_name,
const std::string& item_description,
const LLSD& server_response,
S32 upload_price)
{
bool success = false;
if ( upload_price > 0 )
{
// this upload costed us L$, update our balance
// and display something saying that it cost L$
LLStatusBar::sendMoneyBalanceRequest();
std::string type_currency = LLGridManager::getInstance()->getCurrency();
LLSD args;
args["AMOUNT"] = llformat("%d", upload_price);
args["CUR"] = type_currency;
LLNotificationsUtil::add("UploadPayment", args);
}
if( item_folder_id.notNull() )
{
U32 everyone_perms = PERM_NONE;
U32 group_perms = PERM_NONE;
U32 next_owner_perms = PERM_ALL;
if( server_response.has("new_next_owner_mask") )
{
// The server provided creation perms so use them.
// Do not assume we got the perms we asked for in
// since the server may not have granted them all.
everyone_perms = server_response["new_everyone_mask"].asInteger();
group_perms = server_response["new_group_mask"].asInteger();
next_owner_perms = server_response["new_next_owner_mask"].asInteger();
}
else
{
// The server doesn't provide creation perms
// so use old assumption-based perms.
if( inventory_type_string != "snapshot")
{
next_owner_perms = PERM_MOVE | PERM_TRANSFER;
}
}
LLPermissions new_perms;
new_perms.init(
gAgent.getID(),
gAgent.getID(),
LLUUID::null,
LLUUID::null);
new_perms.initMasks(
PERM_ALL,
PERM_ALL,
everyone_perms,
group_perms,
next_owner_perms);
U32 inventory_item_flags = 0;
if (server_response.has("inventory_flags"))
{
inventory_item_flags = (U32) server_response["inventory_flags"].asInteger();
if (inventory_item_flags != 0)
{
llinfos << "inventory_item_flags " << inventory_item_flags << llendl;
}
}
S32 creation_date_now = time_corrected();
LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem(
server_response["new_inventory_item"].asUUID(),
item_folder_id,
new_perms,
server_response["new_asset"].asUUID(),
asset_type,
inventory_type,
item_name,
item_description,
LLSaleInfo::DEFAULT,
inventory_item_flags,
creation_date_now);
gInventory.updateItem(item);
gInventory.notifyObservers();
success = true;
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
if ( panel )
{
LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
panel->setSelection(
server_response["new_inventory_item"].asUUID(),
TAKE_FOCUS_NO);
//.........这里部分代码省略.........
示例5: postBuild
// virtual
BOOL LLFloaterTexturePicker::postBuild()
{
LLFloater::postBuild();
if (!mLabel.empty())
{
std::string pick = getString("pick title");
setTitle(pick + mLabel);
}
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
childSetCommitCallback("show_folders_check", onShowFolders, this);
getChildView("show_folders_check")->setVisible( FALSE);
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask);
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2));
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
// Disable auto selecting first filtered item because it takes away
// selection from the item set by LLTextureCtrl owning this floater.
mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE);
// Commented out to scroll to currently selected texture. See EXT-5403.
// // store this filter as the default one
// mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mNoCopyTextureSelected = FALSE;
getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
if (!mCanApplyImmediately)
{
getChildView("show_folders_check")->setEnabled(FALSE);
}
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
// update permission filter once UI is fully initialized
updateFilterPermMask();
mSavedFolderState.setApply(FALSE);
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1));
return TRUE;
}
示例6: postBuild
// virtual
BOOL LLFloaterTexturePicker::postBuild()
{
LLFloater::postBuild();
// <dogmode>
/**
LLInventoryItem* itemp = gInventory.getItem(mImageAssetID);
if (itemp && (itemp->getPermissions().getMaskOwner() & PERM_ALL))
childSetValue("texture_uuid", mImageAssetID);
else
childSetValue("texture_uuid", LLUUID::null.asString());
**/
if (!mLabel.empty())
{
std::string pick = getString("pick title");
setTitle(pick + mLabel);
}
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
childSetAction("Alpha", LLFloaterTexturePicker::onBtnAlpha,this);
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
// tag: vaa emerald local_asset_browser [begin]
// childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this);
// childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this);
childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this);
childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this);
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this));
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
// tag: vaa emerald local_asset_browser [end]
childSetCommitCallback("show_folders_check", onShowFolders, this);
getChildView("show_folders_check")->setVisible( FALSE);
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask);
mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2));
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
// Disable auto selecting first filtered item because it takes away
// selection from the item set by LLTextureCtrl owning this floater.
mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE);
// Commented out to scroll to currently selected texture. See EXT-5403.
// // store this filter as the default one
// mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mNoCopyTextureSelected = FALSE;
getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
if (!mCanApplyImmediately)
{
getChildView("show_folders_check")->setEnabled(FALSE);
}
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
childSetAction("ApplyUUID", LLFloaterTexturePicker::onBtnUUID,this);
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
mFilterEdit->setFocus(true);
// update permission filter once UI is fully initialized
updateFilterPermMask();
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1));
return TRUE;
//.........这里部分代码省略.........