made GetClippingBox() work even for clipping region (pre)set by Windows and not only for clipping regions set using our own SetClippingXXX() functions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-05-05 22:41:54 +00:00
parent 55e9fa681e
commit 2e76da5450
2 changed files with 27 additions and 1 deletions

View File

@@ -383,6 +383,23 @@ void wxDC::UpdateClipBox()
m_clipY2 = (wxCoord) YDEV2LOG(rect.bottom);
}
void
wxDC::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
{
// check if we should try to retrieve the clipping region possibly not set
// by our SetClippingRegion() but preset by Windows:this can only happen
// when we're associated with an existing HDC usign SetHDC(), see there
if ( m_clipping && !m_clipX1 && !m_clipX2 )
{
UpdateClipBox();
if ( !m_clipX1 && !m_clipX2 )
m_clipping = false;
}
return wxDCBase::DoGetClippingBox(x, y, w, h);
}
// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
void wxDC::SetClippingHrgn(WXHRGN hrgn)
{
@@ -465,7 +482,7 @@ void wxDC::DestroyClippingRegion()
::DeleteObject(rgn);
}
m_clipping = false;
wxDCBase::DestroyClippingRegion();
}
// ---------------------------------------------------------------------------