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

Method __init__

gui/builtinAdditionPanes/fighterView.py:66–99  ·  view source on GitHub ↗
(self, parent)

Source from the content-addressed store, hash-verified

64class FighterView(wx.Panel):
65
66 def __init__(self, parent):
67 wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL)
68 self.mainFrame = gui.mainFrame.MainFrame.getInstance()
69 self.labels = [("Light", _t("Light")), ("Heavy", _t("Heavy")), ("Support", _t("Support"))]
70
71 mainSizer = wx.BoxSizer(wx.VERTICAL)
72
73 self.fighterDisplay = FighterDisplay(self)
74 mainSizer.Add(self.fighterDisplay, 1, wx.EXPAND, 0)
75
76 textSizer = wx.BoxSizer(wx.HORIZONTAL)
77 textSizer.AddStretchSpacer()
78
79 for attr, label in self.labels:
80 lbl = wx.StaticText(self, wx.ID_ANY, label)
81 textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
82
83 lbl = wx.StaticText(self, wx.ID_ANY, "0")
84 setattr(self, "label%sUsed" % attr, lbl)
85 textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
86
87 textSizer.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)
88
89 lbl = wx.StaticText(self, wx.ID_ANY, "0")
90 setattr(self, "label%sTotal" % attr, lbl)
91 textSizer.Add(lbl, 0, wx.ALIGN_CENTER)
92 textSizer.AddStretchSpacer()
93
94 mainSizer.Add(textSizer, 0, wx.EXPAND, 5)
95
96 self.SetSizer(mainSizer)
97 self.SetAutoLayout(True)
98
99 self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
100
101 def fitChanged(self, event):
102 event.Skip()

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 3

FighterDisplayClass · 0.85
_tFunction · 0.50
getInstanceMethod · 0.45

Tested by

no test coverage detected