Hello,
I would like to know for which purpose one would call the SetClippingRegion before the blit method when the Blit method already defines a rect. such in the following lines:
else: mdc.SetBackground(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))) mdc.Clear() self.DrawProgressBar(mdc, 0, 0, rect.width, rect.height, self.progressValue) mdc.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) text = "%d Mb"%self.progressValue textWidth, dummy = mdc.GetTextExtent(text) mdc.DrawText(text, rect.width//2 - textWidth//2, rect.height//2 - dummy//2) dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height) dc.Blit(rect.x+3, rect.y, rect.width-6, rect.height, mdc, 0, 0) dc.DestroyClippingRegion() def GetLineHeight(self): return PIPE_HEIGHT + 6 def GetSubItemWidth(self):
Is it to speed it up?