wxTreeCtrl::Delete() bug corrected, sample expanded to test it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
int image, int selImage,
|
||||
wxTreeItemData *data );
|
||||
|
||||
inline ~wxGenericTreeItem();
|
||||
~wxGenericTreeItem();
|
||||
|
||||
// trivial accessors
|
||||
wxArrayTreeItems& GetChildren() { return m_children; }
|
||||
@@ -688,6 +688,12 @@ wxTreeItemId wxTreeCtrl::AppendItem(const wxTreeItemId& parentId,
|
||||
void wxTreeCtrl::Delete(const wxTreeItemId& itemId)
|
||||
{
|
||||
wxGenericTreeItem *item = itemId.m_pItem;
|
||||
wxGenericTreeItem *parent = item->GetParent();
|
||||
|
||||
if ( parent )
|
||||
{
|
||||
parent->GetChildren().Remove(item);
|
||||
}
|
||||
|
||||
delete item;
|
||||
|
||||
|
Reference in New Issue
Block a user