本文整理汇总了C++中Row::IsContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ Row::IsContainer方法的具体用法?C++ Row::IsContainer怎么用?C++ Row::IsContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row::IsContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
nsTreeContentView::ContentInserted(nsIDocument *aDocument,
nsIContent* aContainer,
nsIContent* aChild)
{
NS_ASSERTION(aChild, "null ptr");
// Make sure this notification concerns us.
// First check the tag to see if it's one that we care about.
// Don't allow non-XUL nodes.
if (!aChild->IsXULElement() || !aContainer->IsXULElement())
return;
if (!aChild->IsAnyOfXULElements(nsGkAtoms::treeitem,
nsGkAtoms::treeseparator,
nsGkAtoms::treechildren,
nsGkAtoms::treerow,
nsGkAtoms::treecell)) {
return;
}
// If we have a legal tag, go up to the tree/select and make sure
// that it's ours.
for (nsIContent* element = aContainer; element != mBody; element = element->GetParent()) {
if (!element)
return; // this is not for us
if (element->IsXULElement(nsGkAtoms::tree))
return; // this is not for us
}
// Lots of codepaths under here that do all sorts of stuff, so be safe.
nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
if (aChild->IsXULElement(nsGkAtoms::treechildren)) {
int32_t index = FindContent(aContainer);
if (index >= 0) {
Row* row = mRows[index].get();
row->SetEmpty(false);
if (mBoxObject)
mBoxObject->InvalidateRow(index);
if (row->IsContainer() && row->IsOpen()) {
int32_t count = EnsureSubtree(index);
if (mBoxObject)
mBoxObject->RowCountChanged(index + 1, count);
}
}
}
else if (aChild->IsAnyOfXULElements(nsGkAtoms::treeitem,
nsGkAtoms::treeseparator)) {
InsertRowFor(aContainer, aChild);
}
else if (aChild->IsXULElement(nsGkAtoms::treerow)) {
int32_t index = FindContent(aContainer);
if (index >= 0 && mBoxObject)
mBoxObject->InvalidateRow(index);
}
else if (aChild->IsXULElement(nsGkAtoms::treecell)) {
nsCOMPtr<nsIContent> parent = aContainer->GetParent();
if (parent) {
int32_t index = FindContent(parent);
if (index >= 0 && mBoxObject)
mBoxObject->InvalidateRow(index);
}
}
}