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)
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();
}
}
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;
}
int rv = KeyDown(key, shift, ctrl, alt, consumed);
+
if (key)
return rv;
else
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;
}