# HG changeset patch # User Sergey Surkov # Date 1488811169 -10800 # Node ID a079b0322a48d8977f0a145dfabbfa3c269ac867 # Parent f4696d85552a8c50af021066a292d3647a7f42f2# Parent f077f8fb9ba7d99c9cf90058cee934fb1f952a0d Merged skvorl/beremiz into default diff -r f077f8fb9ba7 -r a079b0322a48 controls/VariablePanel.py --- a/controls/VariablePanel.py Mon Mar 06 17:24:05 2017 +0500 +++ b/controls/VariablePanel.py Mon Mar 06 17:39:29 2017 +0300 @@ -506,8 +506,9 @@ c = wx.ALIGN_CENTER # Num Name Class Type Loc Init Option Doc - self.ColSizes = [40, 80, 70, 80, 80, 80, 100, 80] + self.ColSizes = [40, 80, 100, 80, 110, 120, 100, 160] self.ColAlignements = [c, l, l, l, l, l, l, l] + self.ColFixedSizeFlag=[True,False, True, False, True, True, True, False] else: # this is an element that cannot have located variables @@ -527,8 +528,9 @@ c = wx.ALIGN_CENTER # Num Name Class Type Init Option Doc - self.ColSizes = [40, 80, 70, 80, 80, 100, 160] + self.ColSizes = [40, 80, 100, 80, 120, 100, 160] self.ColAlignements = [c, l, l, l, l, l, l] + self.ColFixedSizeFlag=[True,False, True, False, True, True, False] self.ElementType = element_type self.BodyType = None @@ -636,13 +638,23 @@ self.DownButton.Enable(not self.Debug and (table_length > 0 and row < table_length - 1 and self.Filter == "All")) setattr(self.VariablesGrid, "RefreshButtons", _RefreshButtons) + stretch_cols_width = window.Parent.ScreenRect.Width - 35 + stretch_cols_sum = 0 + for col in range(len(self.ColFixedSizeFlag)): + if self.ColFixedSizeFlag[col]: + stretch_cols_width -= self.ColSizes[col] + else: + stretch_cols_sum += self.ColSizes[col] self.VariablesGrid.SetRowLabelSize(0) for col in range(self.Table.GetNumberCols()): attr = wx.grid.GridCellAttr() attr.SetAlignment(self.ColAlignements[col], wx.ALIGN_CENTRE) self.VariablesGrid.SetColAttr(col, attr) self.VariablesGrid.SetColMinimalWidth(col, self.ColSizes[col]) - self.VariablesGrid.AutoSizeColumn(col, False) + if not self.ColFixedSizeFlag[col]: + self.VariablesGrid.SetColSize(col, int((float(self.ColSizes[col])/stretch_cols_sum)*stretch_cols_width)) + else: + self.VariablesGrid.SetColSize(col, self.ColSizes[col]) def __del__(self): self.RefreshHighlightsTimer.Stop() diff -r f077f8fb9ba7 -r a079b0322a48 graphics/SFC_Objects.py --- a/graphics/SFC_Objects.py Mon Mar 06 17:24:05 2017 +0500 +++ b/graphics/SFC_Objects.py Mon Mar 06 17:39:29 2017 +0300 @@ -70,7 +70,7 @@ if self.Output is not None: self.Output.Flush() self.Output = None - if self.Output is not None: + if self.Action is not None: self.Action.Flush() self.Action = None @@ -653,8 +653,10 @@ # Returns the RedrawRect def GetRedrawRect(self, movex = 0, movey = 0): rect = Graphic_Element.GetRedrawRect(self, movex, movey) - rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) - rect = rect.Union(self.Output.GetRedrawRect(movex, movey)) + if self.Input: + rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) + if self.Output: + rect = rect.Union(self.Output.GetRedrawRect(movex, movey)) if movex != 0 or movey != 0: if self.Input.IsConnected(): rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey)) @@ -1547,7 +1549,8 @@ # Returns the RedrawRect def GetRedrawRect(self, movex = 0, movey = 0): rect = Graphic_Element.GetRedrawRect(self, movex, movey) - rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) + if self.Input: + rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) if movex != 0 or movey != 0: if self.Input.IsConnected(): rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey)) @@ -1824,7 +1827,8 @@ # Returns the RedrawRect def GetRedrawRect(self, movex = 0, movey = 0): rect = Graphic_Element.GetRedrawRect(self, movex, movey) - rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) + if self.Input: + rect = rect.Union(self.Input.GetRedrawRect(movex, movey)) if movex != 0 or movey != 0: if self.Input.IsConnected(): rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey))