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

Method populatePanel

gui/builtinStatsViews/priceViewFull.py:42–82  ·  view source on GitHub ↗
(self, contentPanel, headerPanel)

Source from the content-addressed store, hash-verified

40 return _t("Price")
41
42 def populatePanel(self, contentPanel, headerPanel):
43 contentSizer = contentPanel.GetSizer()
44 self.panel = contentPanel
45 self.headerPanel = headerPanel
46
47 headerContentSizer = wx.BoxSizer(wx.HORIZONTAL)
48 hsizer = headerPanel.GetSizer()
49 hsizer.Add(headerContentSizer, 0, 0, 0)
50 self.labelEMStatus = wx.StaticText(headerPanel, wx.ID_ANY, "")
51 headerContentSizer.Add(self.labelEMStatus)
52 headerPanel.GetParent().AddToggleItem(self.labelEMStatus)
53
54 gridPrice = wx.GridSizer(2, 3, 0, 0)
55 contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0)
56 for _type, label in (
57 ("ship", _t("Ship")), ("fittings", _t("Fittings")), ("character", _t("Character")),
58 ("drones", _t("Drones")), ("cargoBay", _t("Cargo bay")), ("total", _t("Total"))
59 ):
60 if _type in "ship":
61 image = "ship_big"
62 elif _type in ("fittings", "total"):
63 image = "%sPrice_big" % _type
64 else:
65 image = "%s_big" % _type
66
67 box = wx.BoxSizer(wx.HORIZONTAL)
68 gridPrice.Add(box, 0, wx.ALIGN_TOP)
69
70 box.Add(BitmapLoader.getStaticBitmap(image, contentPanel, "gui"), 0, wx.ALIGN_CENTER)
71
72 vbox = wx.BoxSizer(wx.VERTICAL)
73 box.Add(vbox, 1, wx.EXPAND)
74
75 vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label.capitalize()), 0, wx.ALIGN_LEFT)
76
77 hbox = wx.BoxSizer(wx.HORIZONTAL)
78 vbox.Add(hbox)
79
80 lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.00 ISK")
81 setattr(self, "labelPrice%s" % _type.capitalize(), lbl)
82 hbox.Add(lbl, 0, wx.ALIGN_LEFT)
83
84 def refreshPanel(self, fit):
85 if fit is not None:

Callers

nothing calls this directly

Calls 3

AddToggleItemMethod · 0.80
getStaticBitmapMethod · 0.80
_tFunction · 0.50

Tested by

no test coverage detected