--- a/editors/ConfTreeNodeEditor.py Thu Jul 22 12:03:34 2021 +0200
+++ b/editors/ConfTreeNodeEditor.py Fri Jul 23 13:15:19 2021 +0200
@@ -385,7 +385,7 @@
element_infos["children"],
- boxsizer = wx.FlexGridSizer(cols=3, rows=1)
+ boxsizer = wx.FlexGridSizer(cols=4, rows=1) boxsizer.AddGrowableCol(1)
flags = (wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
@@ -472,8 +472,9 @@
if element_infos["type"] == "boolean":
- checkbox = wx.CheckBox(self.ParamsEditor, size=wx.Size(17, 25))
- boxsizer.AddWindow(checkbox)
+ checkbox = wx.CheckBox(self.ParamsEditor) + boxsizer.AddWindow(checkbox, border=5, + flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT) if element_infos["value"] is not None:
checkbox.SetValue(element_infos["value"])
checkbox.Bind(wx.EVT_CHECKBOX,
@@ -526,6 +527,16 @@
textctrl.Bind(wx.EVT_TEXT_ENTER, callback)
textctrl.Bind(wx.EVT_TEXT, callback)
textctrl.Bind(wx.EVT_KILL_FOCUS, callback)
+ if not isinstance(element_infos["type"], list) and element_infos["use"] == "optional": + bt = wx.BitmapButton(self.ParamsEditor, + bitmap=wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, (16,16)), + self.Bind(wx.EVT_BUTTON, + self.GetResetFunction(element_path), @@ -590,6 +601,13 @@
+ def GetResetFunction(self, path): + res = self.SetConfNodeParamsAttribute(path, None) + wx.CallAfter(self.RefreshView) def GetCheckBoxCallBackFunction(self, chkbx, path):
def OnCheckBoxChanged(event):
res = self.SetConfNodeParamsAttribute(path, chkbx.IsChecked())
--- a/xmlclass/xmlclass.py Thu Jul 22 12:03:34 2021 +0200
+++ b/xmlclass/xmlclass.py Fri Jul 23 13:15:19 2021 +0200
@@ -1522,7 +1522,7 @@
raise ValueError("Wrong path!")
if attributes[parts[0]]["attr_type"]["basename"] == "boolean":
setattr(self, parts[0], value)
- elif attributes[parts[0]]["use"] == "optional" and value == "":
+ elif attributes[parts[0]]["use"] == "optional" and value == None: if "default" in attributes[parts[0]]:
attributes[parts[0]]["attr_type"]["extract"](