X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/382fe6404170cbabd05b78bea643ca886a1d315a..582ca3535a3680817ec4448141437eb2812df090:/contrib/src/stc/ScintillaWX.cpp diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 25edc65c6d..07d8349199 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -14,11 +14,11 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include +#include "wx/wx.h" +#include "wx/textbuf.h" +#include "wx/dataobj.h" +#include "wx/clipbrd.h" +#include "wx/dnd.h" #include "ScintillaWX.h" #include "ExternalLexer.h" @@ -27,7 +27,7 @@ #ifdef __WXMSW__ // GetHwndOf() - #include + #include "wx/msw/private.h" #endif //---------------------------------------------------------------------- @@ -154,6 +154,7 @@ END_EVENT_TABLE() //---------------------------------------------------------------------- +#if wxUSE_DATAOBJ static wxTextFileType wxConvertEOLMode(int scintillaMode) { wxTextFileType type; @@ -177,6 +178,7 @@ static wxTextFileType wxConvertEOLMode(int scintillaMode) } return type; } +#endif // wxUSE_DATAOBJ //---------------------------------------------------------------------- @@ -439,6 +441,7 @@ void ScintillaWX::Paste() { pdoc->BeginUndoAction(); ClearSelection(); +#if wxUSE_DATAOBJ wxTextDataObject data; bool gotData = false; @@ -455,6 +458,7 @@ void ScintillaWX::Paste() { pdoc->InsertString(currentPos, buf, len); SetEmptySelection(currentPos + len); } +#endif // wxUSE_DATAOBJ pdoc->EndUndoAction(); NotifyChange(); @@ -463,16 +467,21 @@ void ScintillaWX::Paste() { void ScintillaWX::CopyToClipboard(const SelectionText& st) { +#if wxUSE_CLIPBOARD if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection(false); wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1)); wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Close(); } +#else + wxUnusedVar(st); +#endif // wxUSE_CLIPBOARD } bool ScintillaWX::CanPaste() { +#if wxUSE_CLIPBOARD bool canPaste = false; bool didOpen; @@ -489,6 +498,9 @@ bool ScintillaWX::CanPaste() { } } return canPaste; +#else + return false; +#endif // wxUSE_CLIPBOARD } void ScintillaWX::CreateCallTipWindow(PRectangle) { @@ -851,7 +863,7 @@ int ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed) ctrl = evt.ControlDown(), alt = evt.AltDown(); - if (ctrl && key >= 1 && key <= 26) + if (ctrl && key >= 1 && key <= 26 && key != WXK_BACK) key += 'A' - 1; switch (key) {