| 86 | |
| 87 | |
| 88 | class ImplantSetEditorView(BaseImplantEditorView): |
| 89 | |
| 90 | def __init__(self, parent): |
| 91 | BaseImplantEditorView.__init__(self, parent) |
| 92 | if 'wxMSW' in wx.PlatformInfo: |
| 93 | self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) |
| 94 | |
| 95 | def bindContext(self): |
| 96 | self.Parent.entityEditor.Bind(wx.EVT_CHOICE, self.contextChanged) |
| 97 | |
| 98 | def getImplantsFromContext(self): |
| 99 | sIS = ImplantSets.getInstance() |
| 100 | set_ = self.Parent.entityEditor.getActiveEntity() |
| 101 | if set_: |
| 102 | return sIS.getImplants(set_.ID) |
| 103 | return [] |
| 104 | |
| 105 | def addImplantToContext(self, item): |
| 106 | sIS = ImplantSets.getInstance() |
| 107 | set_ = self.Parent.entityEditor.getActiveEntity() |
| 108 | |
| 109 | sIS.addImplants(set_.ID, item.ID) |
| 110 | |
| 111 | def removeImplantFromContext(self, implant): |
| 112 | sIS = ImplantSets.getInstance() |
| 113 | set_ = self.Parent.entityEditor.getActiveEntity() |
| 114 | |
| 115 | sIS.removeImplant(set_.ID, implant) |
| 116 | |
| 117 | |
| 118 | class ImplantSetEditor(AuxiliaryFrame): |