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

Method populatePanel

gui/builtinStatsViews/firepowerViewFull.py:49–119  ·  view source on GitHub ↗
(self, contentPanel, headerPanel)

Source from the content-addressed store, hash-verified

47 return width
48
49 def populatePanel(self, contentPanel, headerPanel):
50 contentSizer = contentPanel.GetSizer()
51 parent = self.panel = contentPanel
52
53 self.headerPanel = headerPanel
54 hsizer = self.headerPanel.Parent.GetHeaderContentSizer()
55 self.stEff = wx.StaticText(self.headerPanel, wx.ID_ANY, "( Effective )")
56 hsizer.Insert(0, self.stEff)
57
58 panel = "full"
59
60 sizerFirepower = wx.FlexGridSizer(1, 4, 0, 0)
61 sizerFirepower.AddGrowableCol(1)
62
63 contentSizer.Add(sizerFirepower, 0, wx.EXPAND, 0)
64
65 counter = 0
66
67 for label, image, attr in ((_t("Weapon"), "turret", "Weapon"), (_t("Drone"), "droneDPS", "Drone")):
68 baseBox = wx.BoxSizer(wx.HORIZONTAL)
69 sizerFirepower.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL)
70
71 baseBox.Add(BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER)
72
73 box = wx.BoxSizer(wx.VERTICAL)
74 baseBox.Add(box, 0, wx.ALIGN_CENTER)
75
76 box.Add(wx.StaticText(parent, wx.ID_ANY, label), 0, wx.ALIGN_LEFT)
77
78 hbox = wx.BoxSizer(wx.HORIZONTAL)
79 box.Add(hbox, 1, wx.ALIGN_CENTER)
80
81 lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS")
82 setattr(self, "label%sDps%s" % (panel.capitalize(), attr), lbl)
83
84 hbox.Add(lbl, 0, wx.ALIGN_CENTER)
85 self._cachedValues.append(0)
86 counter += 1
87 targetSizer = sizerFirepower
88
89 baseBox = wx.BoxSizer(wx.HORIZONTAL)
90 targetSizer.Add(baseBox, 0, wx.ALIGN_RIGHT)
91
92 baseBox.Add(BitmapLoader.getStaticBitmap("volley_big", parent, "gui"), 0, wx.ALIGN_CENTER)
93
94 gridS = wx.GridSizer(2, 2, 0, 0)
95
96 baseBox.Add(gridS, 0)
97
98 lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
99 setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl)
100 gridS.Add(wx.StaticText(parent, wx.ID_ANY, _t(" Volley: ")), 0, wx.ALL | wx.ALIGN_RIGHT)
101 gridS.Add(lbl, 0, wx.ALIGN_LEFT)
102
103 self._cachedValues.append(0)
104
105 lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
106 setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl)

Callers 1

Calls 5

GetHeaderContentSizerMethod · 0.80
getStaticBitmapMethod · 0.80
_tFunction · 0.50
appendMethod · 0.45
getBitmapMethod · 0.45

Tested by

no test coverage detected