Expose SetClippingRegion(point, size)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-11-28 18:42:44 +00:00
parent c9c106fde5
commit 4da6d35e8f
5 changed files with 11 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ class TestWindow(wxScrolledWindow):
if not dc: if not dc:
dc = wxClientDC(self) dc = wxClientDC(self)
rect = self.GetUpdateRegion().GetBox() rect = self.GetUpdateRegion().GetBox()
dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height) dc.SetClippingRect(rect)
self.TileBackground(dc) self.TileBackground(dc)

View File

@@ -137,7 +137,7 @@ class DragCanvas(wxScrolledWindow):
def EraseShape(self, shape, dc): def EraseShape(self, shape, dc):
r = shape.GetRect() r = shape.GetRect()
dc.SetClippingRegion(r.x, r.y, r.width, r.height) dc.SetClippingRect(r)
self.TileBackground(dc) self.TileBackground(dc)
self.DrawShapes(dc) self.DrawShapes(dc)
dc.DestroyClippingRegion() dc.DestroyClippingRegion()
@@ -148,7 +148,7 @@ class DragCanvas(wxScrolledWindow):
if not dc: if not dc:
dc = wxClientDC(self) dc = wxClientDC(self)
rect = self.GetUpdateRegion().GetBox() rect = self.GetUpdateRegion().GetBox()
dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height) dc.SetClippingRect(rect)
self.TileBackground(dc) self.TileBackground(dc)

View File

@@ -275,6 +275,11 @@ that are affected are listed here::
Blit(destPt, size, sourceDC, srcPt, Blit(destPt, size, sourceDC, srcPt,
rop = wxCOPY, useMask = FALSE, srcPtMask = wx.DefaultPosition) rop = wxCOPY, useMask = FALSE, srcPtMask = wx.DefaultPosition)
SetClippingRegionXY SetClippingRegion(x, y, width, height)
SetClippingRegion(point, size)
SetClippingRect(rect)
SetClippingRegionAsRegion(region);
If you have code that draws on a DC you **will** get errors because of If you have code that draws on a DC you **will** get errors because of
these changes, but it should be easy to fix the code. You can either these changes, but it should be easy to fix the code. You can either

View File

@@ -219,8 +219,8 @@ public:
// clipping region // clipping region
// --------------- // ---------------
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); %name(SetClippingRegionXY)void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
//void SetClippingRegion(const wxPoint& pt, const wxSize& sz) void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
%name(SetClippingRect) void SetClippingRegion(const wxRect& rect); %name(SetClippingRect) void SetClippingRegion(const wxRect& rect);
%name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region); %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);

View File

@@ -61,7 +61,7 @@ class wxRightTextCtrl(wxTextCtrl):
fclr = wxSystemSettings_GetColour(wxSYS_COLOUR_GRAYTEXT) fclr = wxSystemSettings_GetColour(wxSYS_COLOUR_GRAYTEXT)
dc.SetTextForeground(fclr) dc.SetTextForeground(fclr)
dc.SetClippingRegion(0, 0, dcwidth, dcheight) dc.SetClippingRegionXY(0, 0, dcwidth, dcheight)
dc.DrawText(text, x, y) dc.DrawText(text, x, y)
if x < 0: if x < 0: