]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/stc/ScintillaWX.cpp
Don't use a saved label size incase the size changes. Patch from Hong Yuan.
[wxWidgets.git] / contrib / src / stc / ScintillaWX.cpp
index 2a39569a98805d9a7a5648e294ac8e3cc43e1555..a27fe5126b5596560b89fa1f094997f5dc41e690 100644 (file)
@@ -328,16 +328,17 @@ void ScintillaWX::SetTicking(bool on) {
 
 void ScintillaWX::SetMouseCapture(bool on) {
     if (mouseDownCaptures) {
-        if (on && !capturedMouse)
+        if (on && !stc->HasCapture())
             stc->CaptureMouse();
-        else if (!on && capturedMouse && stc->HasCapture())
+        else if (!on && stc->HasCapture())
             stc->ReleaseMouse();
-        capturedMouse = on;
+        capturedMouse = stc->HasCapture();
     }
 }
 
 
 bool ScintillaWX::HaveMouseCapture() {
+    capturedMouse = stc->HasCapture();
     return capturedMouse;
 }
 
@@ -483,7 +484,10 @@ void ScintillaWX::Paste() {
     if (gotData) {
         wxString   text = wxTextBuffer::Translate(data.GetText(),
                                                   wxConvertEOLMode(pdoc->eolMode));
+  data.SetText(wxEmptyString); // free the data object content
         wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+  text = wxEmptyString; // free text
+
         int        len = strlen(buf);
         pdoc->InsertString(currentPos, buf, len);
         SetEmptySelection(currentPos + len);
@@ -827,13 +831,15 @@ 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
-    ButtonUp(pt, curTime, ctrl);
 }
 
 void ScintillaWX::DoLeftButtonMove(Point pt) {