def OnPaint(self, event):
dc = wx.BufferedPaintDC(self)
dc.Clear()
dc.BeginDrawing()
gc = wx.GCDC(dc)
width, height = self.GetClientSize()
gc.SetPen(wx.Pen(wx.NamedColour("GREY"), 3))
gc.SetBrush(wx.GREY_BRUSH)
gc.DrawLines(ArrowPoints(wx.TOP, width * 0.75, width * 0.5, 2, (width + height) / 4 - 3))
gc.DrawLines(ArrowPoints(wx.TOP, width * 0.75, width * 0.5, 2, (width + height) / 4 + 3))
gc.DrawLines(ArrowPoints(wx.BOTTOM, width * 0.75, width * 0.5, 2, (height * 3 - width) / 4 + 3))
gc.DrawLines(ArrowPoints(wx.BOTTOM, width * 0.75, width * 0.5, 2, (height * 3 - width) / 4 - 3))
thumb_rect = self.GetThumbRect()
exclusion_rect = wx.Rect(thumb_rect.x, thumb_rect.y,
thumb_rect.width, thumb_rect.height)
if self.Parent.IsMessagePanelTop():
exclusion_rect.y, exclusion_rect.height = width, exclusion_rect.y + exclusion_rect.height - width
if self.Parent.IsMessagePanelBottom():
exclusion_rect.height = height - width - exclusion_rect.y
if exclusion_rect != thumb_rect:
colour = wx.NamedColour("LIGHT GREY")
gc.SetPen(wx.Pen(colour))
gc.SetBrush(wx.Brush(colour))
gc.DrawRectangle(exclusion_rect.x, exclusion_rect.y,
exclusion_rect.width, exclusion_rect.height)
gc.SetPen(wx.GREY_PEN)
gc.SetBrush(wx.GREY_BRUSH)
gc.DrawPolygon(ArrowPoints(wx.TOP, width, width, 0, 0))
gc.DrawPolygon(ArrowPoints(wx.BOTTOM, width, width, 0, height))
gc.DrawRectangle(thumb_rect.x, thumb_rect.y,
thumb_rect.width, thumb_rect.height)
dc.EndDrawing()
event.Skip()
评论列表
文章目录