本文整理汇总了C++中BListItem::HasSubitems方法的典型用法代码示例。如果您正苦于以下问题:C++ BListItem::HasSubitems方法的具体用法?C++ BListItem::HasSubitems怎么用?C++ BListItem::HasSubitems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListItem
的用法示例。
在下文中一共展示了BListItem::HasSubitems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FullListCountItems
BList*
BOutlineListView::_BuildTree(BListItem* underItem, int32& fullIndex)
{
int32 fullCount = FullListCountItems();
uint32 level = underItem != NULL ? underItem->OutlineLevel() + 1 : 0;
BList* list = new BList;
if (underItem != NULL)
underItem->fTemporaryList = list;
while (fullIndex < fullCount) {
BListItem* item = FullListItemAt(fullIndex);
// If we jump out of the subtree, break out
if (item->fLevel < level)
break;
// If the level matches, put them into the list
// (we handle the case of a missing sublevel gracefully)
list->AddItem(item);
fullIndex++;
if (item->HasSubitems()) {
// we're going deeper
_BuildTree(item, fullIndex);
}
}
return list;
}
示例2:
void
BOutlineListView::_DestructTree(BList* tree)
{
for (int32 index = tree->CountItems(); index-- > 0;) {
BListItem* item = (BListItem*)tree->ItemAt(index);
if (item->HasSubitems())
_DestructTree(item->fTemporaryList);
}
delete tree;
}
示例3: ListItemComparator
void
BOutlineListView::_SortTree(BList* tree, bool oneLevelOnly,
int (*compareFunc)(const BListItem* a, const BListItem* b))
{
BListItem** items = (BListItem**)tree->Items();
std::sort(items, items + tree->CountItems(), ListItemComparator(compareFunc));
if (oneLevelOnly)
return;
for (int32 index = tree->CountItems(); index-- > 0;) {
BListItem* item = (BListItem*)tree->ItemAt(index);
if (item->HasSubitems())
_SortTree(item->fTemporaryList, false, compareFunc);
}
}