fix order of initializiton of rootless treectrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1201,6 +1201,11 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
|
|||||||
|
|
||||||
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text,
|
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text,
|
||||||
image, selImage, data);
|
image, selImage, data);
|
||||||
|
if ( data != NULL )
|
||||||
|
{
|
||||||
|
data->m_pItem = (long) m_anchor;
|
||||||
|
}
|
||||||
|
|
||||||
if (HasFlag(wxTR_HIDE_ROOT))
|
if (HasFlag(wxTR_HIDE_ROOT))
|
||||||
{
|
{
|
||||||
// if root is hidden, make sure we can navigate
|
// if root is hidden, make sure we can navigate
|
||||||
@@ -1208,10 +1213,6 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
|
|||||||
m_anchor->SetHasPlus();
|
m_anchor->SetHasPlus();
|
||||||
Expand(m_anchor);
|
Expand(m_anchor);
|
||||||
}
|
}
|
||||||
if ( data != NULL )
|
|
||||||
{
|
|
||||||
data->m_pItem = (long) m_anchor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!HasFlag(wxTR_MULTIPLE))
|
if (!HasFlag(wxTR_MULTIPLE))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user