def draw_groove(self, dc): rect = self.groove_rect rect.Inflate(0, 1) dc.Pen = wx.BLACK_PEN dc.Brush = wx.WHITE_BRUSH dc.DrawRectangle(rect.Left, rect.Top, rect.width, rect.height) rect.Deflate(1, 1) rect = draw_bevel(dc, rect, 2, BV_DOWN) sep_y = self.get_mark_y(self.value) rtop = wx.Rect(rect.Left, rect.Top, rect.width, sep_y - rect.Top) dc.Pen = wx.BLACK_PEN dc.Brush = wx.GREEN_BRUSH dc.DrawRectangle(rtop.x, rtop.y, rtop.width, rtop.height) dc.Brush = wx.WHITE_BRUSH dc.DrawRectangle(rect.Left, sep_y, rect.width, rect.Bottom - sep_y)
def draw_groove(self,dc): rect = self.groove_rect rect.Inflate(0,1) dc.Pen = wx.BLACK_PEN dc.Brush = wx.WHITE_BRUSH dc.DrawRectangle(rect.Left,rect.Top,rect.width,rect.height) rect.Deflate(1,1) rect = draw_bevel(dc,rect,2,BV_DOWN) sep_y = self.get_mark_y(self.value) rtop = wx.Rect(rect.Left,rect.Top,rect.width,sep_y-rect.Top) dc.Pen = wx.BLACK_PEN dc.Brush = wx.GREEN_BRUSH dc.DrawRectangle(rtop.x,rtop.y,rtop.width,rtop.height) dc.Brush = wx.WHITE_BRUSH dc.DrawRectangle(rect.Left, sep_y, rect.width, rect.Bottom-sep_y)
def Draw(self, grid, attr, dc, rect, row, col, isSelected): dc.SetClippingRect(rect) dc.Clear() dc.DestroyClippingRegion() bitmap = self.get_bitmap(grid, attr, dc, row, col) state = self.get_state(grid, row, col) if state != None: bv = ((state == BU_NORMAL and BV_UP) or BV_DOWN) rect = draw_bevel(dc, rect, self.__bevel_width, bv) else: bw = self.__bevel_width rect = wx.Rect(rect.Left+bw, rect.Top+bw, rect.width-2*bw, rect.height-2*bw) dc.SetClippingRect(rect) if bitmap: dc.DrawBitmap(bitmap, rect.Left, rect.Top,True) dc.DestroyClippingRegion()
def Draw(self, grid, attr, dc, rect, row, col, isSelected): dc.SetClippingRect(rect) dc.Clear() dc.DestroyClippingRegion() bitmap = self.get_bitmap(grid, attr, dc, row, col) state = self.get_state(grid, row, col) if state is not None: bv = ((state == BU_NORMAL and BV_UP) or BV_DOWN) rect = draw_bevel(dc, rect, self.__bevel_width, bv) else: bw = self.__bevel_width rect = wx.Rect(rect.Left + bw, rect.Top + bw, rect.width - 2 * bw, rect.height - 2 * bw) dc.SetClippingRect(rect) if bitmap: dc.DrawBitmap(bitmap, rect.Left, rect.Top, True) dc.DestroyClippingRegion()