MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / OnWindowPaint

Method OnWindowPaint

gui/chrome_tabs.py:1502–1526  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

1500 pass
1501
1502 def OnWindowPaint(self, event):
1503 rect = self.GetRect()
1504 canvas = wx.Bitmap(round(rect.width), round(rect.height))
1505 mdc = wx.BufferedPaintDC(self)
1506 mdc.SelectObject(canvas)
1507 color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
1508 mdc.SetBackground(wx.Brush(color))
1509 mdc.Clear()
1510
1511 font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)
1512 mdc.SetFont(font)
1513
1514 x, y = mdc.GetTextExtent(self.title)
1515
1516 mdc.SetBrush(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)))
1517 mdc.DrawRectangle(0, 0, round(rect.width), 16)
1518
1519 mdc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
1520
1521 mdc.DrawBitmap(self.bitmap, 0, 16)
1522
1523 mdc.SetPen(wx.Pen("#000000", width=1))
1524 mdc.SetBrush(wx.TRANSPARENT_BRUSH)
1525
1526 mdc.DrawRectangle(0, 16, round(rect.width), round(rect.height - 16))

Callers

nothing calls this directly

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected