# HG changeset patch # User Laurent Bessard # Date 1366838855 -7200 # Node ID 6f4b08348a603dfe98e96454c3b4362acec9c0e1 # Parent ba0b2ca7db26a986f9700c036977b9f1b5e49475 Fixed bug on Windows with sizers on Windows in Master Editor panel when its size changed diff -r ba0b2ca7db26 -r 6f4b08348a60 etherlab/ConfigEditor.py --- a/etherlab/ConfigEditor.py Wed Apr 24 17:27:31 2013 +0200 +++ b/etherlab/ConfigEditor.py Wed Apr 24 23:27:35 2013 +0200 @@ -561,7 +561,7 @@ style=wx.TAB_TRAVERSAL|wx.HSCROLL|wx.VSCROLL) self.EthercatMasterEditor.Bind(wx.EVT_SIZE, self.OnResize) - main_sizer = wx.BoxSizer(wx.VERTICAL) + self.EthercatMasterEditorSizer = wx.BoxSizer(wx.VERTICAL) self.NodesFilter = wx.ComboBox(self.EthercatMasterEditor, style=wx.TE_PROCESS_ENTER) @@ -620,15 +620,12 @@ self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN, self.OnStartupCommandsGridEditorShow) - second_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Nodes variables filter:")) - second_staticbox_sizer = wx.StaticBoxSizer(second_staticbox, wx.VERTICAL) - self.NodesVariables = MasterNodesVariablesSizer(self.EthercatMasterEditor, self.Controler) - second_staticbox_sizer.AddSizer(self.NodesVariables, 1, border=5, flag=wx.GROW|wx.ALL) main_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Node filter:")) staticbox_sizer = wx.StaticBoxSizer(main_staticbox, wx.VERTICAL) - main_sizer.AddSizer(staticbox_sizer, 0, border=10, flag=wx.GROW|wx.ALL) + self.EthercatMasterEditorSizer.AddSizer(staticbox_sizer, 0, border=10, flag=wx.GROW|wx.ALL) + main_staticbox_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=6, vgap=0) main_staticbox_sizer.AddGrowableCol(0) main_staticbox_sizer.AddGrowableRow(2) @@ -644,10 +641,15 @@ border=5, flag=wx.GROW|wx.LEFT|wx.RIGHT|wx.BOTTOM) main_staticbox_sizer.AddWindow(self.StartupCommandsGrid, 1, border=5, flag=wx.GROW|wx.LEFT|wx.RIGHT|wx.BOTTOM) + + second_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Nodes variables filter:")) + second_staticbox_sizer = wx.StaticBoxSizer(second_staticbox, wx.VERTICAL) + second_staticbox_sizer.AddSizer(self.NodesVariables, 1, border=5, flag=wx.GROW|wx.ALL) + main_staticbox_sizer.AddSizer(second_staticbox_sizer, 1, border=5, flag=wx.GROW|wx.LEFT|wx.RIGHT|wx.BOTTOM) - self.EthercatMasterEditor.SetSizer(main_sizer) + self.EthercatMasterEditor.SetSizer(self.EthercatMasterEditorSizer) return self.EthercatMasterEditor @@ -974,7 +976,7 @@ self.EthercatMasterEditor.GetBestSize() xstart, ystart = self.EthercatMasterEditor.GetViewStart() window_size = self.EthercatMasterEditor.GetClientSize() - maxx, maxy = self.EthercatMasterEditor.GetMinSize() + maxx, maxy = self.EthercatMasterEditorSizer.GetMinSize() posx = max(0, min(xstart, (maxx - window_size[0]) / SCROLLBAR_UNIT)) posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT)) self.EthercatMasterEditor.Scroll(posx, posy)