X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd9811b13784a58dd58126bc4b7d5f4c195839b2..21802234dfc226c369e7d48af58e6c1b7f7242a3:/include/wx/generic/treectrl.h diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h index 92a3cc5dbb..00c139de9b 100644 --- a/include/wx/generic/treectrl.h +++ b/include/wx/generic/treectrl.h @@ -179,10 +179,10 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl wxTreeTextCtrl(void) {}; wxTreeTextCtrl( wxWindow *parent, const wxWindowID id, bool *accept, wxString *res, wxTreeCtrl *owner, - const wxString &value = "", + const wxString &value = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, int style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "wxTreeTextCtrlText" ); + const wxString &name = wxTextCtrlNameStr ); void OnChar( wxKeyEvent &event ); void OnKillFocus( wxFocusEvent &event ); @@ -258,10 +258,9 @@ public: // retrieve items label wxString GetItemText(const wxTreeItemId& item) const; - // get the normal item image - int GetItemImage(const wxTreeItemId& item) const; - // get the selected item image - int GetItemSelectedImage(const wxTreeItemId& item) const; + // get one of the images associated with the item (normal by default) + int GetItemImage(const wxTreeItemId& item, + wxTreeItemIcon which = wxTreeItemIcon_Normal) const; // get the data associated with the item wxTreeItemData *GetItemData(const wxTreeItemId& item) const; @@ -270,10 +269,9 @@ public: // set items label void SetItemText(const wxTreeItemId& item, const wxString& text); - // set the normal item image - void SetItemImage(const wxTreeItemId& item, int image); - // set the selected item image - void SetItemSelectedImage(const wxTreeItemId& item, int image); + // get one of the images associated with the item (normal by default) + void SetItemImage(const wxTreeItemId& item, int image, + wxTreeItemIcon which = wxTreeItemIcon_Normal); // associate some data with the item void SetItemData(const wxTreeItemId& item, wxTreeItemData *data); @@ -433,6 +431,16 @@ public: // NB: this function is not reentrant and not MT-safe (FIXME)! void SortChildren(const wxTreeItemId& item); + // deprecated functions: use Set/GetItemImage directly + // get the selected item image + int GetItemSelectedImage(const wxTreeItemId& item) const + { return GetItemImage(item, wxTreeItemIcon_Selected); } + // set the selected item image + void SetItemSelectedImage(const wxTreeItemId& item, int image) + { SetItemImage(item, image, wxTreeItemIcon_Selected); } + + // implementation + // callbacks void OnPaint( wxPaintEvent &event ); void OnSetFocus( wxFocusEvent &event );