def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel sizerTankStats = wx.FlexGridSizer(3, 5) for i in range(4): sizerTankStats.AddGrowableCol(i + 1) contentSizer.Add(sizerTankStats, 0, wx.EXPAND, 0) # Add an empty label first for correct alignment. sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0) toolTipText = { "shieldPassive": "Passive shield recharge", "shieldActive": "Active shield boost", "armorActive": "Armor repair amount", "hullActive": "Hull repair amount" } for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"): bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[tankType]) bitmap.SetToolTip(tooltip) sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER) toolTipText = {"reinforced": "Reinforced", "sustained": "Sustained"} for stability in ("reinforced", "sustained"): bitmap = BitmapLoader.getStaticBitmap( "regen%s_big" % stability.capitalize(), contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[stability]) bitmap.SetToolTip(tooltip) sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER) for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"): if stability == "reinforced" and tankType == "shieldPassive": sizerTankStats.Add( wx.StaticText(contentPanel, wx.ID_ANY, "")) continue tankTypeCap = tankType[0].capitalize() + tankType[1:] lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.0", style=wx.ALIGN_RIGHT) setattr( self, "labelTank%s%s" % (stability.capitalize(), tankTypeCap), lbl) box = wx.BoxSizer(wx.HORIZONTAL) box.Add(lbl, 0, wx.EXPAND) box.Add(wx.StaticText(contentPanel, wx.ID_ANY, " HP/s"), 0, wx.EXPAND) sizerTankStats.Add(box, 0, wx.ALIGN_CENTRE) contentPanel.Layout()
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel headerContentSizer = wx.BoxSizer(wx.HORIZONTAL) hsizer = headerPanel.GetSizer() hsizer.Add(headerContentSizer, 0, 0, 0) self.labelEMStatus = wx.StaticText(headerPanel, wx.ID_ANY, "") headerContentSizer.Add(self.labelEMStatus) headerPanel.GetParent().AddToggleItem(self.labelEMStatus) gridPrice = wx.GridSizer(1, 3) contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0) for type in ("ship", "fittings", "total"): image = "%sPrice_big" % type if type != "ship" else "ship_big" box = wx.BoxSizer(wx.HORIZONTAL) gridPrice.Add(box, 0, wx.ALIGN_TOP) box.Add(BitmapLoader.getStaticBitmap(image, contentPanel, "gui"), 0, wx.ALIGN_CENTER) vbox = wx.BoxSizer(wx.VERTICAL) box.Add(vbox, 1, wx.EXPAND) vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, type.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(hbox) lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.00 ISK") setattr(self, "labelPrice%s" % type.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel headerContentSizer = wx.BoxSizer(wx.HORIZONTAL) hsizer = headerPanel.GetSizer() hsizer.Add(headerContentSizer, 0, 0, 0) self.labelEMStatus = wx.StaticText(headerPanel, wx.ID_ANY, "") headerContentSizer.Add(self.labelEMStatus) headerPanel.GetParent().AddToggleItem(self.labelEMStatus) gridPrice = wx.GridSizer(1, 3) contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0) for type in ("ship", "fittings", "total"): image = "%sPrice_big" % type if type != "ship" else "ship_big" box = wx.BoxSizer(wx.HORIZONTAL) gridPrice.Add(box, 0, wx.ALIGN_TOP) box.Add(BitmapLoader.getStaticBitmap(image, contentPanel, "gui"), 0, wx.ALIGN_CENTER) vbox = wx.BoxSizer(wx.VERTICAL) box.Add(vbox, 1, wx.EXPAND) vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, type.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(hbox) lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.00 ISK") setattr(self, "labelPrice%s" % type.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel sizerTankStats = wx.FlexGridSizer(3, 5) for i in range(4): sizerTankStats.AddGrowableCol(i + 1) contentSizer.Add(sizerTankStats, 0, wx.EXPAND, 0) # Add an empty label first for correct alignment. sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0) toolTipText = {"shieldPassive": "Passive shield recharge", "shieldActive": "Active shield boost", "armorActive": "Armor repair amount", "hullActive": "Hull repair amount"} for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"): bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[tankType]) bitmap.SetToolTip(tooltip) sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER) toolTipText = {"reinforced": "Reinforced", "sustained": "Sustained"} for stability in ("reinforced", "sustained"): bitmap = BitmapLoader.getStaticBitmap("regen%s_big" % stability.capitalize(), contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[stability]) bitmap.SetToolTip(tooltip) sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER) for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"): if stability == "reinforced" and tankType == "shieldPassive": sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, "")) continue tankTypeCap = tankType[0].capitalize() + tankType[1:] lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.0", style=wx.ALIGN_RIGHT) setattr(self, "labelTank%s%s" % (stability.capitalize(), tankTypeCap), lbl) box = wx.BoxSizer(wx.HORIZONTAL) box.Add(lbl, 0, wx.EXPAND) unitlbl = wx.StaticText(contentPanel, wx.ID_ANY, " EHP/s") setattr(self, "unitLabelTank%s%s" % (stability.capitalize(), tankTypeCap), unitlbl) box.Add(unitlbl, 0, wx.EXPAND) sizerTankStats.Add(box, 0, wx.ALIGN_CENTRE) contentPanel.Layout()
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel sizerOutgoing = wx.GridSizer(1, 4) contentSizer.Add(sizerOutgoing, 0, wx.EXPAND, 0) counter = 0 rr_list = [ ("RemoteCapacitor", "Capacitor:", "capacitorInfo", "Capacitor GJ/s per second transferred remotely."), ("RemoteShield", "Shield:", "shieldActive", "Shield hitpoints per second repaired remotely."), ("RemoteArmor", "Armor:", "armorActive", "Armor hitpoints per second repaired remotely."), ("RemoteHull", "Hull:", "hullActive", "Hull hitpoints per second repaired remotely."), ] for outgoingType, label, image, tooltip in rr_list: baseBox = wx.BoxSizer(wx.VERTICAL) baseBox.Add( BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER) if "Capacitor" in outgoingType: lbl = wx.StaticText(parent, wx.ID_ANY, u"0 GJ/s") else: lbl = wx.StaticText(parent, wx.ID_ANY, u"0 HP/s") lbl.SetToolTip(wx.ToolTip(tooltip)) setattr(self, "label%s" % outgoingType, lbl) baseBox.Add(lbl, 0, wx.ALIGN_CENTER) self._cachedValues.append(0) counter += 1 sizerOutgoing.Add(baseBox, 1, wx.ALIGN_LEFT)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() root = wx.BoxSizer(wx.VERTICAL) contentSizer.Add(root, 0, wx.EXPAND, 0) sizer = wx.BoxSizer(wx.HORIZONTAL) root.Add(sizer, 0, wx.EXPAND) root.Add(wx.StaticLine(contentPanel, wx.ID_ANY, style=wx.HORIZONTAL), 0, wx.EXPAND) sizerResources = wx.BoxSizer(wx.HORIZONTAL) root.Add(sizerResources, 1, wx.EXPAND, 0) parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" base = sizerResources sizer.AddSpacer((0, 0), 1, wx.EXPAND, 5) #Turrets & launcher hardslots display tooltipText = {"turret":"Turret hardpoints", "launcher":"Launcher hardpoints", "drones":"Drones active", "fighter": "Fighter squadrons active", "calibration":"Calibration"} for type in ("turret", "launcher", "drones", "fighter", "calibration"): box = wx.BoxSizer(wx.HORIZONTAL) bitmap = BitmapLoader.getStaticBitmap("%s_big" % type, parent, "gui") tooltip = wx.ToolTip(tooltipText[type]) bitmap.SetToolTip(tooltip) box.Add(bitmap, 0, wx.ALIGN_CENTER) sizer.Add(box, 0, wx.ALIGN_CENTER) suffix = {'turret':'Hardpoints', 'launcher':'Hardpoints', 'drones':'Active', 'fighter':'Tubes', 'calibration':'Points'} lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sUsed%s%s" % (panel.capitalize(), type.capitalize(), suffix[type].capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5) box.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sTotal%s%s" % (panel.capitalize(), type.capitalize(), suffix[type].capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER) setattr(self, "boxSizer{}".format(type.capitalize()), box) # Hack - We add a spacer after each thing, but we are always hiding something. The spacer is stil there. # This way, we only have one space after the drones/fighters if type != "drones": sizer.AddSpacer((0, 0), 1, wx.EXPAND, 5) #PG, Cpu & drone stuff tooltipText = {"cpu":"CPU", "pg":"PowerGrid", "droneBay":"Drone bay", "fighterBay": "Fighter bay", "droneBandwidth":"Drone bandwidth", "cargoBay":"Cargo bay"} for i, group in enumerate((("cpu", "pg"), ("cargoBay", "droneBay", "fighterBay", "droneBandwidth"))): main = wx.BoxSizer(wx.VERTICAL) base.Add(main, 1 , wx.ALIGN_CENTER) for type in group: capitalizedType = type[0].capitalize() + type[1:] bitmap = BitmapLoader.getStaticBitmap(type + "_big", parent, "gui") tooltip = wx.ToolTip(tooltipText[type]) bitmap.SetToolTip(tooltip) stats = wx.BoxSizer(wx.VERTICAL) absolute = wx.BoxSizer(wx.HORIZONTAL) stats.Add(absolute, 0, wx.EXPAND) b = wx.BoxSizer(wx.HORIZONTAL) main.Add(b, 1, wx.ALIGN_CENTER) b.Add(bitmap, 0, wx.ALIGN_BOTTOM) b.Add(stats, 1, wx.EXPAND) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sUsed%s" % (panel.capitalize(), capitalizedType), lbl) absolute.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3) absolute.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_LEFT) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr(self, "label%sTotal%s" % (panel.capitalize(), capitalizedType), lbl) absolute.Add(lbl, 0, wx.ALIGN_LEFT) units = {"cpu":" tf", "pg":" MW", "droneBandwidth":" mbit/s", "droneBay":u" m\u00B3", "fighterBay":u" m\u00B3", "cargoBay":u" m\u00B3"} lbl = wx.StaticText(parent, wx.ID_ANY, "%s" % units[type]) absolute.Add(lbl, 0, wx.ALIGN_LEFT) # Gauges modif. - Darriele gauge = PG.PyGauge(parent, wx.ID_ANY, 1) gauge.SetValueRange(0, 0) gauge.SetMinSize((self.getTextExtentW("1.999M/1.99M MW"), 23)) gauge.SetFractionDigits(2) setattr(self, "gauge%s%s" % (panel.capitalize(),capitalizedType), gauge) stats.Add(gauge, 0, wx.ALIGN_CENTER) setattr(self, "base%s%s" % (panel.capitalize(), capitalizedType), b) setattr(self, "bitmap%s%s" % (panel.capitalize(), capitalizedType), bitmap) self.toggleContext("drone")
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" sizerCapacitor = wx.GridSizer(1, 2) contentSizer.Add(sizerCapacitor, 0, wx.EXPAND, 0) # Capacitor capacity and time baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerCapacitor.Add(baseBox, 0, wx.ALIGN_LEFT) bitmap = BitmapLoader.getStaticBitmap("capacitorInfo_big", parent, "gui") tooltip = wx.ToolTip("Capacitor stability") bitmap.SetToolTip(tooltip) baseBox.Add(bitmap, 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 0, wx.ALIGN_LEFT) hbox.Add(wx.StaticText(parent, wx.ID_ANY, "Total: "), 0, wx.ALIGN_LEFT | wx.LEFT, 3) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorCapacity" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) hbox.Add(wx.StaticText(parent, wx.ID_ANY, " GJ"), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 0, wx.ALIGN_LEFT) lbl = wx.StaticText(parent, wx.ID_ANY, "Lasts ") hbox.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3) setattr(self, "label%sCapacitorState" % panel.capitalize(), lbl) lbl = wx.StaticText(parent, wx.ID_ANY, "0s") setattr(self, "label%sCapacitorTime" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) # Capacitor balance baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerCapacitor.Add(baseBox, 0, wx.ALIGN_CENTER_HORIZONTAL) tooltip = wx.ToolTip("Capacitor throughput") bitmap = BitmapLoader.getStaticBitmap("capacitorRecharge_big", parent, "gui") bitmap.SetToolTip(tooltip) baseBox.Add(bitmap, 0, wx.ALIGN_CENTER) # Recharge chargeSizer = wx.FlexGridSizer(2, 3) baseBox.Add(chargeSizer, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, "+ "), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorRecharge" % panel.capitalize(), lbl) chargeSizer.Add(lbl, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, " GJ/s"), 0, wx.ALIGN_CENTER) # Discharge chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, "- "), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorDischarge" % panel.capitalize(), lbl) chargeSizer.Add(lbl, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, " GJ/s"), 0, wx.ALIGN_CENTER)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" sizerMiningYield = wx.FlexGridSizer(1, 4) sizerMiningYield.AddGrowableCol(1) contentSizer.Add(sizerMiningYield, 0, wx.EXPAND, 0) counter = 0 for miningType, image in (("miner", "mining"), ("drone", "drones")): baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerMiningYield.Add( baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL) baseBox.Add( BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_CENTER) box.Add(wx.StaticText(parent, wx.ID_ANY, miningType.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s") setattr( self, "label%sminingyield%s" % (panel.capitalize(), miningType.capitalize()), lbl) hbox.Add(lbl, 0, wx.ALIGN_CENTER) self._cachedValues.append(0) counter += 1 targetSizer = sizerMiningYield baseBox = wx.BoxSizer(wx.HORIZONTAL) targetSizer.Add(baseBox, 0, wx.ALIGN_LEFT) baseBox.Add( BitmapLoader.getStaticBitmap("cargoBay_big", parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.EXPAND) box.Add(wx.StaticText(parent, wx.ID_ANY, "Total"), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.EXPAND) lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s") setattr(self, "label%sminingyieldTotal" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) self._cachedValues.append(0) image = BitmapLoader.getBitmap("turret_small", "gui") firepower = wx.BitmapButton(contentPanel, -1, image) firepower.SetToolTip(wx.ToolTip("Click to toggle to Firepower View")) firepower.Bind(wx.EVT_BUTTON, self.switchToFirepowerView) sizerMiningYield.Add(firepower, 0, wx.ALIGN_LEFT) self._cachedValues.append(0)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel # Custom header EHP headerContentSizer = wx.BoxSizer(wx.HORIZONTAL) hsizer = headerPanel.GetSizer() hsizer.Add(headerContentSizer, 0, 0, 0) self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "( Effective HP: ") headerContentSizer.Add(self.stEff) headerPanel.GetParent().AddToggleItem(self.stEff) self.labelEhp = wx.StaticText(headerPanel, wx.ID_ANY, "0") headerContentSizer.Add(self.labelEhp, 0) headerPanel.GetParent().AddToggleItem(self.labelEhp) stCls = wx.StaticText(headerPanel, wx.ID_ANY, " )") headerPanel.GetParent().AddToggleItem(stCls) headerContentSizer.Add(stCls) # headerContentSizer.Add(wx.StaticLine(headerPanel, wx.ID_ANY), 1, wx.ALIGN_CENTER) # Display table col = 0 row = 0 sizerResistances = wx.GridBagSizer() contentSizer.Add(sizerResistances, 0, wx.EXPAND, 0) # Add an empty label, then the rest. sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition(row, col), wx.GBSpan(1, 1)) col += 1 toolTipText = { "em": "Electromagnetic resistance", "thermal": "Thermal resistance", "kinetic": "Kinetic resistance", "explosive": "Explosive resistance" } for damageType in ("em", "thermal", "kinetic", "explosive"): bitmap = BitmapLoader.getStaticBitmap("%s_big" % damageType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[damageType]) bitmap.SetToolTip(tooltip) sizerResistances.Add(bitmap, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER) col += 1 self.stEHPs = wx.Button(contentPanel, style=wx.BU_EXACTFIT, label="EHP") self.stEHPs.SetToolTip( wx.ToolTip("Click to toggle between effective HP and raw HP")) self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP) for i in xrange(4): sizerResistances.AddGrowableCol(i + 1) sizerResistances.Add(self.stEHPs, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER) col = 0 row += 1 gaugeColours = (((38, 133, 198), (52, 86, 98)), ((198, 38, 38), (83, 65, 67)), ((163, 163, 163), (74, 90, 93)), ((198, 133, 38), (81, 83, 67))) toolTipText = { "shield": "Shield resistance", "armor": "Armor resistance", "hull": "Hull resistance", "damagePattern": "Incoming damage pattern" } for tankType in ("shield", "armor", "hull", "separator", "damagePattern"): if tankType != "separator": bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[tankType]) bitmap.SetToolTip(tooltip) sizerResistances.Add(bitmap, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER) col += 1 else: sizerResistances.Add(wx.StaticLine(contentPanel, wx.ID_ANY), wx.GBPosition(row, col), wx.GBSpan(1, 6), wx.EXPAND | wx.ALIGN_CENTER) row += 1 col = 0 continue currGColour = 0 for damageType in ("em", "thermal", "kinetic", "explosive"): box = wx.BoxSizer(wx.HORIZONTAL) sizerResistances.Add(box, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER) #Fancy gauges addon pgColour = gaugeColours[currGColour] fc = pgColour[0] bc = pgColour[1] currGColour += 1 lbl = PG.PyGauge(contentPanel, wx.ID_ANY, 100) lbl.SetMinSize((48, 16)) lbl.SetBackgroundColour(wx.Colour(bc[0], bc[1], bc[2])) lbl.SetBarColour(wx.Colour(fc[0], fc[1], fc[2])) lbl.SetBarGradient() lbl.SetFractionDigits(1) setattr( self, "gaugeResistance%s%s" % (tankType.capitalize(), damageType.capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER) col += 1 box = wx.BoxSizer(wx.VERTICAL) box.SetMinSize(wx.Size(self.getTextExtentW("WWWWk"), -1)) lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0" if tankType != "damagePattern" else "") box.Add(lbl, 0, wx.ALIGN_CENTER) setattr(self, "labelResistance%sEhp" % tankType.capitalize(), lbl) sizerResistances.Add(box, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER) row += 1 col = 0 self.stEHPs.SetToolTip( wx.ToolTip("Click to toggle between effective HP and raw HP"))
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() root = wx.BoxSizer(wx.VERTICAL) contentSizer.Add(root, 0, wx.EXPAND, 0) sizer = wx.BoxSizer(wx.HORIZONTAL) root.Add(sizer, 0, wx.EXPAND) root.Add(wx.StaticLine(contentPanel, wx.ID_ANY, style=wx.HORIZONTAL), 0, wx.EXPAND) sizerResources = wx.BoxSizer(wx.HORIZONTAL) root.Add(sizerResources, 1, wx.EXPAND, 0) parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" base = sizerResources sizer.AddSpacer((0, 0), 1, wx.EXPAND, 5) # Turrets & launcher hardslots display tooltipText = { "turret": "Turret hardpoints", "launcher": "Launcher hardpoints", "drones": "Drones active", "fighter": "Fighter squadrons active", "calibration": "Calibration" } for type_ in ("turret", "launcher", "drones", "fighter", "calibration"): box = wx.BoxSizer(wx.HORIZONTAL) bitmap = BitmapLoader.getStaticBitmap("%s_big" % type_, parent, "gui") tooltip = wx.ToolTip(tooltipText[type_]) bitmap.SetToolTip(tooltip) box.Add(bitmap, 0, wx.ALIGN_CENTER) sizer.Add(box, 0, wx.ALIGN_CENTER) suffix = { 'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes', 'calibration': 'Points' } lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr( self, "label%sUsed%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5) box.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr( self, "label%sTotal%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER) setattr(self, "boxSizer{}".format(type_.capitalize()), box) # Hack - We add a spacer after each thing, but we are always hiding something. The spacer is stil there. # This way, we only have one space after the drones/fighters if type_ != "drones": sizer.AddSpacer((0, 0), 1, wx.EXPAND, 5) # PG, Cpu & drone stuff tooltipText = { "cpu": "CPU", "pg": "PowerGrid", "droneBay": "Drone bay", "fighterBay": "Fighter bay", "droneBandwidth": "Drone bandwidth", "cargoBay": "Cargo bay" } for i, group in enumerate( (("cpu", "pg"), ("cargoBay", "droneBay", "fighterBay", "droneBandwidth"))): main = wx.BoxSizer(wx.VERTICAL) base.Add(main, 1, wx.ALIGN_CENTER) for type_ in group: capitalizedType = type_[0].capitalize() + type_[1:] bitmap = BitmapLoader.getStaticBitmap(type_ + "_big", parent, "gui") tooltip = wx.ToolTip(tooltipText[type_]) bitmap.SetToolTip(tooltip) stats = wx.BoxSizer(wx.VERTICAL) absolute = wx.BoxSizer(wx.HORIZONTAL) stats.Add(absolute, 0, wx.EXPAND) b = wx.BoxSizer(wx.HORIZONTAL) main.Add(b, 1, wx.ALIGN_CENTER) b.Add(bitmap, 0, wx.ALIGN_BOTTOM) b.Add(stats, 1, wx.EXPAND) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr( self, "label%sUsed%s" % (panel.capitalize(), capitalizedType), lbl) absolute.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3) absolute.Add(wx.StaticText(parent, wx.ID_ANY, "/"), 0, wx.ALIGN_LEFT) lbl = wx.StaticText(parent, wx.ID_ANY, "0") setattr( self, "label%sTotal%s" % (panel.capitalize(), capitalizedType), lbl) absolute.Add(lbl, 0, wx.ALIGN_LEFT) units = { "cpu": " tf", "pg": " MW", "droneBandwidth": " mbit/s", "droneBay": u" m\u00B3", "fighterBay": u" m\u00B3", "cargoBay": u" m\u00B3" } lbl = wx.StaticText(parent, wx.ID_ANY, "%s" % units[type_]) absolute.Add(lbl, 0, wx.ALIGN_LEFT) # Gauges modif. - Darriele gauge = PyGauge(parent, wx.ID_ANY, 1) gauge.SetValueRange(0, 0) gauge.SetMinSize((self.getTextExtentW("1.999M/1.99M MW"), 23)) gauge.SetFractionDigits(2) setattr(self, "gauge%s%s" % (panel.capitalize(), capitalizedType), gauge) stats.Add(gauge, 0, wx.ALIGN_CENTER) setattr(self, "base%s%s" % (panel.capitalize(), capitalizedType), b) setattr(self, "bitmap%s%s" % (panel.capitalize(), capitalizedType), bitmap) self.toggleContext("drone")
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" sizerMiningYield = wx.FlexGridSizer(1, 4) sizerMiningYield.AddGrowableCol(1) contentSizer.Add(sizerMiningYield, 0, wx.EXPAND, 0) counter = 0 for miningType, image in (("miner", "mining"), ("drone", "drones")): baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerMiningYield.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL) baseBox.Add(BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_CENTER) box.Add(wx.StaticText(parent, wx.ID_ANY, miningType.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s") setattr(self, "label%sminingyield%s" % (panel.capitalize(), miningType.capitalize()), lbl) hbox.Add(lbl, 0, wx.ALIGN_CENTER) self._cachedValues.append(0) counter += 1 targetSizer = sizerMiningYield baseBox = wx.BoxSizer(wx.HORIZONTAL) targetSizer.Add(baseBox, 0, wx.ALIGN_LEFT) baseBox.Add(BitmapLoader.getStaticBitmap("cargoBay_big", parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.EXPAND) box.Add(wx.StaticText(parent, wx.ID_ANY, "Total"), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.EXPAND) lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s") setattr(self, "label%sminingyieldTotal" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) self._cachedValues.append(0) image = BitmapLoader.getBitmap("turret_small", "gui") firepower = wx.BitmapButton(contentPanel, -1, image) firepower.SetToolTip(wx.ToolTip("Click to toggle to Firepower View")) firepower.Bind(wx.EVT_BUTTON, self.switchToFirepowerView) sizerMiningYield.Add(firepower, 0, wx.ALIGN_LEFT) self._cachedValues.append(0)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel hsizer = self.headerPanel.GetSizer() self.stEff = wx.StaticText(self.headerPanel, wx.ID_ANY, "( Effective )") hsizer.Add(self.stEff) self.headerPanel.GetParent().AddToggleItem(self.stEff) panel = "full" sizerFirepower = wx.FlexGridSizer(1, 4) sizerFirepower.AddGrowableCol(1) contentSizer.Add(sizerFirepower, 0, wx.EXPAND, 0) counter = 0 for damageType, image in (("weapon", "turret"), ("drone", "droneDPS")): baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerFirepower.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL) baseBox.Add(BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_CENTER) box.Add(wx.StaticText(parent, wx.ID_ANY, damageType.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS") setattr(self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl) hbox.Add(lbl, 0, wx.ALIGN_CENTER) self._cachedValues.append(0) counter += 1 targetSizer = sizerFirepower baseBox = wx.BoxSizer(wx.HORIZONTAL) targetSizer.Add(baseBox, 0, wx.ALIGN_RIGHT) baseBox.Add(BitmapLoader.getStaticBitmap("volley_big", parent, "gui"), 0, wx.ALIGN_CENTER) gridS = wx.GridSizer(2,2,0,0) baseBox.Add(gridS, 0) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl) gridS.Add(wx.StaticText(parent, wx.ID_ANY, " Volley: "), 0, wx.ALL | wx.ALIGN_RIGHT) gridS.Add(lbl, 0, wx.ALIGN_LEFT) self._cachedValues.append(0) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl) gridS.Add(wx.StaticText(parent, wx.ID_ANY, " DPS: "), 0, wx.ALL | wx.ALIGN_RIGHT) self._cachedValues.append(0) gridS.Add(lbl, 0, wx.ALIGN_LEFT) image = BitmapLoader.getBitmap("mining_small", "gui") self.miningyield = wx.BitmapButton(contentPanel, -1, image) self.miningyield.SetToolTip(wx.ToolTip("Click to toggle to Mining Yield ")) self.miningyield.Bind(wx.EVT_BUTTON, self.switchToMiningYieldView) sizerFirepower.Add(self.miningyield, 0, wx.ALIGN_LEFT) self._cachedValues.append(0)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel hsizer = self.headerPanel.GetSizer() self.stEff = wx.StaticText(self.headerPanel, wx.ID_ANY, "( Effective )") hsizer.Add(self.stEff) self.headerPanel.GetParent().AddToggleItem(self.stEff) panel = "full" sizerFirepower = wx.FlexGridSizer(1, 4) sizerFirepower.AddGrowableCol(1) contentSizer.Add(sizerFirepower, 0, wx.EXPAND, 0) counter = 0 for damageType, image in (("weapon", "turret"), ("drone", "droneDPS")): baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerFirepower.Add( baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL) baseBox.Add( BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_CENTER) box.Add(wx.StaticText(parent, wx.ID_ANY, damageType.capitalize()), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 1, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS") setattr( self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl) hbox.Add(lbl, 0, wx.ALIGN_CENTER) self._cachedValues.append(0) counter += 1 targetSizer = sizerFirepower baseBox = wx.BoxSizer(wx.HORIZONTAL) targetSizer.Add(baseBox, 0, wx.ALIGN_RIGHT) baseBox.Add(BitmapLoader.getStaticBitmap("volley_big", parent, "gui"), 0, wx.ALIGN_CENTER) gridS = wx.GridSizer(2, 2, 0, 0) baseBox.Add(gridS, 0) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl) gridS.Add(wx.StaticText(parent, wx.ID_ANY, " Volley: "), 0, wx.ALL | wx.ALIGN_RIGHT) gridS.Add(lbl, 0, wx.ALIGN_LEFT) self._cachedValues.append(0) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl) gridS.Add(wx.StaticText(parent, wx.ID_ANY, " DPS: "), 0, wx.ALL | wx.ALIGN_RIGHT) self._cachedValues.append(0) gridS.Add(lbl, 0, wx.ALIGN_LEFT) image = BitmapLoader.getBitmap("mining_small", "gui") self.miningyield = wx.BitmapButton(contentPanel, -1, image) self.miningyield.SetToolTip( wx.ToolTip("Click to toggle to Mining Yield ")) self.miningyield.Bind(wx.EVT_BUTTON, self.switchToMiningYieldView) sizerFirepower.Add(self.miningyield, 0, wx.ALIGN_LEFT) self._cachedValues.append(0)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() parent = self.panel = contentPanel self.headerPanel = headerPanel panel = "full" sizerCapacitor = wx.GridSizer(1, 2) contentSizer.Add(sizerCapacitor, 0, wx.EXPAND, 0) # Capacitor capacity and time baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerCapacitor.Add(baseBox, 0, wx.ALIGN_LEFT) bitmap = BitmapLoader.getStaticBitmap("capacitorInfo_big", parent, "gui") tooltip = wx.ToolTip("Capacitor stability") bitmap.SetToolTip(tooltip) baseBox.Add(bitmap, 0, wx.ALIGN_CENTER) box = wx.BoxSizer(wx.VERTICAL) baseBox.Add(box, 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 0, wx.ALIGN_LEFT) hbox.Add(wx.StaticText(parent, wx.ID_ANY, "Total: "), 0, wx.ALIGN_LEFT | wx.LEFT, 3) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorCapacity" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) hbox.Add(wx.StaticText(parent, wx.ID_ANY, " GJ"), 0, wx.ALIGN_LEFT) hbox = wx.BoxSizer(wx.HORIZONTAL) box.Add(hbox, 0, wx.ALIGN_LEFT) lbl = wx.StaticText(parent, wx.ID_ANY, "Lasts ") hbox.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3) setattr(self, "label%sCapacitorState" % panel.capitalize(), lbl) lbl = wx.StaticText(parent, wx.ID_ANY, "0s") setattr(self, "label%sCapacitorTime" % panel.capitalize(), lbl) hbox.Add(lbl, 0, wx.ALIGN_LEFT) # Capacitor balance baseBox = wx.BoxSizer(wx.HORIZONTAL) sizerCapacitor.Add(baseBox, 0, wx.ALIGN_CENTER_HORIZONTAL) tooltip = wx.ToolTip("Capacitor throughput") bitmap = BitmapLoader.getStaticBitmap("capacitorRecharge_big", parent, "gui") bitmap.SetToolTip(tooltip) baseBox.Add(bitmap, 0, wx.ALIGN_CENTER) # Recharge chargeSizer = wx.FlexGridSizer(2, 3) baseBox.Add(chargeSizer, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, "+ "), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorRecharge" % panel.capitalize(), lbl) chargeSizer.Add(lbl, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, " GJ/s"), 0, wx.ALIGN_CENTER) # Discharge chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, "- "), 0, wx.ALIGN_CENTER) lbl = wx.StaticText(parent, wx.ID_ANY, "0.0") setattr(self, "label%sCapacitorDischarge" % panel.capitalize(), lbl) chargeSizer.Add(lbl, 0, wx.ALIGN_CENTER) chargeSizer.Add(wx.StaticText(parent, wx.ID_ANY, " GJ/s"), 0, wx.ALIGN_CENTER)
def populatePanel(self, contentPanel, headerPanel): contentSizer = contentPanel.GetSizer() self.panel = contentPanel self.headerPanel = headerPanel # Custom header EHP headerContentSizer = wx.BoxSizer(wx.HORIZONTAL) hsizer = headerPanel.GetSizer() hsizer.Add(headerContentSizer,0,0,0) self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "( Effective HP: ") headerContentSizer.Add(self.stEff) headerPanel.GetParent().AddToggleItem(self.stEff) self.labelEhp = wx.StaticText(headerPanel, wx.ID_ANY, "0") headerContentSizer.Add(self.labelEhp, 0) headerPanel.GetParent().AddToggleItem(self.labelEhp) stCls = wx.StaticText(headerPanel, wx.ID_ANY, " )") headerPanel.GetParent().AddToggleItem( stCls ) headerContentSizer.Add( stCls ) # headerContentSizer.Add(wx.StaticLine(headerPanel, wx.ID_ANY), 1, wx.ALIGN_CENTER) # Display table col = 0 row = 0 sizerResistances = wx.GridBagSizer() contentSizer.Add( sizerResistances, 0, wx.EXPAND , 0) # Add an empty label, then the rest. sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition( row, col ), wx.GBSpan( 1, 1 )) col+=1 toolTipText = {"em" : "Electromagnetic resistance", "thermal" : "Thermal resistance", "kinetic" : "Kinetic resistance", "explosive" : "Explosive resistance"} for damageType in ("em", "thermal", "kinetic", "explosive"): bitmap = BitmapLoader.getStaticBitmap("%s_big" % damageType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[damageType]) bitmap.SetToolTip(tooltip) sizerResistances.Add(bitmap, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) col+=1 self.stEHPs = wx.Button(contentPanel, style = wx.BU_EXACTFIT, label = "EHP") self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP")) self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP) for i in xrange(4): sizerResistances.AddGrowableCol(i+1) sizerResistances.Add(self.stEHPs, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) col=0 row+=1 gaugeColours=( ((38,133,198),(52,86,98)), ((198,38,38),(83,65,67)), ((163,163,163),(74,90,93)), ((198,133,38),(81,83,67)) ) toolTipText = {"shield" : "Shield resistance", "armor" : "Armor resistance", "hull" : "Hull resistance", "damagePattern" : "Incoming damage pattern"} for tankType in ("shield", "armor", "hull", "separator", "damagePattern"): if tankType != "separator": bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui") tooltip = wx.ToolTip(toolTipText[tankType]) bitmap.SetToolTip(tooltip) sizerResistances.Add(bitmap, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) col+=1 else: sizerResistances.Add(wx.StaticLine(contentPanel, wx.ID_ANY), wx.GBPosition( row, col ), wx.GBSpan( 1, 6 ), wx.EXPAND|wx.ALIGN_CENTER) row+=1 col=0 continue currGColour=0 for damageType in ("em", "thermal", "kinetic", "explosive"): box = wx.BoxSizer(wx.HORIZONTAL) sizerResistances.Add(box, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) #Fancy gauges addon pgColour= gaugeColours[currGColour] fc = pgColour[0] bc = pgColour[1] currGColour+=1 lbl = PG.PyGauge(contentPanel, wx.ID_ANY, 100) lbl.SetMinSize((48, 16)) lbl.SetBackgroundColour(wx.Colour(bc[0],bc[1],bc[2])) lbl.SetBarColour(wx.Colour(fc[0],fc[1],fc[2])) lbl.SetBarGradient() lbl.SetFractionDigits(1) setattr(self, "gaugeResistance%s%s" % (tankType.capitalize(), damageType.capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER) col+=1 box = wx.BoxSizer(wx.VERTICAL) box.SetMinSize(wx.Size(self.getTextExtentW("WWWWk"), -1)) lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0" if tankType != "damagePattern" else "") box.Add(lbl, 0, wx.ALIGN_CENTER) setattr(self, "labelResistance%sEhp" % tankType.capitalize(), lbl) sizerResistances.Add(box, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER) row+=1 col=0 self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP"))