X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..1338c59a025505bc066be220fe56e898a72b3ad3:/include/wx/msw/treectrl.h diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index f995392953..2d2e4ff563 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -5,8 +5,8 @@ // Modified by: Vadim Zeitlin to be less MSW-specific on 10/10/98 // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TREECTRL_H_ @@ -76,7 +76,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl") + const wxString& name = wxTreeCtrlNameStr) { Create(parent, id, pos, size, style, validator, name); } @@ -88,7 +88,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl"); + const wxString& name = wxTreeCtrlNameStr); // accessors // --------- @@ -141,6 +141,15 @@ public: // get the data associated with the item wxTreeItemData *GetItemData(const wxTreeItemId& item) const; + // get the item's text colour + wxColour GetItemTextColour(const wxTreeItemId& item) const; + + // get the item's background colour + wxColour GetItemBackgroundColour(const wxTreeItemId& item) const; + + // get the item's font + wxFont GetItemFont(const wxTreeItemId& item) const; + // modifiers // --------- @@ -213,7 +222,16 @@ public: size_t GetSelections(wxArrayTreeItemIds& selections) const; // get the parent of this item (may return NULL if root) - wxTreeItemId GetParent(const wxTreeItemId& item) const; + wxTreeItemId GetItemParent(const wxTreeItemId& item) const; + +#if WXWIN_COMPATIBILITY_2_2 + // deprecated: Use GetItemParent instead. + wxTreeItemId GetParent(const wxTreeItemId& item) const + { return GetItemParent( item ); } + + // Expose the base class method hidden by the one above. + wxWindow *GetParent() 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 @@ -400,6 +418,9 @@ protected: // SetImageList helper void SetAnyImageList(wxImageList *imageList, int which); + // refresh a single item + void RefreshItem(const wxTreeItemId& item); + wxTextCtrl *m_textCtrl; // used while editing the item label wxImageList *m_imageListNormal, // images for tree elements *m_imageListState; // special images for app defined states @@ -430,14 +451,13 @@ private: void DeleteTextCtrl(); - // support for additional item images - friend class wxTreeItemIndirectData; + // support for additional item images which we implement using + // wxTreeItemIndirectData technique - see the comments in msw/treectrl.cpp void SetIndirectItemData(const wxTreeItemId& item, - wxTreeItemIndirectData *data); + class wxTreeItemIndirectData *data); bool HasIndirectData(const wxTreeItemId& item) const; - - // the array storing all item ids which have indirect data - wxArrayTreeItemIds m_itemsWithIndirectData; + bool IsDataIndirect(wxTreeItemData *data) const + { return data && data->GetId().m_pItem == 0; } // the hash storing the items attributes (indexed by items ids) wxHashTable m_attrs; @@ -448,10 +468,17 @@ private: // used for dragging wxDragImage *m_dragImage; + // Virtual root item, if wxTR_HIDE_ROOT is set. + void* m_pVirtualRoot; + // the starting item for selection with Shift WXHTREEITEM m_htSelStart; + friend class wxTreeItemIndirectData; + friend class wxTreeSortHelper; + DECLARE_DYNAMIC_CLASS(wxTreeCtrl) + DECLARE_NO_COPY_CLASS(wxTreeCtrl) }; #endif // wxUSE_TREECTRL