X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd9811b13784a58dd58126bc4b7d5f4c195839b2..97d3f0eee61fc8fcae7232d41fe97d467c4a5bc8:/include/wx/generic/treectrl.h diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h index 92a3cc5dbb..9e8bf4ed5c 100644 --- a/include/wx/generic/treectrl.h +++ b/include/wx/generic/treectrl.h @@ -179,10 +179,16 @@ 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, +#if wxUSE_VALIDATORS +# if defined(__VISAGECPP__) + int style = 0, const wxValidator* validator = wxDefaultValidator, +# else int style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "wxTreeTextCtrlText" ); +# endif +#endif + const wxString &name = wxTextCtrlNameStr ); void OnChar( wxKeyEvent &event ); void OnKillFocus( wxFocusEvent &event ); @@ -204,7 +210,13 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, +#if wxUSE_VALIDATORS +# if defined(__VISAGECPP__) + const wxValidator *validator = wxDefaultValidator, +# else const wxValidator &validator = wxDefaultValidator, +# endif +#endif const wxString& name = wxTreeCtrlNameStr) { Create(parent, id, pos, size, style, validator, name); @@ -216,7 +228,13 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, +#if wxUSE_VALIDATORS +# if defined(__VISAGECPP__) + const wxValidator *validator = wxDefaultValidator, +# else const wxValidator &validator = wxDefaultValidator, +# endif +#endif const wxString& name = wxTreeCtrlNameStr); // accessors @@ -258,10 +276,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 +287,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 +449,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 ); @@ -453,6 +479,9 @@ protected: friend class wxTreeRenameTimer; friend class wxTreeTextCtrl; + wxFont m_normalFont; + wxFont m_boldFont; + wxGenericTreeItem *m_anchor; wxGenericTreeItem *m_current, *m_key_current, *m_currentEdit; bool m_hasFocus;