--- 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()