]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/ScintillaWX.cpp
Include wx/validate.h and wx/valtext.h according to precompiled headers of wx/wx...
[wxWidgets.git] / src / stc / ScintillaWX.cpp
index 3bf1d13c43b06227a4e17ab58dff06cf5860a8d5..2d793a91570daeaea004b711dfe922cf58d2e96b 100644 (file)
@@ -257,7 +257,7 @@ void ScintillaWX::StartDrag() {
     // 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(100, true);
+    startDragTimer->Start(200, true);
 #endif // wxUSE_DRAG_AND_DROP
 }
 
@@ -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;
 }
 
@@ -827,13 +828,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) {
@@ -907,10 +910,10 @@ int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
     case WXK_RIGHT:             key = SCK_RIGHT;    break;
     case WXK_HOME:              key = SCK_HOME;     break;
     case WXK_END:               key = SCK_END;      break;
-    case WXK_PAGEUP:            // fall through
-    case WXK_PRIOR:             key = SCK_PRIOR;    break;
-    case WXK_PAGEDOWN:          // fall through
-    case WXK_NEXT:              key = SCK_NEXT;     break;
+    case WXK_PAGEUP:            key = SCK_PRIOR;    break;
+    case WXK_PAGEDOWN:          key = SCK_NEXT;     break;
+    case WXK_NUMPAD_PAGEUP:     key = SCK_PRIOR;    break;
+    case WXK_NUMPAD_PAGEDOWN:   key = SCK_NEXT;     break;
     case WXK_DELETE:            key = SCK_DELETE;   break;
     case WXK_INSERT:            key = SCK_INSERT;   break;
     case WXK_ESCAPE:            key = SCK_ESCAPE;   break;