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
This commit is contained in:
Robin Dunn
2004-06-09 22:19:57 +00:00
parent 329ac7daeb
commit 8a79319461
2 changed files with 26 additions and 4 deletions

View File

@@ -67,6 +67,8 @@ void wxSTCDropTarget::OnLeave() {
#define param2 -1 // wxWindow's 2nd param is ID
#endif
#include <wx/dcbuffer.h>
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);
}