| 10 | _t = wx.GetTranslation |
| 11 | |
| 12 | class ItemEffects(wx.Panel): |
| 13 | def __init__(self, parent, stuff, item): |
| 14 | wx.Panel.__init__(self, parent) |
| 15 | self.item = item |
| 16 | |
| 17 | mainSizer = wx.BoxSizer(wx.VERTICAL) |
| 18 | |
| 19 | self.effectList = AutoListCtrl(self, wx.ID_ANY, |
| 20 | style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES | wx.NO_BORDER) |
| 21 | mainSizer.Add(self.effectList, 1, wx.ALL | wx.EXPAND, 0) |
| 22 | self.SetSizer(mainSizer) |
| 23 | |
| 24 | self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnClick, self.effectList) |
| 25 | |
| 26 | self.PopulateList() |
| 27 | |
| 28 | def PopulateList(self): |
| 29 | |
| 30 | self.effectList.InsertColumn(0, _t("Name")) |
| 31 | self.effectList.InsertColumn(1, _t("Active")) |
| 32 | self.effectList.InsertColumn(2, _t("Type")) |
| 33 | if config.debug: |
| 34 | self.effectList.InsertColumn(3, _t("Run Time")) |
| 35 | self.effectList.InsertColumn(4, _t("ID")) |
| 36 | |
| 37 | # self.effectList.SetColumnWidth(0,385) |
| 38 | |
| 39 | self.effectList.setResizeColumn(0) |
| 40 | self.effectList.SetColumnWidth(1, 50) |
| 41 | self.effectList.SetColumnWidth(2, 80) |
| 42 | if config.debug: |
| 43 | self.effectList.SetColumnWidth(3, 65) |
| 44 | self.effectList.SetColumnWidth(4, 40) |
| 45 | |
| 46 | item = self.item |
| 47 | self.effects = effects = item.effects |
| 48 | names = list(effects.keys()) |
| 49 | names.sort() |
| 50 | |
| 51 | for name in names: |
| 52 | index = self.effectList.InsertItem(self.effectList.GetItemCount(), name) |
| 53 | |
| 54 | if effects[name].isImplemented: |
| 55 | if effects[name].activeByDefault: |
| 56 | activeByDefault = _t("Yes") |
| 57 | else: |
| 58 | activeByDefault = _t("No") |
| 59 | else: |
| 60 | activeByDefault = "" |
| 61 | |
| 62 | effectTypeText = "" |
| 63 | if effects[name].type: |
| 64 | for effectType in effects[name].type: |
| 65 | effectTypeText += effectType + " " |
| 66 | pass |
| 67 | |
| 68 | if effects[name].runTime and effects[name].isImplemented: |
| 69 | effectRunTime = str(effects[name].runTime) |