Example #1
0
void TreeItem::set_Children(UIElement/*TreeItemChildren*/ * Children)
{
	if (m_Children)
	{
		RemoveRChild(m_Children);
		delete m_Children;
	}
	m_Children = Children;
	if (m_Children)
	{
		ASSERT(0);
		//AddChild(m_Children);

		m_ExpandButton->set_Visibility(/*Children->get_Visibility() != Collapsed?*/ Visible/*: Hidden*/);

		bool m_expanded = m_Children->get_Visibility() != Collapsed;
	//	m_expanded = !m_expanded;

		if (m_expanded)
			dynamic_cast<Border*>(m_ExpandButton->get_Child())->set_Child(new TextString(WSTR("-")));
		else
			dynamic_cast<Border*>(m_ExpandButton->get_Child())->set_Child(new TextString(WSTR("+")));
	}
	else
	{
		m_ExpandButton->set_Visibility(Hidden);
	}
}
Example #2
0
void DockPanel::RemoveChildren()
{
    // ??
    get_Children()->m_items.clear();
//	ASSERT(0);
#if 0
    for (int i = get_rchildList()->get_Size()-1; i >= 0; i--)
    {
        RemoveRChild((*get_rchildList())[i]);
    }
#endif
    InvalidateMeasure();
}