本文整理汇总了C++中ModelNode::SetHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelNode::SetHidden方法的具体用法?C++ ModelNode::SetHidden怎么用?C++ ModelNode::SetHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelNode
的用法示例。
在下文中一共展示了ModelNode::SetHidden方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
status_t
VariablesView::VariableTableModel::_AddNode(Variable* variable,
ModelNode* parent, ValueNodeChild* nodeChild, bool isPresentationNode)
{
// Don't create nodes for unspecified types -- we can't get/show their
// value anyway.
Type* nodeChildRawType = nodeChild->GetType()->ResolveRawType(false);
if (nodeChildRawType->Kind() == TYPE_UNSPECIFIED)
return B_OK;
ModelNode* node = new(std::nothrow) ModelNode(parent, variable, nodeChild,
isPresentationNode);
BReference<ModelNode> nodeReference(node, true);
if (node == NULL || node->Init() != B_OK)
return B_NO_MEMORY;
int32 childIndex;
if (parent != NULL) {
childIndex = parent->CountChildren();
if (!parent->AddChild(node))
return B_NO_MEMORY;
// the parent has a reference, now
} else {
childIndex = fNodes.CountItems();
if (!fNodes.AddItem(node))
return B_NO_MEMORY;
nodeReference.Detach();
// the fNodes list has a reference, now
}
fNodeTable.Insert(node);
// mark a compound type child of a address type parent hidden
if (parent != NULL) {
ValueNode* parentValueNode = parent->NodeChild()->Node();
if (parentValueNode != NULL
&& parentValueNode->GetType()->ResolveRawType(false)->Kind()
== TYPE_ADDRESS
&& nodeChildRawType->Kind() == TYPE_COMPOUND) {
node->SetHidden(true);
}
}
// notify table model listeners
if (!node->IsHidden()) {
TreeTablePath path;
if (parent == NULL || _GetTreePath(parent, path))
NotifyNodesAdded(path, childIndex, 1);
}
// if the node is hidden, add its children
if (node->IsHidden())
_AddChildNodes(nodeChild);
return B_OK;
}