From 876859fcb74899c088fd4ed65c88f7f33b2202e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Feb 2014 14:54:39 +0000 Subject: [PATCH] Expose ScintillaWX DoDragEnter() and DoDragLeave() methods. These methods are needed to allow implementing alternative wxDropTargets, in addition to the already public DoDragOver(). Closes #16010. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/stc/stc.h | 6 ++++++ interface/wx/stc/stc.h | 14 ++++++++++++++ src/stc/stc.cpp | 11 +++++++++-- src/stc/stc.cpp.in | 11 +++++++++-- src/stc/stc.h.in | 6 ++++++ src/stc/stc.interface.h.in | 14 ++++++++++++++ 6 files changed, 58 insertions(+), 4 deletions(-) diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 7ffab648bd..833a68b51a 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4479,9 +4479,15 @@ public: #endif // !wxUSE_TEXTCTRL #ifdef STC_USE_DND + // Allow for simulating a DnD DragEnter + wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); + // Allow for simulating a DnD DragOver wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); + // Allow for simulating a DnD DragLeave + void DoDragLeave(); + // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); #endif diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h index 18c2117d98..0f22c99636 100644 --- a/interface/wx/stc/stc.h +++ b/interface/wx/stc/stc.h @@ -5676,11 +5676,25 @@ public: */ bool LoadFile(const wxString& filename); + /** + Allow for simulating a DnD DragEnter + + @since 3.1.0 + */ + wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult defaultRes); + /** Allow for simulating a DnD DragOver */ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult defaultRes); + /** + Allow for simulating a DnD DragLeave + + @since 3.1.0 + */ + void DoDragLeave(); + /** Allow for simulating a DnD DropText */ diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index f8e90f72c1..66c6f3ae0c 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -4488,10 +4488,17 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #endif // !wxUSE_TEXTCTRL #if wxUSE_DRAG_AND_DROP -wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { - return m_swx->DoDragOver(x, y, def); +wxDragResult wxStyledTextCtrl::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) { + return m_swx->DoDragEnter(x, y, def); } +wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { + return m_swx->DoDragOver(x, y, def); +} + +void wxStyledTextCtrl::DoDragLeave() { + m_swx->DoDragLeave(); +} bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { return m_swx->DoDropText(x, y, data); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index d0f0ac8a8a..e97f3da4c2 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -626,10 +626,17 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #endif // !wxUSE_TEXTCTRL #if wxUSE_DRAG_AND_DROP -wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { - return m_swx->DoDragOver(x, y, def); +wxDragResult wxStyledTextCtrl::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) { + return m_swx->DoDragEnter(x, y, def); } +wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { + return m_swx->DoDragOver(x, y, def); +} + +void wxStyledTextCtrl::DoDragLeave() { + m_swx->DoDragLeave(); +} bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { return m_swx->DoDropText(x, y, data); diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 63fb35a307..b8279aadaa 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -221,9 +221,15 @@ public: #endif // !wxUSE_TEXTCTRL #ifdef STC_USE_DND + // Allow for simulating a DnD DragEnter + wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); + // Allow for simulating a DnD DragOver wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); + // Allow for simulating a DnD DragLeave + void DoDragLeave(); + // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); #endif diff --git a/src/stc/stc.interface.h.in b/src/stc/stc.interface.h.in index 0aae4703cd..acd3015e0e 100644 --- a/src/stc/stc.interface.h.in +++ b/src/stc/stc.interface.h.in @@ -278,11 +278,25 @@ public: */ bool LoadFile(const wxString& filename); + /** + Allow for simulating a DnD DragEnter + + @since 3.1.0 + */ + wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult defaultRes); + /** Allow for simulating a DnD DragOver */ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult defaultRes); + /** + Allow for simulating a DnD DragLeave + + @since 3.1.0 + */ + void DoDragLeave(); + /** Allow for simulating a DnD DropText */