]> git.saurik.com Git - wxWidgets.git/commitdiff
don't allow multiple root in the tree
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Mar 2000 16:19:35 +0000 (16:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Mar 2000 16:19:35 +0000 (16:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index f231242b85621d56d0bcb08d7b7a534d1f3d4285..7f8403c58fdcb0f24556a7e94b39ca723c4ab908 100644 (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);