(self, fittingView, params)
| 32 | name = "attr" |
| 33 | |
| 34 | def __init__(self, fittingView, params): |
| 35 | ViewColumn.__init__(self, fittingView) |
| 36 | sAttr = Attribute.getInstance() |
| 37 | info = sAttr.getAttributeInfo(params["attribute"]) |
| 38 | self.info = info |
| 39 | if params["showIcon"]: |
| 40 | if info.name == "power": |
| 41 | iconFile = "pg_small" |
| 42 | iconType = "gui" |
| 43 | else: |
| 44 | iconFile = info.iconID |
| 45 | iconType = "icons" |
| 46 | if iconFile: |
| 47 | self.imageId = fittingView.imageList.GetImageIndex(iconFile, iconType) |
| 48 | self.bitmap = BitmapLoader.getBitmap(iconFile, iconType) |
| 49 | else: |
| 50 | self.imageId = -1 |
| 51 | |
| 52 | self.mask = wx.LIST_MASK_IMAGE |
| 53 | else: |
| 54 | self.imageId = -1 |
| 55 | |
| 56 | if params["displayName"] or self.imageId == -1: |
| 57 | self.columnText = info.displayName if info.displayName != "" else info.name |
| 58 | self.mask |= wx.LIST_MASK_IMAGE |
| 59 | |
| 60 | if params["direct"]: |
| 61 | self.direct = True |
| 62 | self.view = fittingView |
| 63 | originalRefresh = fittingView.refresh |
| 64 | sMkt = Market.getInstance() |
| 65 | |
| 66 | def refresh(stuff): |
| 67 | # Hack into our master view and add a callback for ourselves to know when to query |
| 68 | self.directInfo = sMkt.directAttrRequest(stuff, info) if stuff else None |
| 69 | originalRefresh(stuff) |
| 70 | |
| 71 | fittingView.refresh = refresh |
| 72 | |
| 73 | def getText(self, mod): |
| 74 | if hasattr(mod, "item"): |
nothing calls this directly
no test coverage detected