MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / OnPaint

Method OnPaint

gui/utils/anim.py:55–88  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

53 pass
54
55 def OnPaint(self, event):
56 rect = self.GetClientRect()
57 dc = wx.AutoBufferedPaintDC(self)
58 windowColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
59 dc.SetBackground(wx.Brush(windowColor))
60 dc.Clear()
61
62 barColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
63 shadeColor = colorUtils.GetSuitable(barColor, 0.75)
64
65 barWidth = rect.width / self.bars
66 barHeight = rect.height - self.padding * 2
67
68 x = self.padding
69
70 for bar in range(self.bars):
71 if bar != self.animCount:
72 dc.SetPen(wx.Pen(shadeColor))
73 dc.SetBrush(wx.Brush(shadeColor))
74 bh = barHeight
75 y = self.padding
76 else:
77 barColor = colorUtils.GetSuitable(barColor, float(self.animCount / 2) / 10)
78 dc.SetPen(wx.Pen(barColor))
79 dc.SetBrush(wx.Brush(barColor))
80 bh = rect.height
81 y = 0
82
83 dc.DrawRectangle(round(x), round(y), round(barWidth), round(bh))
84 x += barWidth
85
86 textColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
87 dc.SetTextForeground(textColor)
88 dc.DrawLabel(self.label, rect, wx.ALIGN_CENTER)
89
90
91class WaitDialog(wx.Dialog):

Callers

nothing calls this directly

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected