X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98719eabe0c575193e5e0470130944ea671ceb41..a015d6943e03615683351b899eaa46c6755b83e0:/src/stc/ScintillaWX.cpp diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index f139054299..42b6e4eb55 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -14,18 +14,12 @@ // 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 #include #include #include #include -#undef Point -#undef Style - #include "ScintillaWX.h" #include "ExternalLexer.h" #include "wx/stc/stc.h" @@ -160,6 +154,7 @@ END_EVENT_TABLE() //---------------------------------------------------------------------- +#if wxUSE_DATAOBJ static wxTextFileType wxConvertEOLMode(int scintillaMode) { wxTextFileType type; @@ -183,6 +178,7 @@ static wxTextFileType wxConvertEOLMode(int scintillaMode) } return type; } +#endif // wxUSE_DATAOBJ //---------------------------------------------------------------------- @@ -445,6 +441,7 @@ void ScintillaWX::Paste() { pdoc->BeginUndoAction(); ClearSelection(); +#if wxUSE_DATAOBJ wxTextDataObject data; bool gotData = false; @@ -461,6 +458,7 @@ void ScintillaWX::Paste() { pdoc->InsertString(currentPos, buf, len); SetEmptySelection(currentPos + len); } +#endif // wxUSE_DATAOBJ pdoc->EndUndoAction(); NotifyChange(); @@ -469,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; @@ -495,6 +498,9 @@ bool ScintillaWX::CanPaste() { } } return canPaste; +#else + return false; +#endif // wxUSE_CLIPBOARD } void ScintillaWX::CreateCallTipWindow(PRectangle) { @@ -857,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) { @@ -1016,28 +1022,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) {