From 17e05a8e8820139c690bb852dbb7247cd67c4f7a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Jun 2008 02:21:55 +0000 Subject: [PATCH] don't interfere with Scintilla drag-and-drop (#9088) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/stc/ScintillaWX.cpp | 39 +-------------------------------------- src/stc/ScintillaWX.h | 2 -- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 62524ee928..b68bde05d3 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -64,21 +64,6 @@ private: #if wxUSE_DRAG_AND_DROP -class wxStartDragTimer : public wxTimer { -public: - wxStartDragTimer(ScintillaWX* swx) { - m_swx = swx; - } - - void Notify() { - m_swx->DoStartDrag(); - } - -private: - ScintillaWX* m_swx; -}; - - bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) { return m_swx->DoDropText(x, y, data); } @@ -260,16 +245,10 @@ ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { sysCaretWidth = 0; sysCaretHeight = 0; #endif -#if wxUSE_DRAG_AND_DROP - startDragTimer = new wxStartDragTimer(this); -#endif // wxUSE_DRAG_AND_DROP } ScintillaWX::~ScintillaWX() { -#if wxUSE_DRAG_AND_DROP - delete startDragTimer; -#endif // wxUSE_DRAG_AND_DROP Finalise(); } @@ -301,15 +280,6 @@ void ScintillaWX::Finalise() { void ScintillaWX::StartDrag() { -#if wxUSE_DRAG_AND_DROP - // We defer the starting of the DnD, otherwise the LeftUp of a normal - // click could be lost and the STC will think it is doing a DnD when the - // user just wanted a normal click. - startDragTimer->Start(200, true); -#endif // wxUSE_DRAG_AND_DROP -} - -void ScintillaWX::DoStartDrag() { #if wxUSE_DRAG_AND_DROP wxString dragText = stc2wx(drag.s, drag.len); @@ -330,6 +300,7 @@ void ScintillaWX::DoStartDrag() { source.SetData(data); dropWentOutside = true; + inDragDrop = ddDragging; result = source.DoDragDrop(evt.GetDragAllowMove()); if (result == wxDragMove && dropWentOutside) ClearSelection(); @@ -878,14 +849,6 @@ void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, b void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) { ButtonUp(pt, curTime, ctrl); -#if wxUSE_DRAG_AND_DROP - if (startDragTimer->IsRunning()) { - startDragTimer->Stop(); - SetDragPosition(invalidPosition); - SetEmptySelection(PositionFromLocation(pt)); - ShowCaretAtCurrentPosition(); - } -#endif // wxUSE_DRAG_AND_DROP } void ScintillaWX::DoLeftButtonMove(Point pt) { diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index 66345d16d2..576229389b 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -148,7 +148,6 @@ public: int DoKeyDown(const wxKeyEvent& event, bool* consumed); void DoTick() { Tick(); } void DoOnIdle(wxIdleEvent& evt); - void DoStartDrag(); #if wxUSE_DRAG_AND_DROP bool DoDropText(long x, long y, const wxString& data); @@ -180,7 +179,6 @@ private: #if wxUSE_DRAG_AND_DROP wxSTCDropTarget* dropTarget; wxDragResult dragResult; - wxTimer* startDragTimer; #endif int wheelRotation; -- 2.45.2