--- a/etherlab/ConfigEditor.py Mon May 21 10:21:41 2012 +0200
+++ b/etherlab/ConfigEditor.py Mon May 21 18:47:56 2012 +0200
@@ -124,7 +124,7 @@
size=wx.Size(0, 0), style=wx.VSCROLL)
self.VariablesLabel = wx.StaticText(id=ID_NODEEDITORVARIABLESLABEL,
- label=_('Variable entries:'), name='VariablesLabel', parent=self,
+ label=_('Variable entries:'), name='VariablesLabel', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
self.VariablesGrid = wx.gizmos.TreeListCtrl(id=ID_NODEEDITORVARIABLESGRID,
@@ -139,7 +139,7 @@
def __init__(self, parent, controler, window):
- ConfTreeNodeEditor.__init__(self, parent, "", controler, window)
+ ConfTreeNodeEditor.__init__(self, parent, controler, window) self.SyncManagersTable = SyncManagersTable(self, [], GetSyncManagersTableColnames())
self.SyncManagersGrid.SetTable(self.SyncManagersTable)
@@ -153,7 +153,7 @@
self.SyncManagersGrid.SetColAttr(col, attr)
self.SyncManagersGrid.SetColMinimalWidth(col, self.SyncManagersGridColSizes[col])
self.SyncManagersGrid.AutoSizeColumn(col, False)
for colname, colsize, colalign in zip(GetVariablesTableColnames(),
[40, 150, 100, 100, 150, 100, 150, 100],
[wx.ALIGN_RIGHT, wx.ALIGN_LEFT, wx.ALIGN_RIGHT,
@@ -197,10 +197,10 @@
item, root_cookie = self.VariablesGrid.GetFirstChild(root, 0)
+ no_more_items = not item.IsOk() - create_new = not item.IsOk()
item = self.VariablesGrid.AppendItem(root, "")
for col, colname in enumerate(colnames):
@@ -210,17 +210,18 @@
if entry["PDOMapping"] == "":
self.VariablesGrid.SetItemBackgroundColour(item, wx.LIGHT_GREY)
self.VariablesGrid.SetItemPyData(item, entry)
- if create_new and wx.Platform != '__WXMSW__':
+ idx = self.GenerateVariablesGridBranch(item, entry["children"], colnames, idx) item, root_cookie = self.VariablesGrid.GetNextChild(root, root_cookie)
- idx = self.GenerateVariablesGridBranch(item, entry["children"], colnames, idx)
- item, root_cookie = self.VariablesGrid.GetNextChild(root, root_cookie)
+ no_more_items = not item.IsOk()
- item, root_cookie = self.VariablesGrid.GetNextChild(root, root_cookie)
- self.VariablesGrid.Delete(item)
+ item, root_cookie = self.VariablesGrid.GetNextChild(root, root_cookie) + self.VariablesGrid.Delete(item)