# HG changeset patch # User lbessard # Date 1206541360 -3600 # Node ID 50926b8abac4ad004487ffa3df84281c52027508 # Parent d77f9b783ce8ce591a4b90276b2be487db824f09 Bug on Enumerated DataType values defining fixed diff -r d77f9b783ce8 -r 50926b8abac4 DataTypeEditor.py --- a/DataTypeEditor.py Tue Mar 25 18:43:48 2008 +0100 +++ b/DataTypeEditor.py Wed Mar 26 15:22:40 2008 +0100 @@ -316,8 +316,10 @@ def OnEnumeratedValueEndEdit(self, event): text = event.GetText() - if self.EnumeratedValues.GetStrings()[event.GetIndex()].upper() != text.upper(): - if text.upper() in [string.upper() for string in self.EnumeratedValues.GetStrings()]: + values = self.EnumeratedValues.GetStrings() + index = event.GetIndex() + if index >= len(values) or values[index].upper() != text.upper(): + if text.upper() in [value.upper() for value in values]: message = wx.MessageDialog(self, "\"%s\" value already defined!"%text, "Error", wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy()