X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e4df4bfaf214faac6d4c7519f4aab5b8c7fd287..bf7d7ee7062f7f6028df40e43745235658e38b4d:/include/wx/treebase.h diff --git a/include/wx/treebase.h b/include/wx/treebase.h index 74dfe87157..8d62734468 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -20,16 +20,16 @@ // 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() @@ -37,14 +37,17 @@ typedef unsigned long wxTreeItemIdValue; 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 @@ -52,14 +55,8 @@ public: 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; }; @@ -146,7 +143,7 @@ static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON | 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 @@ -304,9 +301,8 @@ END_DECLARE_EVENT_TYPES() #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_ -