本文整理汇总了C++中LLInventoryPanel::getRootFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryPanel::getRootFolder方法的具体用法?C++ LLInventoryPanel::getRootFolder怎么用?C++ LLInventoryPanel::getRootFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryPanel
的用法示例。
在下文中一共展示了LLInventoryPanel::getRootFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFilterEdit
void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string )
{
std::string upper_case_search_string = search_string;
LLStringUtil::toUpper(upper_case_search_string);
if (upper_case_search_string.empty())
{
if (mInventoryPanel->getFilterSubString().empty())
{
// current filter and new filter empty, do nothing
return;
}
mSavedFolderState.setApply(TRUE);
mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
// add folder with current item to list of previously opened folders
LLOpenFoldersWithSelection opener;
mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
mInventoryPanel->getRootFolder()->scrollToShowSelection();
}
else if (mInventoryPanel->getFilterSubString().empty())
{
// first letter in search term, save existing folder open state
if (!mInventoryPanel->getRootFolder()->isFilterModified())
{
mSavedFolderState.setApply(FALSE);
mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
}
}
mInventoryPanel->setFilterSubString(search_string);
}
示例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->getRootFolder()->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);
}
}
}
示例3: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
return LLInventoryAction::doToSelected(folder, userdata.asString());
}
示例4: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
std::string action = userdata.asString();
LLInventoryPanel *panel = mPtr->getPanel();
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
return doToSelected(folder, action);
}
示例5: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
std::set<LLUUID> selected_items = folder->getSelectionList();
LLUUID id = *selected_items.begin();
std::string joint_name = userdata.asString();
LLViewerJointAttachment* attachmentp = NULL;
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getName() == joint_name)
{
attachmentp = attachment;
break;
}
}
if (!attachmentp)
{
return true;
}
if (LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id))
{
if(gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
{
rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu
}
else if(item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
// LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&rez_attachment_cb, _1, attachmentp));
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2013-02-04 (Catznip-3.4)
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&rez_attachment_cb, _1, attachmentp, false));
// [/SL;KB]
copy_inventory_item(
gAgentID,
item->getPermissions().getOwner(),
item->getUUID(),
LLUUID::null,
std::string(),
cb);
}
}
gFocusMgr.setKeyboardFocus(NULL);
return true;
}
示例6: handleDragAndDrop
BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
if ((mOutboxInventoryPanel.get() == NULL) ||
//(mWindowShade && mWindowShade->isShown()) ||
LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() ||
mOutboxId.isNull())
{
return FALSE;
}
LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
BOOL handled = (handled_view != NULL);
// Determine if the mouse is inside the inventory panel itself or just within the floater
bool pointInInventoryPanel = false;
bool pointInInventoryPanelChild = false;
LLInventoryPanel* panel = mOutboxInventoryPanel.get();
LLFolderView * root_folder = panel->getRootFolder();
if (panel->getVisible())
{
S32 inv_x, inv_y;
localPointToOtherView(x, y, &inv_x, &inv_y, panel);
pointInInventoryPanel = panel->getRect().pointInRect(inv_x, inv_y);
LLView * inventory_panel_child_at_point = panel->childFromPoint(inv_x, inv_y, true);
pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder);
}
// Pass all drag and drop for this floater to the outbox inventory control
if (!handled || !isAccepted(*accept))
{
// Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel
// (otherwise the inventory panel itself will handle the drag and drop operation, without any override)
if (!pointInInventoryPanel)
{
handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
}
mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept));
}
else
{
mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild);
}
return handled;
}
示例7: buildInventoryPanel
LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::string& childname, const std::string& filename)
{
LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
// Singu Note: These should already be built!!
LLInventoryPanel* panel = tabs_panel->getChild<LLInventoryPanel>(childname, false, false);
llassert(panel != NULL);
// Set sort order and callbacks
panel->getRootFolder()->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME);
panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2));
return panel;
}
示例8: onSelectionChange
// static
void LLInventoryView::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
LLInventoryPanel* panel = (LLInventoryPanel*)data;
LLFolderView* fv = panel->getRootFolder();
if (fv->needsAutoRename()) // auto-selecting a new user-created asset and preparing to rename
{
fv->setNeedsAutoRename(FALSE);
if (items.size()) // new asset is visible and selected
{
fv->startRenamingSelectedItem();
}
}
}
示例9: canShare
bool LLSidepanelInventory::canShare()
{
LLInventoryPanel* inbox = mInventoryPanelInbox;
// Avoid flicker in the Recent tab while inventory is being loaded.
if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty())
&& (mPanelMainInventory && !mPanelMainInventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) )
{
return false;
}
return ( (mPanelMainInventory ? LLAvatarActions::canShareSelectedItems(mPanelMainInventory->getActivePanel()) : false)
|| (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) );
}
示例10: onAddButtonClicked
void LLPanelMarketplaceListings::onAddButtonClicked()
{
// Find active panel
LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
if (panel)
{
LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false);
llassert(marketplacelistings_id.notNull());
LLFolderType::EType preferred_type = LLFolderType::lookup("category");
LLUUID category = gInventory.createNewCategory(marketplacelistings_id, preferred_type, LLStringUtil::null);
gInventory.notifyObservers();
panel->setSelectionByID(category, TRUE);
panel->getRootFolder()->setNeedsAutoRename(TRUE);
}
}
示例11: onTabSelectionChange
void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
if (user_action && items.size() > 0)
{
for (tabpanels_vec_t::iterator iter = mTabPanels.begin();
iter != mTabPanels.end();
++iter)
{
LLInventoryPanel *panel = (*iter);
if (panel == tab_panel)
{
mActivePanel = panel;
}
else
{
panel->getRootFolder()->clearSelection();
}
}
}
onSelectionChange(items, user_action);
}
示例12: handleKeyHere
BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)
{
LLFolderView* root_folder = mInventoryPanel->getRootFolder();
if (root_folder && mFilterEdit)
{
if (mFilterEdit->hasFocus()
&& (key == KEY_RETURN || key == KEY_DOWN)
&& mask == MASK_NONE)
{
if (!root_folder->getCurSelectedItem())
{
LLFolderViewItem* itemp = root_folder->getItemByID(gInventory.getRootFolderID());
if (itemp)
{
root_folder->setSelection(itemp, FALSE, FALSE);
}
}
root_folder->scrollToShowSelection();
// move focus to inventory proper
mInventoryPanel->setFocus(TRUE);
// treat this as a user selection of the first filtered result
commitIfImmediateSet();
return TRUE;
}
if (mInventoryPanel->hasFocus() && key == KEY_UP)
{
mFilterEdit->focusFirstItem(TRUE);
}
}
return LLFloater::handleKeyHere(key, mask);
}
示例13: draw
//.........这里部分代码省略.........
//RN: reset search bar to reflect actual search query (all caps, for example)
mFilterEdit->setText(mInventoryPanel->getFilterSubString());
//BOOL allow_copy = FALSE;
if( mOwner )
{
mTexturep = NULL;
if(mImageAssetID.notNull())
{
mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_PREVIEW);
}
else if (!mFallbackImageName.empty())
{
mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, FTT_LOCAL_FILE, MIPMAP_YES, LLGLTexture::BOOST_PREVIEW);
}
if (mTentativeLabel)
{
mTentativeLabel->setVisible( FALSE );
}
getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID());
getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID);
getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
getChildView("Invisible")->setEnabled(mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID);
getChildView("Alpha")->setEnabled(mImageAssetID != mAlphaImageAssetID);
LLFloater::draw();
if( isMinimized() )
{
return;
}
// Border
LLRect border( BORDER_PAD,
getRect().getHeight() - LLFLOATER_HEADER_SIZE - BORDER_PAD,
((TEX_PICKER_MIN_WIDTH / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD,
BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - TEX_PICKER_MIN_HEIGHT));
gl_rect_2d( border, LLColor4::black, FALSE );
// Interior
LLRect interior = border;
interior.stretch( -1 );
if( mTexturep )
{
if( mTexturep->getComponents() == 4 )
{
gl_rect_2d_checkerboard( calcScreenRect(), interior );
}
gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep );
// Pump the priority
mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
// Draw Tentative Label over the image
if( mOwner->getTentative() && !mIsDirty )
{
mTentativeLabel->setVisible( TRUE );
drawChild(mTentativeLabel);
}
}
else
{
gl_rect_2d( interior, LLColor4::grey, TRUE );
// Draw X
gl_draw_x(interior, LLColor4::black );
}
if (mSelectedItemPinned) return;
LLFolderView* folder_view = mInventoryPanel->getRootFolder();
if (!folder_view) return;
LLInventoryFilter* filter = folder_view->getFilter();
if (!filter) return;
bool is_filter_active = folder_view->getCompletedFilterGeneration() < filter->getCurrentGeneration() &&
filter->isNotDefault();
// After inventory panel filter is applied we have to update
// constraint rect for the selected item because of folder view
// AutoSelectOverride set to TRUE. We force PinningSelectedItem
// flag to FALSE state and setting filter "dirty" to update
// scroll container to show selected item (see LLFolderView::doIdle()).
if (!is_filter_active && !mSelectedItemPinned)
{
folder_view->setPinningSelectedItem(mSelectedItemPinned);
folder_view->dirtyFilter();
folder_view->arrangeFromRoot();
mSelectedItemPinned = TRUE;
}
}
}
示例14: 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;
//.........这里部分代码省略.........
示例15: 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;
}