// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) 1997,1998 Robert Roebling
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _GENERIC_TREECTRL_H_
#if WXWIN_COMPATIBILITY_2_2
// deprecated: Use GetItemParent instead.
wxTreeItemId GetParent(const wxTreeItemId& item) const
- { return GetItemParent( item ); }
+ { return GetItemParent( item ); }
- // Expose the base class method hidden by the one above.
+ // Expose the base class method hidden by the one above.
wxWindow *GetParent() const { return wxScrolledWindow::GetParent(); }
#endif // WXWIN_COMPATIBILITY_2_2
// the same!
// get the first child of this item
- wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
+ wxTreeItemId GetFirstChild(const wxTreeItemId& item,
+ wxTreeItemIdValue& cookie) const;
// get the next child
- wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
+ wxTreeItemId GetNextChild(const wxTreeItemId& item,
+ wxTreeItemIdValue& cookie) const;
// get the last child of this item - this method doesn't use cookies
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
// NB: this function is not reentrant and not MT-safe (FIXME)!
void SortChildren(const wxTreeItemId& item);
+#if WXWIN_COMPATIBILITY_2_4
// 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); }
+ // use the versions taking wxTreeItemIdValue cookies (note that
+ // GetNextChild() is not inside wxDEPRECATED on purpose, as otherwise we
+ // get twice as many warnings without any added benefit: it is always used
+ // with GetFirstChild() anyhow)
+ wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item,
+ long& cookie) const );
+ wxTreeItemId GetNextChild(const wxTreeItemId& item,
+ long& cookie) const;
+#endif // WXWIN_COMPATIBILITY_2_4
+
+
// implementation only from now on
// overridden base class virtuals
void OnKillFocus( wxFocusEvent &event );
void OnChar( wxKeyEvent &event );
void OnMouse( wxMouseEvent &event );
- void OnIdle( wxIdleEvent &event );
+ void OnInternalIdle( );
// implementation helpers
protected:
wxGenericTreeItem *m_anchor;
wxGenericTreeItem *m_current,
- *m_key_current;
+ *m_key_current,
+ // A hint to select a parent item after deleting a child
+ *m_select_me;
unsigned short m_indent;
unsigned short m_spacing;
int m_lineHeight;
wxTimer *m_renameTimer;
- wxBitmap *m_arrowRight,
- *m_arrowDown;
-
// incremental search data
wxString m_findPrefix;
wxTimer *m_findTimer;