--- a/Beremiz.py Mon Sep 10 18:12:03 2007 +0200
+++ b/Beremiz.py Mon Sep 10 18:19:53 2007 +0200
@@ -32,9 +32,6 @@
from plugger import PluginsRoot
-def CHECK_WX_VERSION(major, minor, release):
- return not (wx.MAJOR_VERSION < major or wx.MINOR_VERSION < minor or wx.RELEASE_NUMBER < release)
""" Base class for file like objects to facilitate StdOut for the Shell."""
def __init__(self, output = None):
@@ -255,7 +252,7 @@
def _init_ctrls(self, prnt):
wx.Frame.__init__(self, id=ID_BEREMIZ, name=u'Beremiz',
parent=prnt, pos=wx.Point(0, 0), size=wx.Size(1000, 600),
- style=wx.DEFAULT_FRAME_STYLE, title=u'Beremiz')
+ style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, title=u'Beremiz') self.SetClientSize(wx.Size(1000, 600))
self.SetMenuBar(self.menuBar1)
@@ -440,8 +437,22 @@
infos = plugin.GetParamsAttributes()
- self.RefreshSizerElement(self.ParamsPanelMainSizer, infos, None)
- if len(plugin.PluginMethods) > 0:
+ if wx.VERSION >= (2, 7, 0): + self.ParamsPanelMainSizer.Clear(True) + self.ClearSizer(self.ParamsPanelMainSizer) + if len(self.PluginRoot.PluginMethods) > 0: + boxsizer = wx.BoxSizer(wx.HORIZONTAL) + self.ParamsPanelMainSizer.AddSizer(boxsizer, 0, border=5, flag=wx.GROW|wx.ALL) + for name, method in self.PluginRoot.PluginMethods: + button = wx.Button(id=id, label=name, name=name, parent=self.ParamsPanel, + pos=wx.Point(0, 0), style=wx.BU_EXACTFIT) + button.Bind(wx.EVT_BUTTON, self.GetButtonCallBackFunction(self.PluginRoot, method), id=id) + boxsizer.AddWindow(button, 0, border=5, flag=wx.GROW|wx.RIGHT) + self.RefreshSizerElement(self.ParamsPanelMainSizer, infos, None, False) + if plugin != self.PluginRoot and len(plugin.PluginMethods) > 0: boxsizer = wx.BoxSizer(wx.HORIZONTAL)
self.ParamsPanelMainSizer.AddSizer(boxsizer, 0, border=5, flag=wx.GROW|wx.ALL)
for name, method in plugin.PluginMethods:
@@ -524,11 +535,12 @@
for staticbox in staticboxes:
- def RefreshSizerElement(self, sizer, elements, path):
- if wx.VERSION >= (2, 7, 0):
+ def RefreshSizerElement(self, sizer, elements, path, clean = True): + if wx.VERSION >= (2, 7, 0): for element_infos in elements:
--- a/plugger.py Mon Sep 10 18:12:03 2007 +0200
+++ b/plugger.py Mon Sep 10 18:19:53 2007 +0200
@@ -565,6 +565,8 @@
if not self.PLCManager.SaveXMLFile():
self.PLCManager.SaveXMLFile(os.path.join(self.ProjectPath, 'plc.xml'))
+ self.PLCEditor.RefreshTitle() def PlugPath(self, PlugName=None):
@@ -705,11 +707,17 @@
def _EditPLC(self, logger):
self.PLCEditor = PLCOpenEditor(self.AppFrame, self.PLCManager)
self.PLCEditor.RefreshProjectTree()
self.PLCEditor.RefreshFileMenu()
self.PLCEditor.RefreshEditMenu()
self.PLCEditor.RefreshToolBar()
+ self.PLCEditor._onclose = _onclose + self.PLCEditor._onsave = _onsave def _Clean(self, logger):
--- a/plugins/canfestival/canfestival.py Mon Sep 10 18:12:03 2007 +0200
+++ b/plugins/canfestival/canfestival.py Mon Sep 10 18:19:53 2007 +0200
@@ -36,10 +36,13 @@
+ self.GetPlugRoot().SaveProject() self._View = _NetworkEdit(self.GetPlugRoot().AppFrame, self)
# TODO redefine BusId when IEC channel change
self._View.SetBusId(self.GetCurrentLocation())
self._View._onclose = _onclose
+ self._View._onsave = _onsave PluginMethods = [("NetworkEdit",_OpenView)]