# HG changeset patch # User laurent # Date 1324071887 -3600 # Node ID d65122c61eaf6647f1fde8b0e2e515d77eafd9e7 # Parent 279c16d017f3ee85097168787f915572f34cc93e Moving definition of grids fonts and colours into CustomGrid diff -r 279c16d017f3 -r d65122c61eaf DataTypeEditor.py --- a/DataTypeEditor.py Wed Dec 14 15:18:32 2011 +0100 +++ b/DataTypeEditor.py Fri Dec 16 22:44:47 2011 +0100 @@ -419,12 +419,6 @@ self.StructureElementsGrid = CustomGrid(id=ID_DATATYPEEDITORSTRUCTUREELEMENTSGRID, name='StructureElementsGrid', parent=self.StructurePanel, pos=wx.Point(0, 0), size=wx.Size(0, 150), style=wx.VSCROLL) - self.StructureElementsGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.StructureElementsGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) - self.StructureElementsGrid.SetSelectionBackground(wx.WHITE) - self.StructureElementsGrid.SetSelectionForeground(wx.BLACK) if wx.VERSION >= (2, 6, 0): self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnStructureElementsGridCellChange) self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN, self.OnStructureElementsGridEditorShown) diff -r 279c16d017f3 -r d65122c61eaf PLCOpenEditor.py --- a/PLCOpenEditor.py Wed Dec 14 15:18:32 2011 +0100 +++ b/PLCOpenEditor.py Fri Dec 16 22:44:47 2011 +0100 @@ -3985,12 +3985,6 @@ self.VariablesGrid = CustomGrid(id=ID_DEBUGVARIABLEPANELVARIABLESGRID, name='VariablesGrid', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 150), style=wx.VSCROLL) - self.VariablesGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.VariablesGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) - self.VariablesGrid.SetSelectionBackground(wx.WHITE) - self.VariablesGrid.SetSelectionForeground(wx.BLACK) self.VariablesGrid.SetDropTarget(DebugVariableDropTarget(self)) if wx.VERSION >= (2, 6, 0): self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK, self.OnVariablesGridCellRightClick) diff -r 279c16d017f3 -r d65122c61eaf RessourceEditor.py --- a/RessourceEditor.py Wed Dec 14 15:18:32 2011 +0100 +++ b/RessourceEditor.py Fri Dec 16 22:44:47 2011 +0100 @@ -281,10 +281,6 @@ self.TasksGrid = CustomGrid(id=ID_RESOURCEEDITORTASKSGRID, name='TasksGrid', parent=self.Editor, pos=wx.Point(0, 0), size=wx.Size(-1, -1), style=wx.VSCROLL) - self.TasksGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.TasksGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) if wx.VERSION >= (2, 6, 0): self.TasksGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnTasksGridCellChange) else: @@ -313,10 +309,6 @@ self.InstancesGrid = CustomGrid(id=ID_RESOURCEEDITORINSTANCESGRID, name='InstancesGrid', parent=self.Editor, pos=wx.Point(0, 0), size=wx.Size(-1, -1), style=wx.VSCROLL) - self.InstancesGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.InstancesGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) if wx.VERSION >= (2, 6, 0): self.InstancesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnInstancesGridCellChange) else: diff -r 279c16d017f3 -r d65122c61eaf controls/CustomGrid.py --- a/controls/CustomGrid.py Wed Dec 14 15:18:32 2011 +0100 +++ b/controls/CustomGrid.py Fri Dec 16 22:44:47 2011 +0100 @@ -39,6 +39,16 @@ self.Editable = True + self.AddButton = None + self.DeleteButton = None + self.UpButton = None + self.DownButton = None + + self.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, 'Sans')) + self.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, False, 'Sans')) + self.SetSelectionBackground(wx.WHITE) + self.SetSelectionForeground(wx.BLACK) + if wx.VERSION >= (2, 6, 0): self.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.OnSelectCell) else: diff -r 279c16d017f3 -r d65122c61eaf controls/CustomTable.py --- a/controls/CustomTable.py Wed Dec 14 15:18:32 2011 +0100 +++ b/controls/CustomTable.py Fri Dec 16 22:44:47 2011 +0100 @@ -108,6 +108,8 @@ for row in range(self.GetNumberRows()): row_highlights = self.Highlights.get(row, {}) for col in range(self.GetNumberCols()): + colname = self.GetColLabelValue(col, False) + grid.SetReadOnly(row, col, True) grid.SetCellEditor(row, col, None) grid.SetCellRenderer(row, col, None) diff -r 279c16d017f3 -r d65122c61eaf controls/VariablePanel.py --- a/controls/VariablePanel.py Wed Dec 14 15:18:32 2011 +0100 +++ b/controls/VariablePanel.py Fri Dec 16 22:44:47 2011 +0100 @@ -337,12 +337,6 @@ self.VariablesGrid = CustomGrid(id=ID_VARIABLEEDITORPANELVARIABLESGRID, name='VariablesGrid', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.VSCROLL) - self.VariablesGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.VariablesGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) - self.VariablesGrid.SetSelectionBackground(wx.WHITE) - self.VariablesGrid.SetSelectionForeground(wx.BLACK) self.VariablesGrid.SetDropTarget(VariableDropTarget(self)) if wx.VERSION >= (2, 6, 0): self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnVariablesGridCellChange) diff -r 279c16d017f3 -r d65122c61eaf dialogs/ActionBlockDialog.py --- a/dialogs/ActionBlockDialog.py Wed Dec 14 15:18:32 2011 +0100 +++ b/dialogs/ActionBlockDialog.py Fri Dec 16 22:44:47 2011 +0100 @@ -171,10 +171,6 @@ self.ActionsGrid = CustomGrid(id=ID_ACTIONBLOCKDIALOGVARIABLESGRID, name='ActionsGrid', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.VSCROLL) - self.ActionsGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False, - 'Sans')) - self.ActionsGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL, - False, 'Sans')) self.ActionsGrid.DisableDragGridSize() self.ActionsGrid.EnableScrolling(False, True) if wx.VERSION >= (2, 6, 0):