]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/stc/ScintillaWX.cpp
Fixing SetColumnWidth and selection handling, attempt at fixing ClearAll(), and initi...
[wxWidgets.git] / contrib / src / stc / ScintillaWX.cpp
index 2a39569a98805d9a7a5648e294ac8e3cc43e1555..bf48fe16698ebeec5e6f146ac1b7861c07671750 100644 (file)
@@ -484,7 +484,13 @@ void ScintillaWX::Paste() {
         wxString   text = wxTextBuffer::Translate(data.GetText(),
                                                   wxConvertEOLMode(pdoc->eolMode));
         wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
         wxString   text = wxTextBuffer::Translate(data.GetText(),
                                                   wxConvertEOLMode(pdoc->eolMode));
         wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-        int        len = strlen(buf);
+
+#if wxUSE_UNICODE
+        // free up the old character buffer in case the text is real big
+        data.SetText(wxEmptyString); 
+        text = wxEmptyString;
+#endif
+        int len = strlen(buf);
         pdoc->InsertString(currentPos, buf, len);
         SetEmptySelection(currentPos + len);
     }
         pdoc->InsertString(currentPos, buf, len);
         SetEmptySelection(currentPos + len);
     }
@@ -827,13 +833,15 @@ void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, b
 }
 
 void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) {
 }
 
 void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) {
+    ButtonUp(pt, curTime, ctrl);
 #if wxUSE_DRAG_AND_DROP
     if (startDragTimer->IsRunning()) {
         startDragTimer->Stop();
 #if wxUSE_DRAG_AND_DROP
     if (startDragTimer->IsRunning()) {
         startDragTimer->Stop();
+        SetDragPosition(invalidPosition);
         SetEmptySelection(PositionFromLocation(pt));
         SetEmptySelection(PositionFromLocation(pt));
+        ShowCaretAtCurrentPosition();
     }
 #endif // wxUSE_DRAG_AND_DROP
     }
 #endif // wxUSE_DRAG_AND_DROP
-    ButtonUp(pt, curTime, ctrl);
 }
 
 void ScintillaWX::DoLeftButtonMove(Point pt) {
 }
 
 void ScintillaWX::DoLeftButtonMove(Point pt) {
@@ -909,6 +917,12 @@ int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
     case WXK_END:               key = SCK_END;      break;
     case WXK_PAGEUP:            key = SCK_PRIOR;    break;
     case WXK_PAGEDOWN:          key = SCK_NEXT;     break;
     case WXK_END:               key = SCK_END;      break;
     case WXK_PAGEUP:            key = SCK_PRIOR;    break;
     case WXK_PAGEDOWN:          key = SCK_NEXT;     break;
+    case WXK_NUMPAD_DOWN:       key = SCK_DOWN;     break;
+    case WXK_NUMPAD_UP:         key = SCK_UP;       break;
+    case WXK_NUMPAD_LEFT:       key = SCK_LEFT;     break;
+    case WXK_NUMPAD_RIGHT:      key = SCK_RIGHT;    break;
+    case WXK_NUMPAD_HOME:       key = SCK_HOME;     break;
+    case WXK_NUMPAD_END:        key = SCK_END;      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_NUMPAD_PAGEUP:     key = SCK_PRIOR;    break;
     case WXK_NUMPAD_PAGEDOWN:   key = SCK_NEXT;     break;
     case WXK_DELETE:            key = SCK_DELETE;   break;