]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/stc/ScintillaWX.cpp
Added extern "C" around winsock and moved it before "wx/msw/private.h"
[wxWidgets.git] / contrib / src / stc / ScintillaWX.cpp
index 5b82473a49240250c21aa9bd15ec91eb3f1c3936..cd0064be5c4003ef62e2d8cfbc20ffc614af190e 100644 (file)
@@ -84,8 +84,9 @@ ScintillaWX::~ScintillaWX() {
 
 void ScintillaWX::Initialise() {
     //ScintillaBase::Initialise();
-    dropTarget.SetScintilla(this);
-    stc->SetDropTarget(&dropTarget);
+    dropTarget = new wxSTCDropTarget;
+    dropTarget->SetScintilla(this);
+    stc->SetDropTarget(dropTarget);
 }
 
 
@@ -95,7 +96,7 @@ void ScintillaWX::Finalise() {
 
 
 void ScintillaWX::StartDrag() {
-    wxDropSource        source;
+    wxDropSource        source(wMain.GetID());
     wxTextDataObject    data(dragChars);
     wxDragResult        result;
 
@@ -128,9 +129,9 @@ void ScintillaWX::SetTicking(bool on) {
 
 
 void ScintillaWX::SetMouseCapture(bool on) {
-    if (on)
+    if (on && !capturedMouse)
         wMain.GetID()->CaptureMouse();
-    else
+    else if (!on && capturedMouse)
         wMain.GetID()->ReleaseMouse();
     capturedMouse = on;
 }