diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 6bd96cf472..82dcaa849d 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -105,6 +105,9 @@ public: virtual void AssignStateImageList(wxImageList *imageList); virtual void AssignButtonsImageList(wxImageList *imageList); + virtual void SetDropEffectAboveItem( bool above = false ) { m_dropEffectAboveItem = above; } + virtual bool GetDropEffectAboveItem() const { return m_dropEffectAboveItem; } + // Functions to work with tree ctrl items. // accessors @@ -446,6 +449,8 @@ protected: // incremental search data wxString m_findPrefix; wxTimer *m_findTimer; + + bool m_dropEffectAboveItem; // the common part of all ctors void Init(); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index ca9a9565df..ed8f47b512 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -758,6 +758,8 @@ void wxGenericTreeCtrl::Init() m_findTimer = NULL; + m_dropEffectAboveItem = false; + m_lastOnSame = false; #ifdef __WXMAC_CARBON__ @@ -2499,7 +2501,7 @@ void wxGenericTreeCtrl::DrawDropEffect(wxGenericTreeItem *item) { // draw a line under the drop target because the item will be // dropped there - DrawLine(item, true /* below */); + DrawLine(item, !m_dropEffectAboveItem ); } SetCursor(wxCURSOR_BULLSEYE);