X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c930beb60f14692321b0f7cf1b6054f93053772..bceff574a860c4ecd9bb2d5a1a3f8889fef9306a:/src/stc/ScintillaWX.cpp diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index a27fe5126b..bf48fe1669 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -328,17 +328,16 @@ void ScintillaWX::SetTicking(bool on) { void ScintillaWX::SetMouseCapture(bool on) { if (mouseDownCaptures) { - if (on && !stc->HasCapture()) + if (on && !capturedMouse) stc->CaptureMouse(); - else if (!on && stc->HasCapture()) + else if (!on && capturedMouse && stc->HasCapture()) stc->ReleaseMouse(); - capturedMouse = stc->HasCapture(); + capturedMouse = on; } } bool ScintillaWX::HaveMouseCapture() { - capturedMouse = stc->HasCapture(); return capturedMouse; } @@ -484,11 +483,14 @@ 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); +#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); } @@ -915,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_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;