Line-up deprecated interface of wxTreeCtrl between ports.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -571,19 +571,6 @@ Returns the next visible item.
|
|||||||
Returns the item's parent.
|
Returns the item's parent.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxTreeCtrl::GetParent}\label{wxtreectrlgetparent}
|
|
||||||
|
|
||||||
\constfunc{wxTreeItemId}{GetParent}{\param{const wxTreeItemId\&}{ item}}
|
|
||||||
|
|
||||||
{\bf NOTE:} This function is deprecated and will only work if {\tt WXWIN\_COMPATIBILITY\_2\_2}
|
|
||||||
is defined. Use \helpref{wxTreeCtrl::GetItemParent}{wxtreectrlgetitemparent} instead.
|
|
||||||
|
|
||||||
Returns the item's parent.
|
|
||||||
|
|
||||||
\pythonnote{This method is named {\tt GetItemParent} to avoid a name
|
|
||||||
clash with wxWindow::GetParent.}
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxTreeCtrl::GetPrevSibling}\label{wxtreectrlgetprevsibling}
|
\membersection{wxTreeCtrl::GetPrevSibling}\label{wxtreectrlgetprevsibling}
|
||||||
|
|
||||||
\constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}}
|
\constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}}
|
||||||
|
@@ -377,4 +377,3 @@ public:
|
|||||||
#endif // wxUSE_TREECTRL
|
#endif // wxUSE_TREECTRL
|
||||||
|
|
||||||
#endif // _GENERIC_TREECTRL_H_
|
#endif // _GENERIC_TREECTRL_H_
|
||||||
|
|
||||||
|
@@ -63,12 +63,13 @@ static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
|
|||||||
wxTREE_HITTEST_ONITEMLABEL |
|
wxTREE_HITTEST_ONITEMLABEL |
|
||||||
wxTREE_HITTEST_ONITEMSTATEICON;
|
wxTREE_HITTEST_ONITEMSTATEICON;
|
||||||
|
|
||||||
// NB: all the following flags are for compatbility only and will be removed in
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// next versions
|
// NB: all the following flags are for compatbility only and will be removed in
|
||||||
|
// next versions
|
||||||
// flags for deprecated InsertItem() variant
|
// flags for deprecated InsertItem() variant
|
||||||
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
||||||
#define wxTREE_INSERT_LAST 0xFFFF0002
|
#define wxTREE_INSERT_LAST 0xFFFF0002
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
||||||
@@ -126,22 +127,24 @@ public:
|
|||||||
const wxTreeItemId& GetId() const { return (wxTreeItemId&) m_itemId; }
|
const wxTreeItemId& GetId() const { return (wxTreeItemId&) m_itemId; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxTreeCtrl: public wxControl {
|
class WXDLLEXPORT wxTreeCtrl: public wxControl
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
// creation
|
// creation
|
||||||
// --------
|
// --------
|
||||||
wxTreeCtrl() { Init(); }
|
wxTreeCtrl() { Init(); }
|
||||||
|
|
||||||
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = "wxTreeCtrl") {
|
const wxString& name = "wxTreeCtrl")
|
||||||
Create(parent, id, pos, size, style, validator, name);
|
{
|
||||||
}
|
Create(parent, id, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~wxTreeCtrl();
|
virtual ~wxTreeCtrl();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
@@ -190,8 +193,6 @@ public:
|
|||||||
wxString GetItemText(const wxTreeItemId& item) const;
|
wxString GetItemText(const wxTreeItemId& item) const;
|
||||||
// get the normal item image
|
// get the normal item image
|
||||||
int GetItemImage(const wxTreeItemId& item) const;
|
int GetItemImage(const wxTreeItemId& item) const;
|
||||||
// get the selected item image
|
|
||||||
int GetItemSelectedImage(const wxTreeItemId& item) const;
|
|
||||||
// get the data associated with the item
|
// get the data associated with the item
|
||||||
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
||||||
|
|
||||||
@@ -202,8 +203,6 @@ public:
|
|||||||
void SetItemText(const wxTreeItemId& item, const wxString& text);
|
void SetItemText(const wxTreeItemId& item, const wxString& text);
|
||||||
// set the normal item image
|
// set the normal item image
|
||||||
void SetItemImage(const wxTreeItemId& item, int image);
|
void SetItemImage(const wxTreeItemId& item, int image);
|
||||||
// set the selected item image
|
|
||||||
void SetItemSelectedImage(const wxTreeItemId& item, int image);
|
|
||||||
// associate some data with the item
|
// associate some data with the item
|
||||||
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
||||||
|
|
||||||
@@ -247,10 +246,6 @@ public:
|
|||||||
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
||||||
// the same!
|
// the same!
|
||||||
|
|
||||||
// get the first child of this item
|
|
||||||
wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
|
|
||||||
// get the next child (after GetFirstChild or GetNextChild)
|
|
||||||
wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
|
|
||||||
// get the last child of this item - this method doesn't use cookies
|
// get the last child of this item - this method doesn't use cookies
|
||||||
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
||||||
|
|
||||||
@@ -342,55 +337,71 @@ public:
|
|||||||
// deprecated
|
// deprecated
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// these methods are deprecated and will be removed in future versions of
|
// these methods are deprecated and will be removed in future versions of
|
||||||
// wxWidgets, they're here for compatibility only, don't use them in new
|
// wxWidgets, they're here for compatibility only, don't use them in new
|
||||||
// code (the comments indicate why these methods are now useless and how to
|
// code (the comments indicate why these methods are now useless and how to
|
||||||
// replace them)
|
// replace them)
|
||||||
|
|
||||||
// use Expand, Collapse, CollapseAndReset or Toggle
|
// use Expand, Collapse, CollapseAndReset or Toggle
|
||||||
void ExpandItem(const wxTreeItemId& item, int action);
|
wxDEPRECATED( void ExpandItem(const wxTreeItemId& item, int action) );
|
||||||
|
|
||||||
|
// use SetImageList
|
||||||
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int) )
|
||||||
|
{ SetImageList(imageList); }
|
||||||
|
|
||||||
|
// use Set/GetItemImage directly
|
||||||
|
wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
|
||||||
|
wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
|
||||||
|
|
||||||
|
// use the versions taking wxTreeItemIdValue cookies
|
||||||
|
wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item,
|
||||||
|
long& cookie) const );
|
||||||
|
wxDEPRECATED( wxTreeItemId GetNextChild(const wxTreeItemId& item,
|
||||||
|
long& cookie) const );
|
||||||
// use AddRoot, PrependItem or AppendItem
|
// use AddRoot, PrependItem or AppendItem
|
||||||
wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
wxDEPRECATED( wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
int image = -1, int selImage = -1,
|
int image = -1, int selImage = -1,
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
// use Set/GetImageList and Set/GetStateImageList
|
// use Set/GetImageList and Set/GetStateImageList
|
||||||
wxImageList *GetImageList(int) const
|
wxImageList *GetImageList(int) const
|
||||||
{ return GetImageList(); }
|
{ return GetImageList(); }
|
||||||
void SetImageList(wxImageList *imageList, int)
|
|
||||||
{ SetImageList(imageList); }
|
|
||||||
|
|
||||||
void SendExpanding(const wxTreeItemId& item);
|
void SendExpanding(const wxTreeItemId& item);
|
||||||
void SendExpanded(const wxTreeItemId& item);
|
void SendExpanded(const wxTreeItemId& item);
|
||||||
void SendCollapsing(const wxTreeItemId& item);
|
void SendCollapsing(const wxTreeItemId& item);
|
||||||
void SendCollapsed(const wxTreeItemId& item);
|
void SendCollapsed(const wxTreeItemId& item);
|
||||||
void SendSelChanging(const wxTreeItemId& item);
|
void SendSelChanging(const wxTreeItemId& item);
|
||||||
void SendSelChanged(const wxTreeItemId& item);
|
void SendSelChanged(const wxTreeItemId& item);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxTreeItemId m_editItem;
|
|
||||||
GtkTree *m_tree;
|
|
||||||
GtkTreeItem *m_anchor;
|
|
||||||
wxTextCtrl* m_textCtrl;
|
|
||||||
wxImageList* m_imageListNormal;
|
|
||||||
wxImageList* m_imageListState;
|
|
||||||
|
|
||||||
long m_curitemId;
|
wxTreeItemId m_editItem;
|
||||||
|
GtkTree *m_tree;
|
||||||
|
GtkTreeItem *m_anchor;
|
||||||
|
wxTextCtrl* m_textCtrl;
|
||||||
|
wxImageList* m_imageListNormal;
|
||||||
|
wxImageList* m_imageListState;
|
||||||
|
|
||||||
void SendMessage(wxEventType command, const wxTreeItemId& item);
|
long m_curitemId;
|
||||||
|
|
||||||
|
void SendMessage(wxEventType command, const wxTreeItemId& item);
|
||||||
// GtkTreeItem *findGtkTreeItem(wxTreeCtrlId &id) const;
|
// GtkTreeItem *findGtkTreeItem(wxTreeCtrlId &id) const;
|
||||||
|
|
||||||
// the common part of all ctors
|
// the common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
// insert a new item in as the last child of the parent
|
// insert a new item in as the last child of the parent
|
||||||
wxTreeItemId p_InsertItem(GtkTreeItem *p,
|
wxTreeItemId p_InsertItem(GtkTreeItem *p,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
int image, int selectedImage,
|
int image, int selectedImage,
|
||||||
wxTreeItemData *data);
|
wxTreeItemData *data);
|
||||||
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -63,12 +63,13 @@ static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
|
|||||||
wxTREE_HITTEST_ONITEMLABEL |
|
wxTREE_HITTEST_ONITEMLABEL |
|
||||||
wxTREE_HITTEST_ONITEMSTATEICON;
|
wxTREE_HITTEST_ONITEMSTATEICON;
|
||||||
|
|
||||||
// NB: all the following flags are for compatbility only and will be removed in
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// next versions
|
// NB: all the following flags are for compatbility only and will be removed in
|
||||||
|
// next versions
|
||||||
// flags for deprecated InsertItem() variant
|
// flags for deprecated InsertItem() variant
|
||||||
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
||||||
#define wxTREE_INSERT_LAST 0xFFFF0002
|
#define wxTREE_INSERT_LAST 0xFFFF0002
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
||||||
@@ -190,8 +191,6 @@ public:
|
|||||||
wxString GetItemText(const wxTreeItemId& item) const;
|
wxString GetItemText(const wxTreeItemId& item) const;
|
||||||
// get the normal item image
|
// get the normal item image
|
||||||
int GetItemImage(const wxTreeItemId& item) const;
|
int GetItemImage(const wxTreeItemId& item) const;
|
||||||
// get the selected item image
|
|
||||||
int GetItemSelectedImage(const wxTreeItemId& item) const;
|
|
||||||
// get the data associated with the item
|
// get the data associated with the item
|
||||||
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
||||||
|
|
||||||
@@ -202,8 +201,6 @@ public:
|
|||||||
void SetItemText(const wxTreeItemId& item, const wxString& text);
|
void SetItemText(const wxTreeItemId& item, const wxString& text);
|
||||||
// set the normal item image
|
// set the normal item image
|
||||||
void SetItemImage(const wxTreeItemId& item, int image);
|
void SetItemImage(const wxTreeItemId& item, int image);
|
||||||
// set the selected item image
|
|
||||||
void SetItemSelectedImage(const wxTreeItemId& item, int image);
|
|
||||||
// associate some data with the item
|
// associate some data with the item
|
||||||
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
||||||
|
|
||||||
@@ -247,10 +244,6 @@ public:
|
|||||||
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
||||||
// the same!
|
// the same!
|
||||||
|
|
||||||
// get the first child of this item
|
|
||||||
wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
|
|
||||||
// get the next child (after GetFirstChild or GetNextChild)
|
|
||||||
wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
|
|
||||||
// get the last child of this item - this method doesn't use cookies
|
// get the last child of this item - this method doesn't use cookies
|
||||||
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
||||||
|
|
||||||
@@ -342,55 +335,71 @@ public:
|
|||||||
// deprecated
|
// deprecated
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// these methods are deprecated and will be removed in future versions of
|
// these methods are deprecated and will be removed in future versions of
|
||||||
// wxWidgets, they're here for compatibility only, don't use them in new
|
// wxWidgets, they're here for compatibility only, don't use them in new
|
||||||
// code (the comments indicate why these methods are now useless and how to
|
// code (the comments indicate why these methods are now useless and how to
|
||||||
// replace them)
|
// replace them)
|
||||||
|
|
||||||
// use Expand, Collapse, CollapseAndReset or Toggle
|
// use Expand, Collapse, CollapseAndReset or Toggle
|
||||||
void ExpandItem(const wxTreeItemId& item, int action);
|
wxDEPRECATED( void ExpandItem(const wxTreeItemId& item, int action) );
|
||||||
|
|
||||||
|
// use SetImageList
|
||||||
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int) )
|
||||||
|
{ SetImageList(imageList); }
|
||||||
|
|
||||||
|
// use Set/GetItemImage directly
|
||||||
|
wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
|
||||||
|
wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
|
||||||
|
|
||||||
|
// get the first child of this item
|
||||||
|
wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const );
|
||||||
|
// get the next child (after GetFirstChild or GetNextChild)
|
||||||
|
wxDEPRECATED( wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const );
|
||||||
|
|
||||||
// use AddRoot, PrependItem or AppendItem
|
// use AddRoot, PrependItem or AppendItem
|
||||||
wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
wxDEPRECATED( wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
int image = -1, int selImage = -1,
|
int image = -1, int selImage = -1,
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
// use Set/GetImageList and Set/GetStateImageList
|
// use Set/GetImageList and Set/GetStateImageList
|
||||||
wxImageList *GetImageList(int) const
|
wxImageList *GetImageList(int) const
|
||||||
{ return GetImageList(); }
|
{ return GetImageList(); }
|
||||||
void SetImageList(wxImageList *imageList, int)
|
|
||||||
{ SetImageList(imageList); }
|
|
||||||
|
|
||||||
void SendExpanding(const wxTreeItemId& item);
|
void SendExpanding(const wxTreeItemId& item);
|
||||||
void SendExpanded(const wxTreeItemId& item);
|
void SendExpanded(const wxTreeItemId& item);
|
||||||
void SendCollapsing(const wxTreeItemId& item);
|
void SendCollapsing(const wxTreeItemId& item);
|
||||||
void SendCollapsed(const wxTreeItemId& item);
|
void SendCollapsed(const wxTreeItemId& item);
|
||||||
void SendSelChanging(const wxTreeItemId& item);
|
void SendSelChanging(const wxTreeItemId& item);
|
||||||
void SendSelChanged(const wxTreeItemId& item);
|
void SendSelChanged(const wxTreeItemId& item);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxTreeItemId m_editItem;
|
|
||||||
GtkTree *m_tree;
|
|
||||||
GtkTreeItem *m_anchor;
|
|
||||||
wxTextCtrl* m_textCtrl;
|
|
||||||
wxImageList* m_imageListNormal;
|
|
||||||
wxImageList* m_imageListState;
|
|
||||||
|
|
||||||
long m_curitemId;
|
wxTreeItemId m_editItem;
|
||||||
|
GtkTree *m_tree;
|
||||||
|
GtkTreeItem *m_anchor;
|
||||||
|
wxTextCtrl* m_textCtrl;
|
||||||
|
wxImageList* m_imageListNormal;
|
||||||
|
wxImageList* m_imageListState;
|
||||||
|
|
||||||
void SendMessage(wxEventType command, const wxTreeItemId& item);
|
long m_curitemId;
|
||||||
|
|
||||||
|
void SendMessage(wxEventType command, const wxTreeItemId& item);
|
||||||
// GtkTreeItem *findGtkTreeItem(wxTreeCtrlId &id) const;
|
// GtkTreeItem *findGtkTreeItem(wxTreeCtrlId &id) const;
|
||||||
|
|
||||||
// the common part of all ctors
|
// the common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
// insert a new item in as the last child of the parent
|
// insert a new item in as the last child of the parent
|
||||||
wxTreeItemId p_InsertItem(GtkTreeItem *p,
|
wxTreeItemId p_InsertItem(GtkTreeItem *p,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
int image, int selectedImage,
|
int image, int selectedImage,
|
||||||
wxTreeItemData *data);
|
wxTreeItemData *data);
|
||||||
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -52,7 +52,7 @@ enum {
|
|||||||
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||||
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||||
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||||
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||||
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||||
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||||
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||||
@@ -60,17 +60,21 @@ enum {
|
|||||||
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flags for InsertItem
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
enum {
|
// Flags for InsertItem
|
||||||
wxTREE_INSERT_LAST = -1,
|
enum {
|
||||||
wxTREE_INSERT_FIRST = -2,
|
wxTREE_INSERT_LAST = -1,
|
||||||
wxTREE_INSERT_SORT = -3
|
wxTREE_INSERT_FIRST = -2,
|
||||||
};
|
wxTREE_INSERT_SORT = -3
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class WXDLLEXPORT wxTreeItem: public wxObject
|
class WXDLLEXPORT wxTreeItem: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
long m_mask;
|
long m_mask;
|
||||||
long m_itemId;
|
long m_itemId;
|
||||||
long m_state;
|
long m_state;
|
||||||
@@ -144,7 +148,6 @@ public:
|
|||||||
void SetIndent(int indent);
|
void SetIndent(int indent);
|
||||||
// image list
|
// image list
|
||||||
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
||||||
void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL);
|
|
||||||
|
|
||||||
// navigation inside the tree
|
// navigation inside the tree
|
||||||
long GetNextItem(long item, int code) const;
|
long GetNextItem(long item, int code) const;
|
||||||
@@ -173,8 +176,8 @@ public:
|
|||||||
// convenience function
|
// convenience function
|
||||||
bool IsItemExpanded(long item)
|
bool IsItemExpanded(long item)
|
||||||
{
|
{
|
||||||
return (GetItemState(item, wxTREE_STATE_EXPANDED) &
|
return (GetItemState(item, wxTREE_STATE_EXPANDED) &
|
||||||
wxTREE_STATE_EXPANDED) != 0;
|
wxTREE_STATE_EXPANDED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bounding rect
|
// bounding rect
|
||||||
@@ -186,20 +189,25 @@ public:
|
|||||||
// ----------
|
// ----------
|
||||||
// adding/deleting items
|
// adding/deleting items
|
||||||
bool DeleteItem(long item);
|
bool DeleteItem(long item);
|
||||||
long InsertItem(long parent, wxTreeItem& info,
|
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// If image > -1 and selImage == -1, the same image is used for
|
wxDEPRECATED( long InsertItem(long parent, wxTreeItem& info,
|
||||||
// both selected and unselected items.
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
long InsertItem(long parent, const wxString& label,
|
// If image > -1 and selImage == -1, the same image is used for
|
||||||
int image = -1, int selImage = -1,
|
// both selected and unselected items.
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
wxDEPRECATED( long InsertItem(long parent, const wxString& label,
|
||||||
|
int image = -1, int selImage = -1,
|
||||||
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
|
||||||
|
// use Expand, Collapse, CollapseAndReset or Toggle
|
||||||
|
wxDEPRECATED( bool ExpandItem(long item, int action) );
|
||||||
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL) );
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
// changing item state
|
// changing item state
|
||||||
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
||||||
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
||||||
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
||||||
// common interface for {Expand|Collapse|Toggle}Item
|
|
||||||
bool ExpandItem(long item, int action);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool SelectItem(long item);
|
bool SelectItem(long item);
|
||||||
@@ -246,20 +254,20 @@ protected:
|
|||||||
|
|
||||||
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||||
|
|
||||||
int m_code;
|
int m_code;
|
||||||
wxTreeItem m_item;
|
wxTreeItem m_item;
|
||||||
long m_oldItem;
|
long m_oldItem;
|
||||||
wxPoint m_pointDrag;
|
wxPoint m_pointDrag;
|
||||||
|
|
||||||
inline long GetOldItem() const { return m_oldItem; }
|
inline long GetOldItem() const { return m_oldItem; }
|
||||||
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
||||||
inline wxPoint GetPoint() const { return m_pointDrag; }
|
inline wxPoint GetPoint() const { return m_pointDrag; }
|
||||||
inline int GetCode() const { return m_code; }
|
inline int GetCode() const { return m_code; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||||
|
@@ -52,7 +52,7 @@ enum {
|
|||||||
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||||
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||||
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||||
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||||
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||||
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||||
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||||
@@ -60,16 +60,18 @@ enum {
|
|||||||
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flags for InsertItem
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
enum {
|
// Flags for InsertItem
|
||||||
wxTREE_INSERT_LAST = -1,
|
enum {
|
||||||
wxTREE_INSERT_FIRST = -2,
|
wxTREE_INSERT_LAST = -1,
|
||||||
wxTREE_INSERT_SORT = -3
|
wxTREE_INSERT_FIRST = -2,
|
||||||
};
|
wxTREE_INSERT_SORT = -3
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class WXDLLEXPORT wxTreeItem: public wxObject
|
class WXDLLEXPORT wxTreeItem: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||||
public:
|
public:
|
||||||
long m_mask;
|
long m_mask;
|
||||||
long m_itemId;
|
long m_itemId;
|
||||||
@@ -144,7 +146,6 @@ public:
|
|||||||
void SetIndent(int indent);
|
void SetIndent(int indent);
|
||||||
// image list
|
// image list
|
||||||
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
||||||
void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL);
|
|
||||||
|
|
||||||
// navigation inside the tree
|
// navigation inside the tree
|
||||||
long GetNextItem(long item, int code) const;
|
long GetNextItem(long item, int code) const;
|
||||||
@@ -186,20 +187,24 @@ public:
|
|||||||
// ----------
|
// ----------
|
||||||
// adding/deleting items
|
// adding/deleting items
|
||||||
bool DeleteItem(long item);
|
bool DeleteItem(long item);
|
||||||
long InsertItem(long parent, wxTreeItem& info,
|
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
|
wxDEPRECATED( long InsertItem(long parent, wxTreeItem& info,
|
||||||
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
// If image > -1 and selImage == -1, the same image is used for
|
// If image > -1 and selImage == -1, the same image is used for
|
||||||
// both selected and unselected items.
|
// both selected and unselected items.
|
||||||
long InsertItem(long parent, const wxString& label,
|
wxDEPRECATED( long InsertItem(long parent, const wxString& label,
|
||||||
int image = -1, int selImage = -1,
|
int image = -1, int selImage = -1,
|
||||||
long insertAfter = wxTREE_INSERT_LAST);
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
wxDEPRECATED( bool ExpandItem(long item, int action) );
|
||||||
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL) );
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
// changing item state
|
// changing item state
|
||||||
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
||||||
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
||||||
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
||||||
// common interface for {Expand|Collapse|Toggle}Item
|
// common interface for {Expand|Collapse|Toggle}Item
|
||||||
bool ExpandItem(long item, int action);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool SelectItem(long item);
|
bool SelectItem(long item);
|
||||||
@@ -246,20 +251,21 @@ protected:
|
|||||||
|
|
||||||
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
|
||||||
|
|
||||||
int m_code;
|
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||||
wxTreeItem m_item;
|
|
||||||
long m_oldItem;
|
|
||||||
wxPoint m_pointDrag;
|
|
||||||
|
|
||||||
inline long GetOldItem() const { return m_oldItem; }
|
int m_code;
|
||||||
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
wxTreeItem m_item;
|
||||||
inline wxPoint GetPoint() const { return m_pointDrag; }
|
long m_oldItem;
|
||||||
inline int GetCode() const { return m_code; }
|
wxPoint m_pointDrag;
|
||||||
|
|
||||||
|
inline long GetOldItem() const { return m_oldItem; }
|
||||||
|
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
||||||
|
inline wxPoint GetPoint() const { return m_pointDrag; }
|
||||||
|
inline int GetCode() const { return m_code; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||||
|
@@ -34,13 +34,14 @@ class WXDLLEXPORT wxImageList;
|
|||||||
class WXDLLEXPORT wxDragImage;
|
class WXDLLEXPORT wxDragImage;
|
||||||
struct WXDLLEXPORT wxTreeViewItem;
|
struct WXDLLEXPORT wxTreeViewItem;
|
||||||
|
|
||||||
// NB: all the following flags are for compatbility only and will be removed in the
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
// next versions
|
// NB: all the following flags are for compatbility only and will be removed in the
|
||||||
|
// next versions
|
||||||
// flags for deprecated InsertItem() variant (their values are the same as of
|
// flags for deprecated InsertItem() variant (their values are the same as of
|
||||||
// TVI_FIRST and TVI_LAST)
|
// TVI_FIRST and TVI_LAST)
|
||||||
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
||||||
#define wxTREE_INSERT_LAST 0xFFFF0002
|
#define wxTREE_INSERT_LAST 0xFFFF0002
|
||||||
|
#endif
|
||||||
|
|
||||||
// hash storing attributes for our items
|
// hash storing attributes for our items
|
||||||
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
||||||
@@ -195,7 +196,7 @@ public:
|
|||||||
// Use base class GetImageList()
|
// Use base class GetImageList()
|
||||||
wxDEPRECATED( void SetImageList(wxImageList *imageList, int) );
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int) );
|
||||||
|
|
||||||
// use Set/GetItemImage directly
|
// use Set/GetItemImage directly
|
||||||
wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
|
wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
|
||||||
wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
|
wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
|
||||||
|
|
||||||
|
@@ -36,9 +36,11 @@ struct WXDLLEXPORT wxTreeViewItem;
|
|||||||
// they're equivalent
|
// they're equivalent
|
||||||
class wxTreeItemData;
|
class wxTreeItemData;
|
||||||
|
|
||||||
// flags for deprecated InsertItem() variant
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
// flags for deprecated InsertItem() variant
|
||||||
#define wxTREE_INSERT_LAST 0xFFFF0002
|
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
||||||
|
#define wxTREE_INSERT_LAST 0xFFFF0002
|
||||||
|
#endif
|
||||||
|
|
||||||
// hash storing attributes for our items
|
// hash storing attributes for our items
|
||||||
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
||||||
|
@@ -28,14 +28,6 @@ class WXDLLEXPORT wxImageList;
|
|||||||
class WXDLLEXPORT wxDragImage;
|
class WXDLLEXPORT wxDragImage;
|
||||||
struct WXDLLEXPORT wxTreeViewItem;
|
struct WXDLLEXPORT wxTreeViewItem;
|
||||||
|
|
||||||
// NB: all the following flags are for compatbility only and will be removed in the
|
|
||||||
// next versions
|
|
||||||
|
|
||||||
// flags for deprecated InsertItem() variant (their values are the same as of
|
|
||||||
// TVI_FIRST and TVI_LAST)
|
|
||||||
#define wxTREE_INSERT_FIRST 0xFFFF0001
|
|
||||||
#define wxTREE_INSERT_LAST 0xFFFF0002
|
|
||||||
|
|
||||||
// hash storing attributes for our items
|
// hash storing attributes for our items
|
||||||
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user