void
ValueNodeManager::ValueNodeValueChanged(ValueNode* valueNode)
{
	if (fContainer == NULL)
		return;

	AutoLocker<ValueNodeContainer> containerLocker(fContainer);

	// check whether we know the node
	ValueNodeChild* nodeChild = valueNode->NodeChild();
	if (nodeChild == NULL)
		return;

	if (valueNode->ChildCreationNeedsValue()
		&& !valueNode->ChildrenCreated()) {
		status_t error = valueNode->CreateChildren();
		if (error == B_OK) {
			for (int32 i = 0; i < valueNode->CountChildren(); i++) {
				ValueNodeChild* child = valueNode->ChildAt(i);
				_CreateValueNode(child);
				AddChildNodes(child);
			}
		}
	}

	for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
		fListeners.ItemAt(i)->ValueNodeValueChanged(valueNode);
}
void __fastcall TEditorsStylesDemoDemoMainForm::FillTreeViewItems()
{
  cxTreeView->Items->Clear();
  TStringList* AStrings = new TStringList();
  TTreeNode* ANode;
  for (int i=0; i < EditorsStylesDemoFrameManager()->FramesCount; i++) {
    EditorsStylesDemoFrameManager()->Frames[i]->OnFileNameChanged = UpdateFileNameStatusPanel;
    ANode = cxTreeView->Items->AddChildObject(NULL,
      EditorsStylesDemoFrameManager()->Frames[i]->Name(), EditorsStylesDemoFrameManager()->Frames[i]);
    AddChildNodes(EditorsStylesDemoFrameManager()->Frames[i]->
      GetExtEditorTypes(EditorsStylesDemoFrameManager()->Frames[i]), AStrings, ANode);
  }
}
void
ValueNodeManager::_AddNode(Variable* variable)
{
	// create the node child for the variable
	ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild(
		variable);
	BReference<ValueNodeChild> nodeChildReference(nodeChild, true);
	if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) {
		delete nodeChild;
		return;
	}

	// automatically add child nodes for the top level nodes
	AddChildNodes(nodeChild);
}