const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
// Additionally, the application might choose to show a state icon
// which corresponds to an app-defined item state (for example,
// checked/unchecked) which are taken from the state image list.
// Additionally, the application might choose to show a state icon
// which corresponds to an app-defined item state (for example,
// checked/unchecked) which are taken from the state image list.
- void SetImageList(wxImageList *imageList);
- void SetStateImageList(wxImageList *imageList);
- void AssignImageList(wxImageList *imageList);
- void AssignStateImageList(wxImageList *imageList);
+ virtual void SetImageList(wxImageList *imageList);
+ virtual void SetStateImageList(wxImageList *imageList);
+ virtual void AssignImageList(wxImageList *imageList);
+ virtual void AssignStateImageList(wxImageList *imageList);
// Functions to work with tree ctrl items. Unfortunately, they can _not_ be
// member functions of wxTreeItem because they must know the tree the item
// Functions to work with tree ctrl items. Unfortunately, they can _not_ be
// member functions of wxTreeItem because they must know the tree the item
// retrieve items label
wxString GetItemText(const wxTreeItemId& item) const;
// get one of the images associated with the item (normal by default)
// retrieve items label
wxString GetItemText(const wxTreeItemId& item) const;
// get one of the images associated with the item (normal by default)
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
// get the data associated with the item
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
// get the data associated with the item
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
// set items label
void SetItemText(const wxTreeItemId& item, const wxString& text);
// get one of the images associated with the item (normal by default)
// set items label
void SetItemText(const wxTreeItemId& item, const wxString& text);
// get one of the images associated with the item (normal by default)
wxTreeItemIcon which = wxTreeItemIcon_Normal);
// associate some data with the item
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
wxTreeItemIcon which = wxTreeItemIcon_Normal);
// associate some data with the item
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
// 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.
// 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.
// set the items text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
// set the items text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
// the returned number is the number of all items in this branch
size_t GetChildrenCount(const wxTreeItemId& item,
// the returned number is the number of all items in this branch
size_t GetChildrenCount(const wxTreeItemId& item,
#if WXWIN_COMPATIBILITY_2_2
// deprecated: Use GetItemParent instead.
wxTreeItemId GetParent(const wxTreeItemId& item) const
#if WXWIN_COMPATIBILITY_2_2
// deprecated: Use GetItemParent instead.
wxTreeItemId GetParent(const wxTreeItemId& item) const
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the first child of the parent
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the first child of the parent
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item after a given one
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item after a given one
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item before the one with the given index
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item before the one with the given index
size_t index,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the last child of the parent
size_t index,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the last child of the parent
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// edited simultaneously)
wxTextCtrl* GetEditControl() const;
// end editing and accept or discard the changes to item label
// edited simultaneously)
wxTextCtrl* GetEditControl() const;
// end editing and accept or discard the changes to item label
// get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
// get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
// get/set the check state for the item (only for wxTR_MULTIPLE)
bool IsItemChecked(const wxTreeItemId& item) const;
// get/set the check state for the item (only for wxTR_MULTIPLE)
bool IsItemChecked(const wxTreeItemId& item) const;
// set/get the item state.image (state == -1 means cycle to the next one)
void SetState(const wxTreeItemId& node, int state);
// set/get the item state.image (state == -1 means cycle to the next one)
void SetState(const wxTreeItemId& node, int state);
- 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
wxImageList *m_imageListNormal, // images for tree elements
*m_imageListState; // special images for app defined states