From e3d64157d7ff230e7ab16f6dba290d0d9e0e39f9 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 7 Jan 2005 22:31:42 +0000 Subject: [PATCH] Added way to specify in generic tree control if the drop effect (a line) should be drawn above or below the item. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31289 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/treectlg.h | 5 +++++ src/generic/treectlg.cpp | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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); -- 2.45.2