Commit a9d0eca4 authored by Guillaume Seguin's avatar Guillaume Seguin

Switch to WrapSizer for custom buttons if possible

parent 6f149dbb
......@@ -497,6 +497,8 @@ class MainWindow(wx.Frame):
self.Bind(wx.EVT_CLOSE, self.kill)
# Custom buttons
if wx.VERSION > (2, 9): self.centersizer = wx.WrapSizer(wx.HORIZONTAL)
else: self.centersizer = wx.GridBagSizer()
self.centersizer = wx.GridBagSizer()
self.centerpanel = self.newPanel(page1panel2)
self.centerpanel.SetSizer(self.centersizer)
......@@ -546,7 +548,8 @@ class MainWindow(wx.Frame):
logpanel = self.newPanel(lowerpanel)
viz_pane = VizPane(self, vizpanel)
# Custom buttons
self.centersizer = wx.GridBagSizer()
if wx.VERSION > (2, 9): self.centersizer = wx.WrapSizer(wx.HORIZONTAL)
else: self.centersizer = wx.GridBagSizer()
self.centerpanel = self.newPanel(vizpanel)
self.centerpanel.SetSizer(self.centersizer)
viz_pane.Add(self.centerpanel, 0, flag = wx.ALIGN_CENTER)
......
......@@ -995,7 +995,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
b.Bind(wx.EVT_BUTTON, self.procbutton)
b.Bind(wx.EVT_MOUSE_EVENTS, self.editbutton)
self.custombuttonbuttons.append(b)
self.centersizer.Add(b, pos = (i // 4, i % 4), flag = wx.EXPAND)
if type(self.centersizer) == wx.GridBagSizer:
self.centersizer.Add(b, pos = (i // 4, i % 4), flag = wx.EXPAND)
else:
self.centersizer.Add(b, flag = wx.EXPAND)
self.Fit()
def help_button(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment