--- a/plugger.py Mon Dec 19 01:56:13 2011 +0100
+++ b/plugger.py Tue Dec 20 23:37:06 2011 +0100
@@ -97,6 +97,7 @@
def _AddParamsMembers(self):
@@ -115,6 +116,7 @@
self.MandatoryParams = ("BaseParams", self.BaseParams)
# copy PluginMethods so that it can be later customized
self.PluginMethods = [dic.copy() for dic in self.PluginMethods]
@@ -137,6 +139,12 @@
return os.path.join(self.PlugParent.PlugPath(),
PlugName + NameTypeSeparator + self.PlugType)
+ def PlugFullName(self): + parent = self.PlugParent.PlugFullName() + return parent + "." + self.BaseParams.getName() + return self.BaseParams.getName() def GetIconPath(self, name):
@@ -484,7 +492,22 @@
self.GetPlugRoot().logger.write_warning(_("A child with IEC channel %d already exist -> %d\n")%(DesiredChannel,res))
+ if self.EditorType is not None and self._View is None: + app_frame = self.GetPlugRoot().AppFrame + self._View = self.EditorType(app_frame.TabsOpened, self, app_frame) + app_frame.EditProjectElement(self._View, self.GetFilename()) + def OnCloseEditor(self): + if self._View is not None: + app_frame = self.GetPlugRoot().AppFrame + if app_frame is not None: + app_frame.DeletePage(self._View) def _doRemoveChild(self, PlugInstance):
@@ -810,6 +833,9 @@
def PlugTestModified(self):
return self.ChangesToSave or not self.ProjectIsSaved()
+ def PlugFullName(self): --- a/plugins/c_ext/CFileEditor.py Mon Dec 19 01:56:13 2011 +0100
+++ b/plugins/c_ext/CFileEditor.py Tue Dec 20 23:37:06 2011 +0100
@@ -477,7 +477,6 @@
colname = self.GetColLabelValue(col)
- grid.SetReadOnly(row, col, False)
editor = wx.grid.GridCellTextEditor()
@@ -618,6 +617,9 @@
self.VariablesGrid.SetColSize(col, self.ColSizes[col])
self.Table.ResetView(self.VariablesGrid)
+ self.Controler.OnCloseEditor() def IsViewing(self, name):
return name == "Variables"
@@ -646,7 +648,7 @@
def OnVariablesGridCellChange(self, event):
+ wx.CallAfter(self.RefreshView) def OnVariablesGridEditorShown(self, event):
@@ -891,10 +893,10 @@
self.SetIcon(wx.BitmapFromImage(img.Rescale(16, 16)))
- filename = self.Controler.GetFilename()
+ fullname = self.Controler.PlugFullName() if not self.Controler.CFileIsSaved():
- return "~%s~" % filename
+ return "~%s~" % fullname def GetBufferState(self):
return self.Controler.GetBufferState()
--- a/plugins/c_ext/c_ext.py Mon Dec 19 01:56:13 2011 +0100
+++ b/plugins/c_ext/c_ext.py Tue Dec 20 23:37:06 2011 +0100
@@ -26,9 +26,13 @@
+ EditorType = CFileEditor filepath = self.CFileName()
self.CFile = CFileClasses["CFile"]()
if os.path.isfile(filepath):
@@ -140,13 +144,6 @@
return self.CFile.publishFunction.gettext()
- app_frame = self.GetPlugRoot().AppFrame
- cfileeditor = CFileEditor(app_frame.TabsOpened, self, app_frame)
- app_frame.EditProjectElement(cfileeditor, self.GetFilename())
{"bitmap" : os.path.join("images", "EditCfile"),
@@ -267,7 +264,8 @@
matiec_flags = '"-I%s"'%os.path.abspath(self.GetPlugRoot().GetIECLibPath())
return [(Gen_Cfile_path, str(self.CExtension.getCFLAGS() + matiec_flags))],str(self.CExtension.getLDFLAGS()),True
#-------------------------------------------------------------------------------
# Current Buffering Management Functions
#-------------------------------------------------------------------------------