]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/ScintillaWX.cpp
Compilation fix. I didn't add a #error since I figured this sample will be
[wxWidgets.git] / src / stc / ScintillaWX.cpp
index 427a83e6bd689db728cf85d7b50e0aa6c7b3409a..25edc65c6d58f0167ffa3e563081c759e9e3990b 100644 (file)
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+#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"
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
 
 #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
 
 //----------------------------------------------------------------------
 // Helper classes
@@ -456,7 +465,7 @@ void ScintillaWX::Paste() {
 void ScintillaWX::CopyToClipboard(const SelectionText& st) {
     if (wxTheClipboard->Open()) {
         wxTheClipboard->UsePrimarySelection(false);
 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();
     }
         wxTheClipboard->SetData(new wxTextDataObject(text));
         wxTheClipboard->Close();
     }
@@ -841,7 +850,7 @@ int  ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed)
     bool shift = evt.ShiftDown(),
          ctrl  = evt.ControlDown(),
          alt   = evt.AltDown();
     bool shift = evt.ShiftDown(),
          ctrl  = evt.ControlDown(),
          alt   = evt.AltDown();
+
     if (ctrl && key >= 1 && key <= 26)
         key += 'A' - 1;
 
     if (ctrl && key >= 1 && key <= 26)
         key += 'A' - 1;
 
@@ -1001,28 +1010,25 @@ void ScintillaWX::DoScrollToColumn(int column) {
     HorizontalScrollTo(column * vs.spaceWidth);
 }
 
     HorizontalScrollTo(column * vs.spaceWidth);
 }
 
-#ifdef __WXGTK__
-void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) {
-    wxRegion rgn(wxRectFromPRectangle(rect));
-    if (ac.Active()) {
-        wxRect childRect = ((wxWindow*)ac.lb->GetID())->GetRect();
-        rgn.Subtract(childRect);
-    }
-    if (ct.inCallTipMode) {
-        wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID();
-        wxRect childRect = tip->GetRect();
-#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
-        childRect.SetPosition(tip->GetMyPosition());
-#endif
-        rgn.Subtract(childRect);
-    }
-
-    dc.SetClippingRegion(rgn);
-}
-#else
-void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect)) {
+// wxGTK doesn't appear to need this explicit clipping code any longer, but I
+// will leave it here commented out for a while just in case...
+void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect))
+{
+//     wxRegion rgn(wxRectFromPRectangle(rect));
+//     if (ac.Active()) {
+//         wxRect childRect = ((wxWindow*)ac.lb->GetID())->GetRect();
+//         rgn.Subtract(childRect);
+//     }
+//     if (ct.inCallTipMode) {
+//         wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID();
+//         wxRect childRect = tip->GetRect();
+// #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+//         childRect.SetPosition(tip->GetMyPosition());
+// #endif
+//         rgn.Subtract(childRect);
+//     }
+//     dc.SetClippingRegion(rgn);
 }
 }
-#endif
 
 
 void ScintillaWX::SetUseAntiAliasing(bool useAA) {
 
 
 void ScintillaWX::SetUseAntiAliasing(bool useAA) {