X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..fe161a2685012cf90bb5bfe95f2260aee71d8ad7:/include/wx/msw/treectrl.h diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 1edc6ce0cb..a7713503b8 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TREECTRL_H_ @@ -69,7 +69,7 @@ public: // -------- wxTreeCtrl() { Init(); } - wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, + wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, @@ -81,7 +81,7 @@ public: virtual ~wxTreeCtrl(); - bool Create(wxWindow *parent, wxWindowID id = -1, + bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, @@ -163,13 +163,13 @@ public: // allow the user to expand the items which don't have any children now // - but instead add them only when needed, thus minimizing memory // usage and loading time. - void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE); + void SetItemHasChildren(const wxTreeItemId& item, bool has = true); // the item will be shown in bold - void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); + void SetItemBold(const wxTreeItemId& item, bool bold = true); // the item will be shown with a drop highlight - void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE); + void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true); // set the items text colour void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); @@ -197,15 +197,15 @@ public: // number of children // ------------------ - // if 'recursively' is FALSE, only immediate children count, otherwise + // if 'recursively' is false, only immediate children count, otherwise // the returned number is the number of all items in this branch size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = TRUE) const; + bool recursively = true) const; // navigation // ---------- - // wxTreeItemId.IsOk() will return FALSE if there is no such item + // wxTreeItemId.IsOk() will return false if there is no such item // get the root tree item wxTreeItemId GetRootItem() const; @@ -225,9 +225,9 @@ public: #if WXWIN_COMPATIBILITY_2_2 // deprecated: Use GetItemParent instead. wxTreeItemId GetParent(const wxTreeItemId& item) const - { return GetItemParent( item ); } + { return GetItemParent( item ); } - // Expose the base class method hidden by the one above. + // Expose the base class method hidden by the one above. wxWindow *GetParent() const { return wxControl::GetParent(); } #endif // WXWIN_COMPATIBILITY_2_2 @@ -340,7 +340,7 @@ public: // edited simultaneously) wxTextCtrl* GetEditControl() const; // end editing and accept or discard the changes to item label - void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE); + void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false); // sorting // this function is called to compare 2 items and should return -1, 0 @@ -371,7 +371,7 @@ public: // get the bounding rectangle of the item (or of its label only) bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, - bool textOnly = FALSE) const; + bool textOnly = false) const; // deprecated // ---------- @@ -433,7 +433,7 @@ public: // get/set the check state for the item (only for wxTR_MULTIPLE) bool IsItemChecked(const wxTreeItemId& item) const; - void SetItemCheck(const wxTreeItemId& item, bool check = TRUE); + void SetItemCheck(const wxTreeItemId& item, bool check = true); // set/get the item state.image (state == -1 means cycle to the next one) void SetState(const wxTreeItemId& node, int state); @@ -446,10 +446,14 @@ protected: // refresh a single item void RefreshItem(const wxTreeItemId& item); - wxTextCtrl *m_textCtrl; // used while editing the item label + // data used only while editing the item label: + wxTextCtrl *m_textCtrl; // text control in which it is edited + wxTreeItemId m_idEdited; // the item being edited + wxImageList *m_imageListNormal, // images for tree elements *m_imageListState; // special images for app defined states - bool m_ownsImageListNormal, m_ownsImageListState; + bool m_ownsImageListNormal, + m_ownsImageListState; private: // the common part of all ctors @@ -487,7 +491,7 @@ private: // the hash storing the items attributes (indexed by item ids) wxMapTreeAttr m_attrs; - // TRUE if the hash above is not empty + // true if the hash above is not empty bool m_hasAnyAttr; // used for dragging