X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17e05a8e8820139c690bb852dbb7247cd67c4f7a..b50e6e416e2b4cdc849ea6f24181094c0957d904:/src/stc/ScintillaWX.cpp?ds=sidebyside diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index b68bde05d3..0f9a5281ab 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -103,9 +103,9 @@ public: | wxFRAME_FLOAT_ON_PARENT | wxBORDER_NONE #ifdef __WXMAC__ - | wxPOPUP_WINDOW + | wxPOPUP_WINDOW #endif - ), + ), #endif m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord) { @@ -180,7 +180,7 @@ public: return rv; } #endif - + wxPoint GetMyPosition() { return wxPoint(m_cx, m_cy); @@ -263,11 +263,7 @@ void ScintillaWX::Initialise() { dropTarget->SetScintilla(this); stc->SetDropTarget(dropTarget); #endif // wxUSE_DRAG_AND_DROP -#ifdef __WXMAC__ - vs.extraFontFlag = false; // UseAntiAliasing -#else vs.extraFontFlag = true; // UseAntiAliasing -#endif } @@ -315,11 +311,9 @@ bool ScintillaWX::SetIdle(bool on) { if (idler.state != on) { // connect or disconnect the EVT_IDLE handler if (on) - stc->Connect(wxID_ANY, wxEVT_IDLE, - (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle); + stc->Connect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxStyledTextCtrl::OnIdle)); else - stc->Disconnect(wxID_ANY, wxEVT_IDLE, - (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle); + stc->Disconnect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxStyledTextCtrl::OnIdle)); idler.state = on; } return idler.state; @@ -506,7 +500,7 @@ void ScintillaWX::Paste() { #if wxUSE_UNICODE // free up the old character buffer in case the text is real big - data.SetText(wxEmptyString); + data.SetText(wxEmptyString); text = wxEmptyString; #endif int len = strlen(buf); @@ -523,6 +517,9 @@ void ScintillaWX::Paste() { void ScintillaWX::CopyToClipboard(const SelectionText& st) { #if wxUSE_CLIPBOARD + if ( !st.len ) + return; + wxTheClipboard->UsePrimarySelection(false); if (wxTheClipboard->Open()) { wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1)); @@ -614,8 +611,8 @@ void ScintillaWX::UpdateSystemCaret() { bool ScintillaWX::HasCaretSizeChanged() { #ifdef __WXMSW__ - if (( (0 != vs.caretWidth) && (sysCaretWidth != vs.caretWidth) ) - || (0 != vs.lineHeight) && (sysCaretHeight != vs.lineHeight)) { + if ( (vs.caretWidth && (sysCaretWidth != vs.caretWidth)) + || (vs.lineHeight && (sysCaretHeight != vs.lineHeight)) ) { return true; } #endif @@ -677,12 +674,17 @@ sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) char* defn = reinterpret_cast(lParam); AutoCompleteCancel(); pt.y += vs.lineHeight; + int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT; + if (ct.UseStyleCallTip()) + { + ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back); + } PRectangle rc = ct.CallTipStart(currentPos, pt, defn, - vs.styles[STYLE_DEFAULT].fontName, - vs.styles[STYLE_DEFAULT].sizeZoomed, + vs.styles[ctStyle].fontName, + vs.styles[ctStyle].sizeZoomed, CodePage(), - vs.styles[STYLE_DEFAULT].characterSet, + vs.styles[ctStyle].characterSet, wMain); // If the call-tip window would be out of the client // space, adjust so it displays above the text.