本文整理汇总了C++中BListItem::IsExpanded方法的典型用法代码示例。如果您正苦于以下问题:C++ BListItem::IsExpanded方法的具体用法?C++ BListItem::IsExpanded怎么用?C++ BListItem::IsExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListItem
的用法示例。
在下文中一共展示了BListItem::IsExpanded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsExpanded
bool ColumnListView::IsExpanded(int32 fullListIndex) const
{
BListItem* TheItem = (BListItem*)fFullItemList.ItemAt(fullListIndex);
if(TheItem)
return TheItem->IsExpanded();
else
return false;
}
示例2: FullListItemAt
bool
BOutlineListView::IsExpanded(int32 fullListIndex)
{
BListItem* item = FullListItemAt(fullListIndex);
if (!item)
return false;
return item->IsExpanded();
}
示例3:
void
BOutlineListView::_PopulateTree(BList* tree, BList& target,
int32& firstIndex, bool onlyVisible)
{
BListItem** items = (BListItem**)target.Items();
int32 count = tree->CountItems();
for (int32 index = 0; index < count; index++) {
BListItem* item = (BListItem*)tree->ItemAtFast(index);
items[firstIndex++] = item;
if (item->HasSubitems() && (!onlyVisible || item->IsExpanded()))
_PopulateTree(item->fTemporaryList, target, firstIndex, onlyVisible);
}
}
示例4: IndexOf
void
BOutlineListView::MouseDown(BPoint point)
{
MakeFocus();
int32 index = IndexOf(point);
if (index != -1) {
BListItem* item = ItemAt(index);
if (item->fHasSubitems
&& LatchRect(ItemFrame(index), item->fLevel).Contains(point)) {
if (item->IsExpanded())
Collapse(item);
else
Expand(item);
} else
BListView::MouseDown(point);
}
}
示例5: if
bool
BOutlineListView::AddItem(BListItem* item, int32 fullListIndex)
{
if (fullListIndex < 0)
fullListIndex = 0;
else if (fullListIndex > FullListCountItems())
fullListIndex = FullListCountItems();
if (!fFullList.AddItem(item, fullListIndex))
return false;
// Check if this item is visible, and if it is, add it to the
// other list, too
if (item->fLevel > 0) {
BListItem* super = _SuperitemForIndex(fullListIndex, item->fLevel);
if (super == NULL)
return true;
bool hadSubitems = super->fHasSubitems;
super->fHasSubitems = true;
if (!super->IsItemVisible() || !super->IsExpanded()) {
item->SetItemVisible(false);
return true;
}
if (!hadSubitems)
Invalidate(LatchRect(ItemFrame(IndexOf(super)), super->OutlineLevel()));
}
int32 listIndex = _FindPreviousVisibleIndex(fullListIndex);
if (!BListView::AddItem(item, IndexOf(FullListItemAt(listIndex)) + 1)) {
// adding didn't work out, we need to remove it from the main list again
fFullList.RemoveItem(fullListIndex);
return false;
}
return true;
}
示例6: conventions
void
LocaleWindow::_Defaults()
{
BMessage preferredLanguages;
preferredLanguages.AddString("language", "en");
MutableLocaleRoster::Default()->SetPreferredLanguages(&preferredLanguages);
_SetPreferredLanguages(preferredLanguages);
BFormattingConventions conventions("en_US");
MutableLocaleRoster::Default()->SetDefaultFormattingConventions(
conventions);
fConventionsListView->DeselectAll();
if (fDefaultConventionsItem != NULL) {
BListItem* superitem
= fConventionsListView->Superitem(fDefaultConventionsItem);
if (superitem != NULL && !superitem->IsExpanded())
superitem->SetExpanded(true);
fConventionsListView->Select(fConventionsListView->IndexOf(
fDefaultConventionsItem));
fConventionsListView->ScrollToSelection();
}
}