// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __TREECTRLH__
-#define __TREECTRLH__
+#ifndef _WX_TREECTRL_H_
+#define _WX_TREECTRL_H_
#ifdef __GNUG__
#pragma interface "treectrl.h"
};
// Flags for InsertItem
-enum {
- wxTREE_INSERT_LAST = -1,
- wxTREE_INSERT_FIRST = -2,
- wxTREE_INSERT_SORT = -3
-};
+#define wxTREE_INSERT_FIRST 0xFFFF0001
+#define wxTREE_INSERT_LAST 0xFFFF0002
+#define wxTREE_INSERT_SORT 0xFFFF0003
class WXDLLEXPORT wxTreeItem: public wxObject
{
// bounding rect
bool GetItemRect(long item, wxRectangle& rect, bool textOnly = FALSE) const;
//
- wxTextCtrl& GetEditControl() const;
+ wxTextCtrl* GetEditControl() const;
// operations
// ----------
bool SelectItem(long item);
bool ScrollTo(long item);
bool DeleteAllItems();
- wxTextCtrl& Edit(long item);
+
+ // Edit the label (tree must have the focus)
+ wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
+
+ // End label editing, optionally cancelling the edit
+ bool EndEditLabel(bool cancel);
+
long HitTest(const wxPoint& point, int& flags);
// wxImageList *CreateDragImage(long item);
bool SortChildren(long item);
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
protected:
- wxTextCtrl m_textCtrl;
- wxImageList *m_imageListNormal;
- wxImageList *m_imageListState;
+ wxTextCtrl* m_textCtrl;
+ wxImageList* m_imageListNormal;
+ wxImageList* m_imageListState;
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
};
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
#endif
- // __TREECTRLH__
+ // _WX_TREECTRL_H_