]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/ScintillaWX.cpp
Temporary compilation fix for wxUSE_INTL=0
[wxWidgets.git] / src / stc / ScintillaWX.cpp
index 779ac2a3df0daca99e3f195e256a89acf4026a5d..f139054299741fd4121e13df1fc20ccba54cbb10 100644 (file)
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+#define Point macPoint  // These names are also defined by some mac headers so
+#define Style macStyle  // change their names, and then undef before we need them
+
+#include <wx/wx.h>
+#include <wx/textbuf.h>
+#include <wx/dataobj.h>
+#include <wx/clipbrd.h>
+#include <wx/dnd.h>
+
+#undef Point
+#undef Style
 
 #include "ScintillaWX.h"
 #include "ExternalLexer.h"
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
-#include <wx/textbuf.h>
+
+#ifdef __WXMSW__
+    // GetHwndOf()
+    #include <wx/msw/private.h>
+#endif
 
 //----------------------------------------------------------------------
 // Helper classes
@@ -456,7 +471,7 @@ void ScintillaWX::Paste() {
 void ScintillaWX::CopyToClipboard(const SelectionText& st) {
     if (wxTheClipboard->Open()) {
         wxTheClipboard->UsePrimarySelection(false);
-        wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
+        wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
         wxTheClipboard->SetData(new wxTextDataObject(text));
         wxTheClipboard->Close();
     }
@@ -841,7 +856,7 @@ int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
     bool shift = evt.ShiftDown(),
          ctrl  = evt.ControlDown(),
          alt   = evt.AltDown();
+
     if (ctrl && key >= 1 && key <= 26)
         key += 'A' - 1;
 
@@ -861,6 +876,7 @@ int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
     case WXK_ESCAPE:            key = SCK_ESCAPE;   break;
     case WXK_BACK:              key = SCK_BACK;     break;
     case WXK_TAB:               key = SCK_TAB;      break;
+    case WXK_NUMPAD_ENTER:      // fall through
     case WXK_RETURN:            key = SCK_RETURN;   break;
     case WXK_ADD:               // fall through
     case WXK_NUMPAD_ADD:        key = SCK_ADD;      break;