value.append(self.values[i])
# Add ignored flags
value.extend(ignored)
- if value:
- self.SetValue(reduce(lambda a,b: a+'|'+b, value))
- else:
- self.SetValue('')
+ self.SetValue('|'.join(value))
self.SetModified()
dlg.Destroy()
[self.valuesGeneric[i]
for i in range(listBoxGeneric.GetCount())
if listBoxGeneric.IsChecked(i)] + ignored
- if value:
- self.SetValue(reduce(lambda a,b: a+'|'+b, value))
- else:
- self.SetValue('')
+ self.SetValue('|'.join(value))
self.SetModified()
dlg.Destroy()
self.freeze = True
if not value: value = []
self.value = value
- if value:
- repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value)
- else:
- repr_ = ''
+ repr_ = '|'.join(map(str, value))
self.text.SetValue(repr_) # update text ctrl
self.freeze = False
def OnButtonEdit(self, evt):
self.freeze = True
if not value: value = []
self.value = value
- if value:
- if len(value) == 1: repr_ = str(value)
- else: repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value)
- else:
- repr_ = ''
+ repr_ = '|'.join(map(str,value))
self.text.SetValue(repr_) # update text ctrl
self.freeze = False
def OnButtonEdit(self, evt):
if self.textModified: # text has newer value
try:
- self.value = eval(self.text.GetValue())
+ self.value = map(int, self.text.GetValue().split('|'))
except SyntaxError:
wx.LogError('Syntax error in parameter value: ' + self.GetName())
self.value = []
self.PopupMenu(menu, evt.GetPosition())
menu.Destroy()
- # Redefine to force the update of font dimentions
- def SetItemBold(self, item):
- wx.TreeCtrl.SetItemBold(self, item)
- self.SetIndent(self.GetIndent())
+ # Redefine to force the update of font dimentions on wxGTK
+ if wx.Platform == '__WXGTK__':
+ def SetItemBold(self, item, state=True):
+ wx.TreeCtrl.SetItemBold(self, item, state)
+ self.SetIndent(self.GetIndent())
# Apply changes
def Apply(self, xxx, item):