// status inquiries
bool HasChildren() const { return !m_children.IsEmpty(); }
- bool IsSelected() const { return m_hasHilight; }
+ bool IsSelected() const { return m_hasHilight != 0; }
bool IsExpanded() const { return !m_isCollapsed; }
bool HasPlus() const { return m_hasPlus || HasChildren(); }
- bool IsBold() const { return m_isBold; }
+ bool IsBold() const { return m_isBold != 0; }
// attributes
// get them - may be NULL
m_imageListNormal =
m_imageListState = (wxImageList *) NULL;
+ m_ownsImageListNormal =
+ m_ownsImageListState = FALSE;
m_dragCount = 0;
m_isDragging = FALSE;
DeleteAllItems();
delete m_renameTimer;
+ if (m_ownsImageListNormal) delete m_imageListNormal;
+ if (m_ownsImageListState) delete m_imageListState;
}
// -----------------------------------------------------------------------------
void wxGenericTreeCtrl::SetImageList(wxImageList *imageList)
{
+ if (m_ownsImageListNormal) delete m_imageListNormal;
+
m_imageListNormal = imageList;
+ m_ownsImageListNormal = FALSE;
if ( !m_imageListNormal )
return;
void wxGenericTreeCtrl::SetStateImageList(wxImageList *imageList)
{
+ if (m_ownsImageListState) delete m_imageListState;
m_imageListState = imageList;
+ m_ownsImageListState = FALSE;
+}
+
+void wxGenericTreeCtrl::AssignImageList(wxImageList *imageList)
+{
+ SetImageList(imageList);
+ m_ownsImageListNormal = TRUE;
+}
+
+void wxGenericTreeCtrl::AssignStateImageList(wxImageList *imageList)
+{
+ SetStateImageList(imageList);
+ m_ownsImageListState = TRUE;
}
// -----------------------------------------------------------------------------