X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6582821b61ba8270f712e0f26b2a3d7bf24116f..0e7bd27a8dfc9a8350355cf51023046fc30496ef:/src/stc/ScintillaWX.cpp diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 2add87761f..d5f2648dd1 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -122,9 +122,10 @@ void ScintillaWX::Finalise() { void ScintillaWX::StartDrag() { wxDropSource source(wMain.GetID()); - wxTextDataObject data(dragChars); + wxTextDataObject data(wxString(drag.s, drag.len)); wxDragResult result; + dropWentOutside = true; source.SetData(data); result = source.DoDragDrop(TRUE); if (result == wxDragMove && dropWentOutside) @@ -217,9 +218,10 @@ void ScintillaWX::NotifyParent(SCNotification scn) { void ScintillaWX::Copy() { if (currentPos != anchor) { - char* text = CopySelectionRange(); + SelectionText st; + CopySelectionRange(&st); wxTheClipboard->Open(); - wxTheClipboard->SetData(new wxTextDataObject(text)); + wxTheClipboard->SetData(new wxTextDataObject(wxString(st.s, st.len))); wxTheClipboard->Close(); } } @@ -421,13 +423,16 @@ void ScintillaWX::DoButtonMove(Point pt) { void ScintillaWX::DoAddChar(char ch) { - //bool acActiveBeforeCharAdded = ac.Active(); AddChar(ch); - //if (acActiveBeforeCharAdded) - // AutoCompleteChanged(ch); } int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed) { +#ifdef __WXGTK__ + // Ctrl chars (A-Z) end up with the wrong keycode on wxGTK... + if (ctrl && key >= 1 && key <= 26) + key += 'A' - 1; +#endif + switch (key) { case WXK_DOWN: key = SCK_DOWN; break; case WXK_UP: key = SCK_UP; break; @@ -459,6 +464,7 @@ int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* cons } int rv = KeyDown(key, shift, ctrl, alt, consumed); + if (key) return rv; else @@ -490,14 +496,15 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) { wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) { - return def; + dragResult = def; + return dragResult; } wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { SetDragPosition(PositionFromLocation(Point(x, y))); dragResult = def; - return def; + return dragResult; }