Start working on the stats pane. Resources part is done

This commit is contained in:
cncfanatics
2010-08-14 00:24:15 +02:00
parent cd9811d7f9
commit 53448d47e8
29 changed files with 90 additions and 7 deletions

View File

@@ -19,7 +19,6 @@
import wx
class FittingView(wx.Panel):
class FittingView(wx.TreeCtrl):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.SetBackgroundColour('pink')
wx.TreeCtrl.__init__(self, parent, wx.ID_ANY)

View File

@@ -39,7 +39,8 @@ class MainFrame(wx.Frame):
self.fitMultiSwitch.AddTab()
self.splitter.SplitVertically(self.marketBrowser, self.fitMultiSwitch)
self.splitter.SetMinimumPaneSize(260)
self.splitter.SetMinimumPaneSize(10)
self.splitter.SetSashPosition(200)
#Show ourselves
self.Show()

View File

@@ -33,5 +33,4 @@ class MarketBrowser(wx.Panel):
self.itemView = wx.TreeCtrl(self.splitter)
self.splitter.SplitHorizontally(self.marketView, self.itemView)
self.splitter.SetSashPosition(-300, True)
self.splitter.SetMinimumPaneSize(10)

View File

@@ -18,11 +18,92 @@
#===============================================================================
import wx
from gui import bitmapLoader
class StatsPane(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.SetBackgroundColour('cyan')
size = wx.Size()
size.SetWidth(350)
size.SetWidth(315)
self.SetMinSize(size)
self.sizerBase = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(self.sizerBase)
self.sizerResourcesHeader = wx.BoxSizer(wx.HORIZONTAL)
self.sizerBase.Add(self.sizerResourcesHeader, 0, wx.EXPAND)
# Resources header
self.labelResources = wx.StaticText(self, wx.ID_ANY, "Resources")
font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
font.SetWeight(wx.BOLD)
self.labelResources.SetFont(font)
self.sizerResourcesHeader.Add(self.labelResources, 0)
self.sizerResourcesHeader.Add(wx.StaticLine(self, wx.ID_ANY), 1, wx.EXPAND)
# Resources stuff
self.sizerResources = wx.BoxSizer(wx.HORIZONTAL)
self.sizerBase.Add(self.sizerResources)
# Turret slots, Launcher slots & calibration
self.sizerHardResources = wx.FlexGridSizer(3, 4)
self.sizerResources.Add(self.sizerHardResources, 0, wx.EXPAND)
for type in ("turret", "launcher"):
self.sizerHardResources.Add(bitmapLoader.getStaticBitmap("%s_big" % type, self))
lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "labelAvailable%sHardpoints", lbl)
self.sizerHardResources.Add(lbl, 0, wx.ALIGN_CENTER)
self.sizerHardResources.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)
lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "labelTotal%sHardpoints", lbl)
self.sizerHardResources.Add(lbl, 0, wx.ALIGN_CENTER)
# Calibration points
self.sizerHardResources.Add(bitmapLoader.getStaticBitmap("calibration_big", self))
self.labelAvailableCalibrationPoints = wx.StaticText(self, wx.ID_ANY, "0")
self.sizerHardResources.Add(self.labelAvailableCalibrationPoints, 0, wx.ALIGN_CENTER)
self.sizerHardResources.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)
self.labelTotalCalibrationPoints = wx.StaticText(self, wx.ID_ANY, "0")
self.sizerHardResources.Add(self.labelTotalCalibrationPoints, 0, wx.ALIGN_CENTER)
self.sizerResources.Add(wx.StaticLine(self, wx.ID_ANY, style=wx.VERTICAL), 1, wx.EXPAND)
#PG, Cpu & drone stuff
for group in (("cpu", "pg"), ("droneBay", "droneBandwidth")):
main = wx.BoxSizer(wx.VERTICAL)
self.sizerResources.Add(main, 0, wx.EXPAND)
for type in group:
capitalizedType = type[0].capitalize() + type[1:]
base = wx.BoxSizer(wx.HORIZONTAL)
main.Add(base, 0, wx.EXPAND)
base.Add(bitmapLoader.getStaticBitmap(type + "_big", self), 0, wx.ALIGN_CENTER)
stats = wx.BoxSizer(wx.VERTICAL)
base.Add(stats, 0, wx.EXPAND)
absolute = wx.BoxSizer(wx.HORIZONTAL)
stats.Add(absolute)
lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "labelAvailable%s" % capitalizedType, lbl)
absolute.Add(lbl, 0, wx.ALIGN_CENTER)
absolute.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)
lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "labelTotal%s" % capitalizedType, lbl)
absolute.Add(lbl, 0, wx.ALIGN_CENTER)
gauge = wx.Gauge(self, wx.ID_ANY, 100)
setattr(self, "gauge%s" % capitalizedType, gauge)
stats.Add(gauge)

3
icons/.directory Normal file
View File

@@ -0,0 +1,3 @@
[Dolphin]
ShowPreview=true
Timestamp=2010,8,13,20,51,36

BIN
icons/armorActive_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/armor_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
icons/calibration_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/capacitorInfo_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
icons/cpu_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
icons/droneBay_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
icons/em_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/explosive_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/fittingsPrice_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
icons/hullActive_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
icons/hull_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
icons/kinetic_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
icons/launcher_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
icons/mining_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
icons/pg_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
icons/shieldActive_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
icons/shieldPassive_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/shield_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
icons/thermal_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/totalPrice_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
icons/turret_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
icons/volley_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB