wxTreeItemId(long itemId) { m_pItem = (wxGenericTreeItem *)itemId; }
operator long() const { return (long)m_pItem; }
-//protected:
+//protected: // not for gcc
// for wxTreeCtrl usage only
wxTreeItemId(wxGenericTreeItem *pItem) { m_pItem = pItem; }
-
+
wxGenericTreeItem *m_pItem;
};
// -----------------------------------------------------------------------------
// wxTreeEvent - the event generated by the tree control
// -----------------------------------------------------------------------------
-class WXDLLEXPORT wxTreeEvent : public wxCommandEvent
+class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
{
friend class wxTreeCtrl;
public:
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-// GetItem() is the item being expanded/collapsed, the "ING" versions can use
+// GetItem() is the item being expanded/collapsed, the "ING" versions can use
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
// usage and loading time.
void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
+ // the item will be shown in bold
+ void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
+
// item status inquiries
// ---------------------
// is the item visible (it might be outside the view or not expanded)?
bool IsVisible(const wxTreeItemId& item) const;
// does the item has any children?
+ bool HasChildren(const wxTreeItemId& item) const
+ { return ItemHasChildren(item); }
bool ItemHasChildren(const wxTreeItemId& item) const;
// is the item expanded (only makes sense if HasChildren())?
bool IsExpanded(const wxTreeItemId& item) const;
// is this item currently selected (the same as has focus)?
bool IsSelected(const wxTreeItemId& item) const;
+ // is item text in bold font?
+ bool IsBold(const wxTreeItemId& item) const;
// number of children
// ------------------
wxTreeItemData *data);
void AdjustMyScrollbars();
- void PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
+ void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y );
+ void PaintItem( wxGenericTreeItem *item, wxDC& dc);
void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
void CalculatePositions();