From ee8bee6c8c345e5b61c8e9b1563ed85bb4fb7e15 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 3 Sep 2004 18:59:14 +0000 Subject: [PATCH] Fixed incorrect clipping region on wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 22 ++++++++++++++++------ src/stc/ScintillaWX.cpp | 22 ++++++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index f9da687f62..0e6d4c6874 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -73,14 +73,15 @@ class wxSTCCallTip : public wxSTCCallTipBase { public: wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) : wxSTCCallTipBase(parent, param2), - m_ct(ct), m_swx(swx) + m_ct(ct), m_swx(swx), m_cx(-1), m_cy(-1) { } ~wxSTCCallTip() { #if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__) wxRect rect = GetRect(); - GetParent()->ScreenToClient(&rect.x, &rect.y); + rect.x = m_cx; + rect.y = m_cy; GetParent()->Refresh(false, &rect); #endif } @@ -112,17 +113,26 @@ public: virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { - if (x != -1) + if (x != -1) { + m_cx = x; GetParent()->ClientToScreen(&x, NULL); - if (y != -1) + } + if (y != -1) { + m_cy = y; GetParent()->ClientToScreen(NULL, &y); + } wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags); } #endif + wxPoint GetMyPosition() { + return wxPoint(m_cx, m_cy); + } + private: CallTip* m_ct; ScintillaWX* m_swx; + int m_cx, m_cy; DECLARE_EVENT_TABLE() }; @@ -926,10 +936,10 @@ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) { rgn.Subtract(childRect); } if (ct.inCallTipMode) { - wxWindow* tip = (wxWindow*)ct.wCallTip.GetID(); + wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID(); wxRect childRect = tip->GetRect(); #if wxUSE_POPUPWIN && wxSTC_USE_POPUP - tip->GetParent()->ScreenToClient(&childRect.x, &childRect.y); + childRect.SetPosition(tip->GetMyPosition()); #endif rgn.Subtract(childRect); } diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index f9da687f62..0e6d4c6874 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -73,14 +73,15 @@ class wxSTCCallTip : public wxSTCCallTipBase { public: wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) : wxSTCCallTipBase(parent, param2), - m_ct(ct), m_swx(swx) + m_ct(ct), m_swx(swx), m_cx(-1), m_cy(-1) { } ~wxSTCCallTip() { #if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__) wxRect rect = GetRect(); - GetParent()->ScreenToClient(&rect.x, &rect.y); + rect.x = m_cx; + rect.y = m_cy; GetParent()->Refresh(false, &rect); #endif } @@ -112,17 +113,26 @@ public: virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { - if (x != -1) + if (x != -1) { + m_cx = x; GetParent()->ClientToScreen(&x, NULL); - if (y != -1) + } + if (y != -1) { + m_cy = y; GetParent()->ClientToScreen(NULL, &y); + } wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags); } #endif + wxPoint GetMyPosition() { + return wxPoint(m_cx, m_cy); + } + private: CallTip* m_ct; ScintillaWX* m_swx; + int m_cx, m_cy; DECLARE_EVENT_TABLE() }; @@ -926,10 +936,10 @@ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) { rgn.Subtract(childRect); } if (ct.inCallTipMode) { - wxWindow* tip = (wxWindow*)ct.wCallTip.GetID(); + wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID(); wxRect childRect = tip->GetRect(); #if wxUSE_POPUPWIN && wxSTC_USE_POPUP - tip->GetParent()->ScreenToClient(&childRect.x, &childRect.y); + childRect.SetPosition(tip->GetMyPosition()); #endif rgn.Subtract(childRect); } -- 2.45.2