--- a/LPCManager.py Tue Feb 06 13:07:04 2018 +0100
+++ b/LPCManager.py Tue Feb 06 13:56:30 2018 +0100
@@ -107,14 +107,10 @@
AddBitmapFolder(os.path.join(_lpcmanager_path, "images"))
-from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
-from editors.CodeFileEditor import VariablesTable
-from editors.CodeFileEditor import VariablesEditor
from editors.CodeFileEditor import CodeEditor
from controls import ProjectPropertiesPanel
from controls.SearchResultPanel import SearchResultPanel
# from controls.LogViewer import LogViewer
-from WampOptionsEditor import WampOptionsEditor
from VariableExporter import VariableWriter
from PLCControler import PLCControler, ITEMS_UNEDITABLE, ITEM_POU
from wx.lib.scrolledpanel import ScrolledPanel
@@ -718,74 +714,6 @@
self.Language.Append(language)
ProjectPropertiesPanel.__init__ = OurProjectPropertiesPanelInit
-def LeftClick(self, event):
- if event.GetCol() == self.grid.GetNumberCols()-1:
- options = [self.grid.GetCellValue(event.GetRow(), event.GetCol()), self.grid.GetCellValue(event.GetRow(), event.GetCol()-1)]
- desc = self.grid.GetCellValue(event.GetRow(), event.GetCol()-2)
- if hasattr(self, "dialog"):
- self.dialog.SetOptions(options, desc)
- answer = self.dialog.ShowModal()
- #self.dialog.SetOptions(options, desc)
- self.dialog = WampOptionsEditor(self.Parent.Parent, options, desc)
- answer = self.dialog.ShowModal()
- opt,OnChange,value,description = self.dialog.GetOptions()
- self.grid.SetCellValue(event.GetRow(), event.GetCol(), str(opt))
- self.grid.SetCellValue(event.GetRow(), event.GetCol()-1, value)
- self.grid.SetCellValue(event.GetRow(), event.GetCol()-2, description)
- self.Parent.RefreshModel()
-VariablesTable.LeftClick = LeftClick
-def VariablesEditorSetCollSize(self):
- ColSizes = [20, 150] + [130] * (len(self.VariablesDefaultValue) - 2) + [300]
- for col in range(self.Table.GetNumberCols()):
- self.VariablesGrid.SetColSize(col, ColSizes[col])
-VariablesEditor.VariablesEditorSetCollSize = VariablesEditorSetCollSize
-def _updateColAttrs(self, grid):
- wxGrid -> update the column attributes to add the
- appropriate renderer given the column name.
- Otherwise default to the default renderer.
- for row in range(self.GetNumberRows()):
- for col in range(self.GetNumberCols()):
- colname = self.GetColLabelValue(col, False)
- if colname in ["Name", "Initial", "Description", "OnChange"]:
- editor = wx.grid.GridCellTextEditor()
- elif colname == "Class":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters("input,memory,output")
- elif colname == "Type":
- grid.SetReadOnly(row, col, True)
- grid.SetCellEditor(row, col, editor)
- grid.SetCellRenderer(row, col, renderer)
- grid.SetCellBackgroundColour(row, col, wx.WHITE)
- self.grid.SetRowMinimalHeight
- # updated column width, with function VariablesEditorSetCollSize added in VariablesEditor class
- self.Parent.VariablesEditorSetCollSize()
- # added left click option on grid, with function LeftClick added in VariablesTable class
- self.grid.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.LeftClick)
-VariablesTable._updateColAttrs = _updateColAttrs
if __name__ == '__main__':
lpcmanager = LPCManagerLauncher()