- EVT_CALENDAR_MONTH and EVT_CALENDAR_YEAR events are deprecated,
use EVT_CALENDAR_PAGE_CHANGED which replaces both of them.
- wxCalendarCtrl::EnableYearChange() and wxCAL_NO_YEAR_CHANGE are deprecated.
+ There is no replacement for this functionality, it is being dropped as it is
+ not available in native wxCalendarCtrl implementations.
+- wxDC::SetClippingRegion(const wxRegion&) overload is deprecated as it used
+ different convention from the other SetClippingRegion() overloads: wxRegion
+ passed to it was interpreted in physical, not logical, coordinates. Replace
+ it with SetDeviceClippingRegion() if this was the correct thing to do in your
+ code.
// this is gnarly - we can't even call this function DoSetClippingRegion()
// because of virtual function hiding
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) = 0;
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0;
+
+ // NB: this function works with device coordinates, not the logical ones!
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region) = 0;
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const
{ m_pimpl->DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
void SetClippingRegion(const wxRect& rect)
{ m_pimpl->DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); }
- void SetClippingRegion(const wxRegion& region)
- { m_pimpl->DoSetClippingRegionAsRegion(region); }
+
+ // unlike the functions above, the coordinates of the region used in this
+ // one are in device coordinates, not the logical ones
+ void SetDeviceClippingRegion(const wxRegion& region)
+ { m_pimpl->DoSetDeviceClippingRegion(region); }
+
+ // this function is deprecated because its name is confusing: you may
+ // expect it to work with logical coordinates but, in fact, it does exactly
+ // the same thing as SetDeviceClippingRegion()
+ //
+ // please review the code using it and either replace it with calls to
+ // SetDeviceClippingRegion() or correct it if it was [wrongly] passing
+ // logical coordinates to this function
+ wxDEPRECATED_INLINE(void SetClippingRegion(const wxRegion& region),
+ SetDeviceClippingRegion(region); )
void DestroyClippingRegion()
{ m_pimpl->DestroyClippingRegion(); }
{
public:
wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)
- { dc.SetClippingRegion(r); }
+ { dc.SetClippingRegion(r.GetBox()); }
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
{ dc.SetClippingRegion(r.x, r.y, r.width, r.height); }
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
wxCoord xoffset, wxCoord yoffset,
int fillStyle);
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
Mirror(n, points);
}
- virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region))
+ virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region))
{
wxFAIL_MSG( _T("not implemented") );
}
wxCoord *externalLeading = NULL,
const wxFont *font = NULL) const;
- virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region))
+ virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region))
{
- wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion not yet implemented"));
+ wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetDeviceClippingRegion not yet implemented"));
}
virtual void DoSetClippingRegion( int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height) )
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
- // this is gnarly - we can't even call this function DoSetClippingRegion()
- // because of virtual function hiding
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { }
+ void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip))
+ {
+ wxFAIL_MSG( "not implemented" );
+ }
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = (wxFont *) NULL) const;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
- virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
+ virtual void DoSetDeviceClippingRegion( const wxRegion ®ion );
virtual wxCoord GetCharWidth() const;
virtual wxCoord GetCharHeight() const;
void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
+ void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip) )
+ {
+ wxFAIL_MSG( "not implemented" );
+ }
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent = (wxCoord *) NULL,
wxCoord *externalLeading = (wxCoord *) NULL,
void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
+ void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip) )
+ {
+ wxFAIL_MSG( "not implemented" );
+ }
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent = (wxCoord *) NULL,
wxCoord *externalLeading = (wxCoord *) NULL,
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
virtual void DestroyClippingRegion();
- virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
+ virtual void DoSetDeviceClippingRegion( const wxRegion ®ion );
// Resolution in pixels per logical inch
virtual wxSize GetPPI() const;
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
- // this is gnarly - we can't even call this function DoSetClippingRegion()
- // because of virtual function hiding
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
int rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
- // this is gnarly - we can't even call this function DoSetClippingRegion()
- // because of virtual function hiding
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const;
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
- // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
+ // common part of DoSetClippingRegion() and DoSetDeviceClippingRegion()
void SetClippingHrgn(WXHRGN hrgn);
// implementation of DoGetSize() for wxScreen/PrinterDC: this simply
,wxCoord vYsrcMask = -1
);
- virtual void DoSetClippingRegionAsRegion(const wxRegion& rRegion);
virtual void DoSetClippingRegion( wxCoord vX
,wxCoord vY
,wxCoord vWidth
,wxCoord vHeight
);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& rRegion);
virtual void DoGetSize( int* pWidth
,int* pHeight
int rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
- // this is gnarly - we can't even call this function DoSetClippingRegion()
- // because of virtual function hiding
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const;
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
- // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
- void SetClippingHrgn(WXHRGN hrgn);
-
// implementation of DoGetSize() for wxScreen/PrinterDC: this simply
// returns the size of the entire device this DC is associated with
//
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
- virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
+ virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
wxCoord height);
void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
void SetClippingRegion(const wxRect& rect);
- void SetClippingRegion(const wxRegion& region);
//@}
+ /**
+ Sets the clipping region for this device context.
+
+ Unlike SetClippingRegion(), this function works with physical
+ coordinates and not with the logical ones.
+ */
+ void SetDeviceClippingRegion(const wxRegion& region);
+
/**
Sets the device origin (i.e., the origin in pixels after scaling has
been applied). This function may be useful in Windows printing
}
}
-void wxGCDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion )
+void wxGCDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion )
{
// region is in device coordinates
- wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoSetClippingRegionAsRegion - invalid DC") );
+ wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoSetDeviceClippingRegion - invalid DC") );
if (region.Empty())
{
dc.SelectObject(bmp);
dc.SetBackground(*wxBLACK_BRUSH);
dc.Clear();
- dc.SetClippingRegion(*wx_static_cast(const wxRegion *, this));
+ dc.SetDeviceClippingRegion(*wx_static_cast(const wxRegion *, this));
dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
dc.SelectObject(wxNullBitmap);
m_clipping = true;
}
-void wxDFBDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region)
+void wxDFBDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
{
// NB: this can be done because wxDFB only supports rectangular regions
- GetOwner()->SetClippingRegion(region.AsRect());
+ wxRect rect = region.AsRect();
+
+ // our parameter is in physical coordinates while DoSetClippingRegion()
+ // takes logical ones
+ rect.x = XDEV2LOG(rect.x);
+ rect.y = YDEV2LOG(rect.y);
+ rect.width = XDEV2LOG(rect.width);
+ rect.height = YDEV2LOG(rect.height);
+
+ DoSetClippingRegion(rect);
}
void wxDFBDCImpl::DestroyClippingRegion()
gdk_gc_set_clip_region(m_bgGC, gdkRegion);
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
DO_SET_CLIPPING_BOX(m_currentClippingRegion)
}
-void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
+void wxDC::DoSetDeviceClippingRegion(const wxRegion& region)
{
wxCHECK_RET( Ok(), wxT("invalid dc") );
}
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region )
{
SetDCClipping(region.GetX11Region());
wxRect box = region.GetBox();
XRectangle rects[1];
- rects[0].x = (short)XLOG2DEV_2(box.x);
- rects[0].y = (short)YLOG2DEV_2(box.y);
- rects[0].width = (unsigned short)XLOG2DEVREL(box.width);
- rects[0].height = (unsigned short)YLOG2DEVREL(box.height);
+ rects[0].x = (short)box.x;
+ rects[0].y = (short)box.y;
+ rects[0].width = (unsigned short)box.width;
+ rects[0].height = (unsigned short)box.height;
XSetClipRectangles((Display*) m_display, (GC) m_gcBacking,
0, 0, rects, 1, Unsorted);
}
wxDCImpl::DoGetClippingBox(x, y, w, h);
}
-// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
+// common part of DoSetClippingRegion() and DoSetDeviceClippingRegion()
void wxMSWDCImpl::SetClippingHrgn(WXHRGN hrgn)
{
wxCHECK_RET( hrgn, wxT("invalid clipping region") );
}
}
-void wxMSWDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region)
+void wxMSWDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
{
SetClippingHrgn(region.GetHRGN());
}
DO_SET_CLIPPING_BOX()
} // end of wxPMDCImpl::DoSetClippingRegion
-void wxPMDCImpl::DoSetClippingRegionAsRegion(
+void wxPMDCImpl::DoSetDeviceClippingRegion(
const wxRegion& rRegion
)
{
,&hRgnOld
);
DO_SET_CLIPPING_BOX()
-} // end of wxPMDCImpl::DoSetClippingRegionAsRegion
+} // end of wxPMDCImpl::DoSetDeviceClippingRegion
void wxPMDCImpl::DestroyClippingRegion(void)
{
{
}
-// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
-void wxPalmDCImpl::SetClippingHrgn(WXHRGN hrgn)
-{
- wxCHECK_RET( hrgn, wxT("invalid clipping region") );
-}
-
void wxPalmDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{
}
-void wxPalmDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region)
+void wxPalmDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
{
}
XSetRegion( (Display*) m_display, (GC) m_bgGC, (Region) m_currentClippingRegion.GetX11Region() );
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );