From 8a79319461e3ff566a7670d8613707a90aafb3e2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 9 Jun 2004 22:19:57 +0000 Subject: [PATCH] Ensure that the correct rectangle is clipped and refreshed for the CallTip git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 15 +++++++++++++-- src/stc/ScintillaWX.cpp | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 6fd051521e..de7f683e54 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -67,6 +67,8 @@ void wxSTCDropTarget::OnLeave() { #define param2 -1 // wxWindow's 2nd param is ID #endif +#include + class wxSTCCallTip : public wxSTCCallTipBase { public: wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) @@ -76,12 +78,17 @@ public: } ~wxSTCCallTip() { +#if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__) + wxRect rect = GetRect(); + GetParent()->ScreenToClient(&rect.x, &rect.y); + GetParent()->Refresh(false, &rect); +#endif } bool AcceptsFocus() const { return FALSE; } void OnPaint(wxPaintEvent& WXUNUSED(evt)) { - wxPaintDC dc(this); + wxBufferedPaintDC dc(this); Surface* surfaceWindow = Surface::Allocate(); surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); m_ct->PaintCT(surfaceWindow); @@ -885,7 +892,11 @@ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) { rgn.Subtract(childRect); } if (ct.inCallTipMode) { - wxRect childRect = ((wxWindow*)ct.wCallTip.GetID())->GetRect(); + wxWindow* tip = (wxWindow*)ct.wCallTip.GetID(); + wxRect childRect = tip->GetRect(); +#if wxUSE_POPUPWIN && wxSTC_USE_POPUP + tip->GetParent()->ScreenToClient(&childRect.x, &childRect.y); +#endif rgn.Subtract(childRect); } diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 6fd051521e..de7f683e54 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -67,6 +67,8 @@ void wxSTCDropTarget::OnLeave() { #define param2 -1 // wxWindow's 2nd param is ID #endif +#include + class wxSTCCallTip : public wxSTCCallTipBase { public: wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) @@ -76,12 +78,17 @@ public: } ~wxSTCCallTip() { +#if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__) + wxRect rect = GetRect(); + GetParent()->ScreenToClient(&rect.x, &rect.y); + GetParent()->Refresh(false, &rect); +#endif } bool AcceptsFocus() const { return FALSE; } void OnPaint(wxPaintEvent& WXUNUSED(evt)) { - wxPaintDC dc(this); + wxBufferedPaintDC dc(this); Surface* surfaceWindow = Surface::Allocate(); surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); m_ct->PaintCT(surfaceWindow); @@ -885,7 +892,11 @@ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) { rgn.Subtract(childRect); } if (ct.inCallTipMode) { - wxRect childRect = ((wxWindow*)ct.wCallTip.GetID())->GetRect(); + wxWindow* tip = (wxWindow*)ct.wCallTip.GetID(); + wxRect childRect = tip->GetRect(); +#if wxUSE_POPUPWIN && wxSTC_USE_POPUP + tip->GetParent()->ScreenToClient(&childRect.x, &childRect.y); +#endif rgn.Subtract(childRect); } -- 2.45.2