]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/params.py
[1660792 ] wxObject::Dec/IncRef and wxObjectDataPtr
[wxWidgets.git] / wxPython / wx / tools / XRCed / params.py
index c5f3f198e334bd1f31faedebb82bc8392c6b99f0..23bcf215249ef8731617304faf06e8ed12b08f4c 100644 (file)
@@ -555,7 +555,7 @@ class ContentCheckListDialog(wx.Dialog):
         pre = wx.PreDialog()
         g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_CONTENT_CHECKLIST')
         self.PostCreate(pre)
-        self.list = xrc.XRCCTRL(self, 'CHECKLIST')
+        self.list = xrc.XRCCTRL(self, 'CHECK_LIST')
         # Set list items
         i = 0
         for v,ch in value:
@@ -639,7 +639,10 @@ class ParamContent(PPanel):
         self.freeze = True
         if not value: value = []
         self.value = value
-        repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value)
+        if value:
+            repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value)
+        else:
+            repr_ = ''
         self.text.SetValue(repr_)  # update text ctrl
         self.freeze = False
     def OnButtonEdit(self, evt):
@@ -671,6 +674,17 @@ class ParamContentCheckList(ParamContent):
             self.SetModified()
             self.textModified = False
         dlg.Destroy()
+    def SetValue(self, value):
+        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_ = ''
+        self.text.SetValue(repr_)  # update text ctrl
+        self.freeze = False        
 
 class IntListDialog(wx.Dialog):
     def __init__(self, parent, value):