X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/371a5b4e62eb415107e045588f614fa49e866e78..cbeda384e51acb82e13994cb67ac1714669cae10:/include/wx/os2/treectrl.h diff --git a/include/wx/os2/treectrl.h b/include/wx/os2/treectrl.h index 232242348f..4a99d302bf 100644 --- a/include/wx/os2/treectrl.h +++ b/include/wx/os2/treectrl.h @@ -16,46 +16,39 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma interface "treectrl.h" -#endif - #if wxUSE_TREECTRL #include "wx/textctrl.h" #include "wx/dynarray.h" #include "wx/treebase.h" +#include "wx/hashmap.h" // the type for "untyped" data typedef long wxDataType; // fwd decl -class WXDLLEXPORT wxImageList; -class WXDLLEXPORT wxDragImage; -struct WXDLLEXPORT wxTreeViewItem; +class WXDLLIMPEXP_CORE wxImageList; +class WXDLLIMPEXP_CORE wxDragImage; +struct WXDLLIMPEXP_FWD_CORE wxTreeViewItem; // a callback function used for sorting tree items, it should return -1 if the // first item precedes the second, +1 if the second precedes the first or 0 if // they're equivalent class wxTreeItemData; -// flags for deprecated `Expand(int action)' -enum -{ - wxTREE_EXPAND_EXPAND, - wxTREE_EXPAND_COLLAPSE, - wxTREE_EXPAND_COLLAPSE_RESET, - wxTREE_EXPAND_TOGGLE -}; +#if WXWIN_COMPATIBILITY_2_6 + // flags for deprecated InsertItem() variant + #define wxTREE_INSERT_FIRST 0xFFFF0001 + #define wxTREE_INSERT_LAST 0xFFFF0002 +#endif -// flags for deprecated InsertItem() variant -#define wxTREE_INSERT_FIRST 0xFFFF0001 -#define wxTREE_INSERT_LAST 0xFFFF0002 +// hash storing attributes for our items +WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr); // ---------------------------------------------------------------------------- // wxTreeCtrl // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTreeCtrl : public wxControl +class WXDLLIMPEXP_CORE wxTreeCtrl : public wxControl { public: // creation @@ -63,7 +56,7 @@ public: wxTreeCtrl() { Init(); } wxTreeCtrl( wxWindow* pParent - ,wxWindowID vId = -1 + ,wxWindowID vId = wxID_ANY ,const wxPoint& rPos = wxDefaultPosition ,const wxSize& rSize = wxDefaultSize ,long lStyle = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT @@ -83,7 +76,7 @@ public: virtual ~wxTreeCtrl(); bool Create( wxWindow* pParent - ,wxWindowID vId = -1 + ,wxWindowID vId = wxID_ANY ,const wxPoint& rPos = wxDefaultPosition ,const wxSize& rSize = wxDefaultSize ,long lStyle = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT @@ -99,7 +92,7 @@ public: // // Get the total number of items in the control // - size_t GetCount(void) const; + virtual unsigned int GetCount(void) const; // // Indent is the number of pixels the children are indented relative to @@ -197,21 +190,21 @@ public: // usage and loading time. // void SetItemHasChildren( const wxTreeItemId& rItem - ,bool bHas = TRUE + ,bool bHas = true ); // // The item will be shown in bold // void SetItemBold( const wxTreeItemId& rItem - ,bool bBold = TRUE + ,bool bBold = true ); // // The item will be shown with a drop highlight // void SetItemDropHighlight( const wxTreeItemId& rItem - ,bool bHighlight = TRUE + ,bool bHighlight = true ); // @@ -250,11 +243,11 @@ public: // // - // If 'recursively' is FALSE, only immediate children count, otherwise + // If 'bRecursively' is false, only immediate children count, otherwise // the returned number is the number of all items in this branch // size_t GetChildrenCount( const wxTreeItemId& rItem - ,bool bRecursively = TRUE + ,bool bRecursively = true ) const; // @@ -282,37 +275,19 @@ public: // wxTreeItemId GetItemParent(const wxTreeItemId& rItem) const; -#if WXWIN_COMPATIBILITY_2_2 - // deprecated: Use GetItemParent instead. - wxTreeItemId GetParent(const wxTreeItemId& rItem) const - { return GetItemParent(rItem); } + // for this enumeration function you must pass in a "cookie" parameter + // which is opaque for the application but is necessary for the library + // to make these functions reentrant (i.e. allow more than one + // enumeration on one and the same object simultaneously). Of course, + // the "cookie" passed to GetFirstChild() and GetNextChild() should be + // the same! - // Expose the base class method hidden by the one above. - wxWindow* GetParent(void) const { return wxControl::GetParent(); } -#endif // WXWIN_COMPATIBILITY_2_2 - - // - // For this enumeration function you must pass in a "cookie" parameter - // which is opaque for the application but is necessary for the library - // to make these functions reentrant (i.e. allow more than one - // enumeration on one and the same object simultaneously). Of course, - // the "cookie" passed to GetFirstChild() and GetNextChild() should be - // the same! - // - - // - // Get the first child of this item - // - wxTreeItemId GetFirstChild( const wxTreeItemId& rItem - ,long& rCookie - ) const; - - // - // Get the next child - // - wxTreeItemId GetNextChild( const wxTreeItemId& rItem - ,long& rCookie - ) const; + // get the first child of this item + wxTreeItemId GetFirstChild(const wxTreeItemId& item, + wxTreeItemIdValue& cookie) const; + // get the next child + wxTreeItemId GetNextChild(const wxTreeItemId& item, + wxTreeItemIdValue& cookie) const; // // Get the last child of this item - this method doesn't use cookies @@ -473,13 +448,13 @@ public: // // returns NULL for OS/2 in ALL cases // - wxTextCtrl* GetEditControl(void) const {return (wxTextCtrl*)NULL;} + wxTextCtrl* GetEditControl(void) const {return NULL;} // // End editing and accept or discard the changes to item label // void EndEditLabel( const wxTreeItemId& rItem - ,bool bDiscardChanges = FALSE + ,bool bDiscardChanges = false ); // @@ -528,52 +503,9 @@ public: // bool GetBoundingRect( const wxTreeItemId& rItem ,wxRect& rRect - ,bool bTextOnly = FALSE + ,bool bTextOnly = false ) const; - // - // Deprecated - // ---------- - // - // These methods are deprecated and will be removed in future versions of - // wxWindows, they're here for compatibility only, don't use them in new - // code (the comments indicate why these methods are now useless and how to - // replace them) - // - - // - // Use Expand, Collapse, CollapseAndReset or Toggle - // - void ExpandItem( const wxTreeItemId& rItem - ,int nAction - ); - - // - // Use AddRoot, PrependItem or AppendItem - // - wxTreeItemId InsertItem( const wxTreeItemId& pParent - ,const wxString& rsText - ,int nImage = -1 - ,int nSelImage = -1 - ,long lInsertAfter = wxTREE_INSERT_LAST - ); - - // - // Use Set/GetImageList and Set/GetStateImageList - // - wxImageList* GetImageList(int nVal) const - { return GetImageList(); } - void SetImageList(wxImageList* pImageList, int nVal) - { SetImageList(pImageList); } - - // - // Use Set/GetItemImage directly - // - int GetItemSelectedImage(const wxTreeItemId& rItem) const - { return GetItemImage(rItem, wxTreeItemIcon_Selected); } - void SetItemSelectedImage(const wxTreeItemId& rItem, int nImage) - { SetItemImage(rItem, nImage, wxTreeItemIcon_Selected); } - // // Implementation // -------------- @@ -599,7 +531,7 @@ public: // bool IsItemChecked(const wxTreeItemId& rItem) const; void SetItemCheck( const wxTreeItemId& rItem - ,bool bCheck = TRUE + ,bool bCheck = true ); protected: @@ -670,10 +602,10 @@ private: // // The hash storing the items attributes (indexed by items ids) // - wxHashTable m_vAttrs; + wxMapTreeAttr m_vAttrs; // - // TRUE if the hash above is not empty + // true if the hash above is not empty // bool m_bHasAnyAttr; @@ -692,7 +624,7 @@ private: friend class wxTreeSortHelper; DECLARE_DYNAMIC_CLASS(wxTreeCtrl) - DECLARE_NO_COPY_CLASS(wxTreeCtrl) + wxDECLARE_NO_COPY_CLASS(wxTreeCtrl); }; // end of CLASS wxTreeCtrl #endif // wxUSE_TREECTRL