# HG changeset patch # User GP Orcullo # Date 1676776454 -28800 # Node ID d5014da90054e878a41395be67e3055aee60a09b # Parent 56ceda9889f86dc27f59cc46fc0b5451612b4efb show underscore as space diff -r 56ceda9889f8 -r d5014da90054 editors/ConfTreeNodeEditor.py --- a/editors/ConfTreeNodeEditor.py Fri Feb 10 18:40:42 2023 +0800 +++ b/editors/ConfTreeNodeEditor.py Sun Feb 19 11:14:14 2023 +0800 @@ -394,8 +394,9 @@ pos=wx.Point(0, 0), size=wx.Size(24, 24), style=0) boxsizer.Add(staticbitmap, border=5, flag=wx.RIGHT) + label = element_infos["name"].replace('_', ' ') statictext = wx.StaticText(self.ParamsEditor, - label="%s:" % _(element_infos["name"])) + label="%s:" % _(label)) boxsizer.Add(statictext, border=5, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT) @@ -428,7 +429,7 @@ combobox.Append("") if len(element_infos["type"]) > 0 and isinstance(element_infos["type"][0], tuple): for choice, _xsdclass in element_infos["type"]: - combobox.Append(choice) + combobox.Append(choice.replace('_',' ')) name = element_infos["name"] value = element_infos["value"] @@ -449,7 +450,8 @@ if element_infos["value"] is None: combobox.SetStringSelection("") else: - combobox.SetStringSelection(element_infos["value"]) + combobox.SetStringSelection( + element_infos["value"].replace('_',' ')) combobox.Bind(wx.EVT_COMBOBOX, callback, combobox) elif isinstance(element_infos["type"], dict): @@ -581,7 +583,8 @@ def GetChoiceContentCallBackFunction(self, choicectrl, path): def OnChoiceContentChanged(event): - self.SetConfNodeParamsAttribute(path, choicectrl.GetStringSelection()) + self.SetConfNodeParamsAttribute( + path, choicectrl.GetStringSelection().replace(' ','_')) wx.CallAfter(self.RefreshConfNodeParamsSizer) event.Skip() return OnChoiceContentChanged