当前位置: 首页>>代码示例>>C++>>正文


C++ LLFolderView类代码示例

本文整理汇总了C++中LLFolderView的典型用法代码示例。如果您正苦于以下问题:C++ LLFolderView类的具体用法?C++ LLFolderView怎么用?C++ LLFolderView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LLFolderView类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getRootFolder

void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
{
	// Schedule updating the folder view context menu when all selected items become complete (STORM-373).
	mCompletionObserver->reset();
	for (std::deque<LLFolderViewItem*>::const_iterator it = items.begin(); it != items.end(); ++it)
	{
		LLUUID id = (*it)->getListener()->getUUID();
		LLViewerInventoryItem* inv_item = mInventory->getItem(id);

		if (inv_item && !inv_item->isFinished())
		{
			mCompletionObserver->watchItem(id);
		}
	}

	LLFolderView* fv = 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();
		}
	}
}
开发者ID:sines,项目名称:SingularityViewer,代码行数:25,代码来源:llinventorypanel.cpp

示例2: onOpenOutfitButtonClicked

void LLSidepanelAppearance::onOpenOutfitButtonClicked()
{
	const LLViewerInventoryItem *outfit_link = LLAppearanceMgr::getInstance()->getBaseOutfitLink();
	if (!outfit_link)
		return;
	if (!outfit_link->getIsLinkType())
		return;

	LLAccordionCtrlTab* tab_outfits = mPanelOutfitsInventory->findChild<LLAccordionCtrlTab>("tab_outfits");
	if (tab_outfits)
	{
		tab_outfits->changeOpenClose(FALSE);
		LLInventoryPanel *inventory_panel = tab_outfits->findChild<LLInventoryPanel>("outfitslist_tab");
		if (inventory_panel)
		{
			LLFolderView* root = inventory_panel->getRootFolder();
			LLFolderViewItem *outfit_folder = root->getItemByID(outfit_link->getLinkedUUID());
			if (outfit_folder)
			{
				outfit_folder->setOpen(!outfit_folder->isOpen());
				root->setSelectionFromRoot(outfit_folder,TRUE);
				root->scrollToShowSelection();
			}
		}
	}
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例3: selectItemInAccordionTab

LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list,
															 const std::string& tab_name,
															 const LLUUID& obj_id,
															 BOOL take_keyboard_focus) const
{
	if (!inventory_list)
		return NULL;

	LLFolderView* root = inventory_list->getRootFolder();

	LLFolderViewItem* item = inventory_list->getItemByID(obj_id);
	if (!item)
		return NULL;

	LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(tab_name);
	if (!tab->isExpanded())
	{
		tab->changeOpenClose(false);
	}

	root->setSelection(item, FALSE, take_keyboard_focus);

	LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion");
	LLRect screen_rc;
	localRectToScreen(item->getRect(), &screen_rc);
	accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue()));

	return item;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:29,代码来源:llpanellandmarks.cpp

示例4: getActivePanel

bool LLPanelOutfitsInventory::hasItemsSelected()
{
    bool has_items_selected = false;
    LLFolderView *folder = getActivePanel()->getRootFolder();
    if (folder)
    {
        std::set<LLUUID> selection_set;
        folder->getSelectionList(selection_set);
        has_items_selected = (selection_set.size() > 0);
    }
    return has_items_selected;
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:12,代码来源:llpaneloutfitsinventory.cpp

示例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;
	}
开发者ID:Apelsin,项目名称:EffervescenceViewer,代码行数:52,代码来源:llinventoryactions.cpp

示例6: 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();
		}
	}
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:14,代码来源:llinventoryview.cpp

示例7: 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(selected_items);
		LLUUID id = *selected_items.begin();

		std::string joint_name = userdata.asString();
		LLVOAvatar *avatarp = gAgent.getAvatarObject();
		LLViewerJointAttachment* attachmentp = NULL;
		for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); 
			 iter != avatarp->mAttachmentPoints.end(); )
		{
			LLVOAvatar::attachment_map_t::iterator curiter = iter++;
			LLViewerJointAttachment* attachment = curiter->second;
			if (attachment->getName() == joint_name)
			{
				attachmentp = attachment;
				break;
			}
		}
		if (attachmentp == NULL)
		{
			return true;
		}
		LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id);

		if(item && gInventory.isObjectDescendentOf(id, gAgent.getInventoryRootID()))
		{
			rez_attachment(item, attachmentp);
		}
		else if(item && item->isComplete())
		{
			// must be in library. copy it to our inventory and put it on.
			LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(attachmentp);
			copy_inventory_item(
				gAgent.getID(),
				item->getPermissions().getOwner(),
				item->getUUID(),
				LLUUID::null,
				std::string(),
				cb);
		}
		gFocusMgr.setKeyboardFocus(NULL);

		return true;
	}
开发者ID:,项目名称:,代码行数:50,代码来源:

示例8: folder_rect

LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix)
{
	LLRect folder_rect(0,
					   0,
					   getRect().getWidth(),
					   0);

	LLFolderView* ret = new LLFolderView(
	getName(), 
	folder_rect, 
	LLUUID::null, 
	this, 
	bridge);
	ret->setAllowMultiSelect(mAllowMultiSelect);
	return ret;
}
开发者ID:sines,项目名称:SingularityViewer,代码行数:16,代码来源:llinventorypanel.cpp

示例9: if

void LLPanelOutfitEdit::saveListSelection()
{
	if(mWearablesListViewPanel->getVisible())
	{
		std::set<LLUUID> selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList();

		if(!selected_ids.size()) return;

		for (std::set<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id)
		{
			mWearableItemsList->selectItemByUUID(*item_id, true);
		}
		mWearableItemsList->scrollToShowFirstSelectedItem();
	}
	else if(mInventoryItemsPanel->getVisible())
	{
		std::vector<LLUUID> selected_ids;
		mWearableItemsList->getSelectedUUIDs(selected_ids);

		if(!selected_ids.size()) return;

		mInventoryItemsPanel->clearSelection();
		LLFolderView* root = mInventoryItemsPanel->getRootFolder();

		if(!root) return;

		for(std::vector<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id)
		{
			LLFolderViewItem* item = root->getItemByID(*item_id);
			if (!item) continue;

			LLFolderViewFolder* parent = item->getParentFolder();
			if(parent)
			{
				parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
			}
			mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE);
		}
		mInventoryItemsPanel->getRootFolder()->scrollToShowSelection();
	}
}
开发者ID:NickyPerian,项目名称:viewer-development,代码行数:41,代码来源:llpaneloutfitedit.cpp

示例10: getActivePanel

BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
{
	const std::string command_name = userdata.asString();
	if (command_name == "delete")
	{
		BOOL can_delete = FALSE;
		LLFolderView* root = getActivePanel()->getRootFolder();
		if (root)
		{
			can_delete = TRUE;
			std::set<LLUUID> selection_set = root->getSelectionList();
			if (selection_set.empty()) return FALSE;
			for (std::set<LLUUID>::iterator iter = selection_set.begin();
				 iter != selection_set.end();
				 ++iter)
			{
				const LLUUID &item_id = (*iter);
				LLFolderViewItem *item = root->getItemByID(item_id);
				const LLFolderViewEventListener *listener = item->getListener();
				llassert(listener);
				if (!listener) return FALSE;
				can_delete &= listener->isItemRemovable();
				can_delete &= !listener->isItemInTrash();
			}
			return can_delete;
		}
		return FALSE;
	}
	if (command_name == "save_texture")
	{
		return isSaveTextureEnabled(userdata);
	}
	if (command_name == "find_original")
	{
		LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
		if (!current_item) return FALSE;
		const LLUUID& item_id = current_item->getListener()->getUUID();
		const LLViewerInventoryItem *item = gInventory.getItem(item_id);
		if (item && item->getIsLinkType() && !item->getIsBrokenLink())
		{
			return TRUE;
		}
		return FALSE;
	}

	if (command_name == "find_links")
	{
		LLFolderView* root = getActivePanel()->getRootFolder();
		std::set<LLUUID> selection_set = root->getSelectionList();
		if (selection_set.size() != 1) return FALSE;
		LLFolderViewItem* current_item = root->getCurSelectedItem();
		if (!current_item) return FALSE;
		const LLUUID& item_id = current_item->getListener()->getUUID();
		const LLInventoryObject *obj = gInventory.getObject(item_id);
		if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType()))
		{
			return TRUE;
		}
		return FALSE;
	}
	// This doesn't currently work, since the viewer can't change an assetID an item.
	if (command_name == "regenerate_link")
	{
		LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
		if (!current_item) return FALSE;
		const LLUUID& item_id = current_item->getListener()->getUUID();
		const LLViewerInventoryItem *item = gInventory.getItem(item_id);
		if (item && item->getIsBrokenLink())
		{
			return TRUE;
		}
		return FALSE;
	}

	if (command_name == "share")
	{
		LLSidepanelInventory* parent = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
		return parent ? parent->canShare() : FALSE;
	}

	return TRUE;
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:82,代码来源:llpanelmaininventory.cpp


注:本文中的LLFolderView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。