don't allow multiple root in the tree

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-03-09 16:19:35 +00:00
parent 6b10575493
commit 0e93516996

View File

@@ -1198,6 +1198,10 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent,
int image, int selectedImage,
wxTreeItemData *data)
{
wxCHECK_MSG( parent.IsOk() || !TreeView_GetRoot(GetHwnd()),
wxTreeItemId(),
_T("can't have more than one root in the tree") );
TV_INSERTSTRUCT tvIns;
tvIns.hParent = HITEM(parent);
tvIns.hInsertAfter = HITEM(hInsertAfter);