X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68985f0e5751cd3332d32a41dd34e9187786c120..ec75509f94fb11322c1c69056d1ec2af8f041fe2:/contrib/src/stc/ScintillaWX.cpp?ds=inline diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 50773daee1..97173fd4f7 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -14,12 +14,21 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include #include "ScintillaWX.h" #include "ExternalLexer.h" #include "wx/stc/stc.h" #include "PlatWX.h" -#include + +#ifdef __WXMSW__ + // GetHwndOf() + #include +#endif //---------------------------------------------------------------------- // Helper classes @@ -456,7 +465,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(); } @@ -636,6 +645,7 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar LexerManager::GetInstance()->Load((const char*)lParam); break; #endif + default: return ScintillaBase::WndProc(iMessage, wParam, lParam); } @@ -840,8 +850,8 @@ int ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed) bool shift = evt.ShiftDown(), 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) { @@ -860,6 +870,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; @@ -983,7 +994,9 @@ void ScintillaWX::DoDragLeave() { // Force the whole window to be repainted void ScintillaWX::FullPaint() { +#ifndef __WXMAC__ stc->Refresh(false); +#endif stc->Update(); } @@ -997,28 +1010,25 @@ void ScintillaWX::DoScrollToColumn(int column) { 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) {