// headers
// ----------------------------------------------------------------------------
-// Not defined in setup.h so removing for now
-// #if wxUSE_TREECTRL
+#if wxUSE_TREECTRL
#include "wx/control.h"
#include "wx/event.h"
// ----------------------------------------------------------------------------
// wxTreeItemId identifies an element of the tree. In this implementation, it's
-// just a trivial wrapper around Win32 HTREEITEM. It's opaque for the
-// application.
+// just a trivial wrapper around Win32 HTREEITEM or a pointer to some private
+// data structure in the generic version. It's opaque for the application and
+// the only method which can be used by user code is IsOk().
// ----------------------------------------------------------------------------
// Using this typedef removes an ambiguity when calling Remove()
class WXDLLEXPORT wxTreeItemId
{
-friend class WXDLLEXPORT wxTreeCtrl;
-friend class WXDLLEXPORT wxGenericTreeCtrl;
-friend class WXDLLEXPORT wxTreeEvent;
public:
// ctors
// 0 is invalid value for HTREEITEM
wxTreeItemId() { m_pItem = 0; }
+ // this one is used in the generic version
+ wxTreeItemId(void *pItem) { m_pItem = (long) pItem; }
+
+ // and this one under MSW
+ wxTreeItemId(long lItem) { m_pItem = lItem; }
+
// default copy ctor/assignment operator are ok for us
// accessors
bool IsOk() const { return m_pItem != 0; }
// deprecated: only for compatibility
- wxTreeItemId(long itemId) { m_pItem = itemId; }
- //operator long() const { return m_pItem; }
operator wxTreeItemIdValue() const { return m_pItem; }
- void operator=(long item) { m_pItem = item; }
-
- wxTreeItemId(void *pItem) { m_pItem = (long) pItem; }
-
wxTreeItemIdValue m_pItem;
};
wxTREE_HITTEST_ONITEMLABEL;
// tree ctrl default name
-WXDLLEXPORT_DATA(extern const char*) wxTreeCtrlNameStr;
+WXDLLEXPORT_DATA(extern const wxChar*) wxTreeCtrlNameStr;
// ----------------------------------------------------------------------------
// wxTreeItemAttr: a structure containing the visual attributes of an item
#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL ),
#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL ),
-// #endif // wxUSE_TREECTRL
+#endif // wxUSE_TREECTRL
#endif
// _WX_TREEBASE_H_
-