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

Method __init__

gui/builtinShipBrowser/pfBitmapFrame.py:5–26  ·  view source on GitHub ↗
(self, parent, pos, bitmap)

Source from the content-addressed store, hash-verified

3
4class PFBitmapFrame(wx.Frame):
5 def __init__(self, parent, pos, bitmap):
6 super().__init__(
7 parent, id=wx.ID_ANY, title=wx.EmptyString, pos=pos, size=wx.DefaultSize,
8 style=wx.NO_BORDER | wx.FRAME_NO_TASKBAR | wx.STAY_ON_TOP)
9 img = bitmap.ConvertToImage()
10 img = img.ConvertToGreyscale()
11 bitmap = wx.Bitmap(img)
12 self.bitmap = bitmap
13 self.SetSize((bitmap.GetWidth(), bitmap.GetHeight()))
14 self.Bind(wx.EVT_PAINT, self.OnWindowPaint)
15 self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnWindowEraseBk)
16 self.Bind(wx.EVT_TIMER, self.OnTimer)
17
18 self.timer = wx.Timer(self, wx.ID_ANY)
19 self.direction = 1
20 self.transp = 0
21 self.SetSize((bitmap.GetWidth(), bitmap.GetHeight()))
22
23 self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
24
25 self.SetTransparent(0)
26 self.Refresh()
27
28 def OnTimer(self, event):
29 self.transp += 20 * self.direction

Callers

nothing calls this directly

Calls 4

SetSizeMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected