Allow marking wxTreeBook nodes to expand initially in XRC.

Add new "expanded" attribute for XRC nodes of treebookpage class.

Also update the sample and the XRC format documentation.

Closes #13355.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-07-21 13:50:03 +00:00
parent fb4faeb5de
commit 2b232decc5
4 changed files with 35 additions and 0 deletions

View File

@@ -76,6 +76,24 @@ wxObject *wxTreebookXmlHandler::DoCreateResource()
CreateChildren(m_tbk, true/*only this handler*/);
wxXmlNode *node = GetParamNode("object");
int pageIndex = 0;
for (unsigned int i = 0; i < m_tbk->GetPageCount(); i++)
{
if ( m_tbk->GetPage(i) )
{
wxXmlNode *child = node->GetChildren();
while (child)
{
if (child->GetName() == "expanded" && child->GetNodeContent() == "1")
m_tbk->ExpandNode(pageIndex, true);
child = child->GetNext();
}
pageIndex++;
}
}
m_treeContext = old_treeContext;
m_isInside = old_ins;
m_tbk = old_par;