(self, contentPanel, headerPanel)
| 88 | return width |
| 89 | |
| 90 | def populatePanel(self, contentPanel, headerPanel): |
| 91 | |
| 92 | contentSizer = contentPanel.GetSizer() |
| 93 | root = wx.BoxSizer(wx.VERTICAL) |
| 94 | contentSizer.Add(root, 0, wx.EXPAND, 0) |
| 95 | |
| 96 | sizer = wx.BoxSizer(wx.HORIZONTAL) |
| 97 | root.Add(sizer, 0, wx.EXPAND) |
| 98 | root.Add(wx.StaticLine(contentPanel, wx.ID_ANY, style=wx.HORIZONTAL), 0, wx.EXPAND) |
| 99 | |
| 100 | sizerResources = wx.BoxSizer(wx.HORIZONTAL) |
| 101 | root.Add(sizerResources, 1, wx.EXPAND, 0) |
| 102 | |
| 103 | parent = self.panel = contentPanel |
| 104 | self.headerPanel = headerPanel |
| 105 | panel = "full" |
| 106 | |
| 107 | base = sizerResources |
| 108 | sizer.AddStretchSpacer() |
| 109 | # Turrets & launcher hardslots display |
| 110 | tooltipText = { |
| 111 | "turret": _t("Turret hardpoints"), |
| 112 | "launcher": _t("Launcher hardpoints"), |
| 113 | "drones": _t("Drones active"), |
| 114 | "fighter": _t("Fighter squadrons active"), |
| 115 | "calibration": _t("Calibration") |
| 116 | } |
| 117 | for type_ in ("turret", "launcher", "drones", "fighter", "calibration"): |
| 118 | box = wx.BoxSizer(wx.HORIZONTAL) |
| 119 | |
| 120 | bitmap = BitmapLoader.getStaticBitmap("%s_big" % type_, parent, "gui") |
| 121 | tooltip = wx.ToolTip(tooltipText[type_]) |
| 122 | bitmap.SetToolTip(tooltip) |
| 123 | |
| 124 | box.Add(bitmap, 0, wx.ALIGN_CENTER) |
| 125 | |
| 126 | sizer.Add(box, 0, wx.ALIGN_CENTER) |
| 127 | |
| 128 | suffix = { |
| 129 | 'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes', |
| 130 | 'calibration': 'Points' |
| 131 | } |
| 132 | lbl = wx.StaticText(parent, wx.ID_ANY, "0") |
| 133 | setattr(self, "label%sUsed%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), lbl) |
| 134 | box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5) |
| 135 | |
| 136 | box.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER) |
| 137 | |
| 138 | lbl = wx.StaticText(parent, wx.ID_ANY, "0") |
| 139 | setattr(self, "label%sTotal%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), |
| 140 | lbl) |
| 141 | box.Add(lbl, 0, wx.ALIGN_CENTER) |
| 142 | setattr(self, "boxSizer{}".format(type_.capitalize()), box) |
| 143 | |
| 144 | # Hack - We add a spacer after each thing, but we are always hiding something. The spacer is stil there. |
| 145 | # This way, we only have one space after the drones/fighters |
| 146 | if type_ != "drones": |
| 147 | sizer.AddStretchSpacer() |
nothing calls this directly
no test coverage detected