MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / itemActivated

Method itemActivated

gui/propertyEditor.py:255–272  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

253 self.itemView.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.itemActivated)
254
255 def itemActivated(self, event):
256 self.Clear()
257 self.btn.Enable(True)
258 sel = event.EventObject.GetFirstSelected()
259 self.item = item = self.itemView.activeItems[sel]
260
261 for key in sorted(item.attributes.keys()):
262 override = item.overrides.get(key, None)
263 default = item.attributes[key].value
264 if override and override.value != default:
265 prop = wxpg.FloatProperty(key, value=override.value)
266 prop.SetModifiedStatus(True)
267 else:
268 prop = wxpg.FloatProperty(key, value=default)
269
270 prop.SetClientData(item.attributes[key]) # set this so that we may access it later
271 prop.SetHelpString("%s\n%s" % (item.attributes[key].displayName or key, _t("Default Value: %0.3f") % default))
272 self.Append(prop)
273
274 def removeOverrides(self, event):
275 if self.item is None:

Callers

nothing calls this directly

Calls 4

ClearMethod · 0.95
_tFunction · 0.50
keysMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected