Add all the columns we need for now to our fitting view

This commit is contained in:
cncfanatics
2010-08-25 12:17:05 +02:00
parent 195b65ac9e
commit 5c6d030f13
4 changed files with 90 additions and 15 deletions

View File

@@ -30,9 +30,14 @@ class AttributeDisplay(ViewColumn):
info = cAttribute.getAttributeInfo(params["attribute"])
self.info = info
if params["showIcon"]:
iconFile = info.icon.iconFile if info.icon else None
if info.name == "power":
iconFile = "pg_small"
iconType = "icons"
else:
iconFile = info.icon.iconFile if info.icon else None
iconType = "pack"
if iconFile:
bitmap = bitmapLoader.getBitmap(iconFile, "pack")
bitmap = bitmapLoader.getBitmap(iconFile, iconType)
self.imageId = fittingView.imageList.Add(bitmap)
else:
self.imageId = -1
@@ -43,7 +48,11 @@ class AttributeDisplay(ViewColumn):
self.columnText = info.displayName if info.displayName != "" else info.name
def getText(self, mod):
return "%.2f" % mod.getModifiedItemAttr(self.info.name)
attr = mod.getModifiedItemAttr(self.info.name)
if attr:
return "%.2f" % attr
else:
return ""
def getImageId(self, mod):
return -1