本文整理汇总了C++中LLAccordionCtrlTab类的典型用法代码示例。如果您正苦于以下问题:C++ LLAccordionCtrlTab类的具体用法?C++ LLAccordionCtrlTab怎么用?C++ LLAccordionCtrlTab使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLAccordionCtrlTab类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: handleDragAndDrop
BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
LLAccordionCtrlTab* parent = dynamic_cast<LLAccordionCtrlTab*>(getParent());
if ( parent && !parent->getDisplayChildren() && parent->getCollapsible() && parent->canOpenClose() )
{
if (mAutoOpenTimer.getStarted())
{
if (mAutoOpenTimer.getElapsedTimeF32() > AUTO_OPEN_TIME)
{
parent->changeOpenClose(false);
mAutoOpenTimer.stop();
return TRUE;
}
}
else
mAutoOpenTimer.start();
}
return LLUICtrl::handleDragAndDrop(x, y, mask, drop, cargo_type,
cargo_data, accept, tooltip_msg);
}
示例3: showAccordion
void LLPanelPicks::showAccordion(const std::string& name, bool show)
{
LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
tab->setVisible(show);
LLAccordionCtrl* acc = getChild<LLAccordionCtrl>("accordion");
acc->arrange();
}
示例4: showTeleportHistory
void LLTeleportHistoryPanel::showTeleportHistory()
{
mDirty = true;
// Starting to add items from last one, in reverse order,
// since TeleportHistory keeps most recent item at the end
if (!mTeleportHistory)
{
mTeleportHistory = LLTeleportHistoryStorage::getInstance();
}
mCurrentItem = mTeleportHistory->getItems().size() - 1;
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)
{
LLAccordionCtrlTab* tab = mItemContainers.get(n);
if (tab)
{
tab->setVisible(false);
LLFlatListView* fv = getFlatListViewFromTab(tab);
if (fv)
{
// Detached panels are managed by LLTeleportHistoryFlatItemStorage
std::vector<LLPanel*> detached_items;
fv->detachItems(detached_items);
}
}
}
}
示例5: onSearchEdit
// virtual
void LLLandmarksPanel::onSearchEdit(const std::string& string)
{
// give FolderView a chance to be refreshed. So, made all accordions visible
for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter)
{
LLAccordionCtrlTab* tab = *iter;
tab->setVisible(TRUE);
// expand accordion to see matched items in each one. See EXT-2014.
if (string != "")
{
tab->changeOpenClose(false);
}
LLPlacesInventoryPanel* inventory_list = dynamic_cast<LLPlacesInventoryPanel*>(tab->getAccordionView());
if (NULL == inventory_list) continue;
filter_list(inventory_list, string);
}
if (sFilterSubString != string)
sFilterSubString = string;
// show all folders in Landmarks Accordion for empty filter
// only if Landmarks inventory folder is not empty
updateShowFolderState();
}
示例6: handleItemSelect
void LLTeleportHistoryPanel::handleItemSelect(LLFlatListView* selected)
{
mLastSelectedFlatlList = selected;
LLTeleportHistoryFlatItem* item = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem());
if (item)
mLastSelectedItemIndex = item->getIndex();
S32 tabs_cnt = mItemContainers.size();
for (S32 n = 0; n < tabs_cnt; n++)
{
LLAccordionCtrlTab* tab = mItemContainers.get(n);
if (!tab->getVisible())
continue;
LLFlatListView *flv = getFlatListViewFromTab(tab);
if (!flv)
continue;
if (flv == selected)
continue;
flv->resetSelection(true);
}
updateVerbs();
}
示例7: onCOFChanged
void LLOutfitsList::onCOFChanged()
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
// Collect current COF items
gInventory.collectDescendents(
LLAppearanceMgr::instance().getCOF(),
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
uuid_vec_t vnew;
uuid_vec_t vadded;
uuid_vec_t vremoved;
// From gInventory we get the UUIDs of links that are currently in COF.
// These links UUIDs are not the same UUIDs that we have in each wearable items list.
// So we collect base items' UUIDs to find them or links that point to them in wearable
// items lists and update their worn state there.
for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
iter != item_array.end();
++iter)
{
vnew.push_back((*iter)->getLinkedUUID());
}
// We need to update only items that were added or removed from COF.
LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved);
// Store the ids of items currently linked from COF.
mCOFLinkedItems = vnew;
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if (!tab) continue;
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (!list) continue;
// Append removed ids to added ids because we should update all of them.
vadded.reserve(vadded.size() + vremoved.size());
vadded.insert(vadded.end(), vremoved.begin(), vremoved.end());
// Every list updates the labels of changed items or
// the links that point to these items.
list->updateChangedItems(vadded);
}
}
示例8: expand_all_folders
void LLOutfitsList::expand_all_folders()
{
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if(tab && !tab->isExpanded())
{
tab->changeOpenClose(false);
}
}
}
示例9: getRect
void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw()
{
S32 width = getRect().getWidth();
S32 height = getRect().getHeight();
F32 alpha = getCurrentTransparency();
gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get() % alpha,true);
LLAccordionCtrlTab* parent = dynamic_cast<LLAccordionCtrlTab*>(getParent());
bool collapsible = (parent && parent->getCollapsible());
bool expanded = (parent && parent->getDisplayChildren());
// Handle overlay images, if needed
// Only show green "focus" background image if the accordion is open,
// because the user's mental model of focus is that it goes away after
// the accordion is closed.
if (getParent()->hasFocus() || mIsSelected
/*&& !(collapsible && !expanded)*/ // WHY??
)
{
mImageHeaderFocused->draw(0,0,width,height);
}
else
{
mImageHeader->draw(0,0,width,height);
}
if(mNeedsHighlight)
{
mImageHeaderOver->draw(0,0,width,height);
}
if(collapsible)
{
LLPointer<LLUIImage> overlay_image;
if(expanded)
{
overlay_image = mImageExpanded;
}
else
{
overlay_image = mImageCollapsed;
}
overlay_image->draw(HEADER_IMAGE_LEFT_OFFSET,
(height - overlay_image->getHeight()) / 2);
}
LLUICtrl::draw();
}
示例10:
static LLPanel *childGetVisibleTabWithHelp(LLView *parent)
{
LLView *child;
// look through immediate children first for an active tab with help
for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child))
{
LLPanel *curTabPanel = NULL;
// do we have a tab container?
LLTabContainer *tab = dynamic_cast<LLTabContainer *>(child);
if (tab && tab->getVisible())
{
curTabPanel = tab->getCurrentPanel();
}
// do we have an accordion tab?
LLAccordionCtrlTab* accordion = dynamic_cast<LLAccordionCtrlTab *>(child);
if (accordion && accordion->getDisplayChildren())
{
curTabPanel = dynamic_cast<LLPanel *>(accordion->getAccordionView());
}
// if we found a valid tab, does it have a help topic?
if (curTabPanel && !curTabPanel->getHelpTopic().empty())
{
return curTabPanel;
}
}
// then try a bit harder and recurse through all children
for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child))
{
if (child->getVisible())
{
LLPanel* tab = ::childGetVisibleTabWithHelp(child);
if (tab)
{
return tab;
}
}
}
// couldn't find any active tabs with a help topic string
return NULL;
}
示例11: onFilteredWearableItemsListRefresh
void LLOutfitsList::onFilteredWearableItemsListRefresh(LLUICtrl* ctrl)
{
if (!ctrl || sFilterSubString.empty())
return;
for (outfits_map_t::iterator
iter = mOutfitsMap.begin(),
iter_end = mOutfitsMap.end();
iter != iter_end; ++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if (!tab) continue;
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (list != ctrl) continue;
applyFilterToTab(iter->first, tab, sFilterSubString);
}
}
示例12: updateOutfitTab
void LLOutfitsList::updateOutfitTab(const LLUUID& category_id)
{
outfits_map_t::iterator outfits_iter = mOutfitsMap.find(category_id);
if (outfits_iter != mOutfitsMap.end())
{
LLViewerInventoryCategory *cat = gInventory.getCategory(category_id);
if (!cat) return;
std::string name = cat->getName();
// Update tab name with the new category name.
LLAccordionCtrlTab* tab = outfits_iter->second;
if (tab)
{
tab->setName(name);
tab->setTitle(name);
}
}
}
示例13: isActionEnabled
bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const
{
S32 tabs_cnt = mItemContainers.size();
bool has_expanded_tabs = false;
bool has_collapsed_tabs = false;
for (S32 n = 0; n < tabs_cnt; n++)
{
LLAccordionCtrlTab* tab = mItemContainers.get(n);
if (!tab->getVisible())
continue;
if (tab->getDisplayChildren())
{
has_expanded_tabs = true;
}
else
{
has_collapsed_tabs = true;
}
if (has_expanded_tabs && has_collapsed_tabs)
{
break;
}
}
std::string command_name = userdata.asString();
if (has_expanded_tabs && command_name == "collapse_all")
{
return true;
}
if (has_collapsed_tabs && command_name == "expand_all")
{
return true;
}
return false;
}
示例14: showAccordion
void LLPanelPeople::showAccordion(const std::string name, bool show)
{
if(name.empty())
{
llwarns << "No name provided" << llendl;
return;
}
LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
tab->setVisible(show);
if(show)
{
// don't expand accordion if it was collapsed by user
if(!isAccordionCollapsedByUser(tab))
{
// expand accordion
tab->changeOpenClose(false);
}
}
}
示例15: setSelectedOutfitByUUID
void LLOutfitsList::setSelectedOutfitByUUID(const LLUUID& outfit_uuid)
{
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
if (outfit_uuid == iter->first)
{
LLAccordionCtrlTab* tab = iter->second;
if (!tab) continue;
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (!list) continue;
tab->setFocus(TRUE);
changeOutfitSelection(list, outfit_uuid);
tab->setDisplayChildren(true);
}
}
}