Commit 5ad02309c0695a4f24be3c7b262eeff0d14273e5

Authored by Thiago Franco de Moraes
1 parent 1aea7156
Exists in ff_mask

Better gui

Showing 1 changed file with 18 additions and 13 deletions   Show diff stats
invesalius/gui/dialogs.py
... ... @@ -1851,23 +1851,25 @@ class FFillOptionsDialog(wx.Dialog):
1851 1851 self._init_gui()
1852 1852  
1853 1853 def _init_gui(self):
1854   - sizer = wx.GridBagSizer(3, 3)
  1854 + sizer = wx.GridBagSizer(5, 6)
1855 1855  
1856 1856 flag_labels = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL
1857 1857  
1858   - self.target = wx.RadioBox(self, -1, "",
1859   - choices=[_(u"2D - Actual slice"), _(u"3D - Entire volume")],
1860   - style=wx.NO_BORDER | wx.VERTICAL)
  1858 + # self.target = wx.RadioBox(self, -1, "",
  1859 + # choices=[_(u"2D - Actual slice"), _(u"3D - Entire volume")],
  1860 + # style=wx.NO_BORDER | wx.VERTICAL)
  1861 + self.target_2d = wx.RadioButton(self, -1, _(u"2D - Actual slice"))
  1862 + self.target_3d = wx.RadioButton(self, -1, _(u"3D - All slices"))
1861 1863  
1862 1864 if self.config.target == "2D":
1863   - self.target.SetSelection(0)
  1865 + self.target_2d.SetValue(1)
1864 1866 else:
1865   - self.target.SetSelection(1)
  1867 + self.target_3d.SetValue(1)
1866 1868  
1867 1869 choices2d = ["4", "8"]
1868 1870 choices3d = ["6", "18", "26"]
1869   - self.conect2D = wx.RadioBox(self, -1, _(u"2D Connectivity"), choices=choices2d)
1870   - self.conect3D = wx.RadioBox(self, -1, _(u"3D Connectivity"), choices=choices3d)
  1871 + self.conect2D = wx.RadioBox(self, -1, _(u"2D Connectivity"), choices=choices2d, style=wx.NO_BORDER | wx.HORIZONTAL)
  1872 + self.conect3D = wx.RadioBox(self, -1, _(u"3D Connectivity"), choices=choices3d, style=wx.NO_BORDER | wx.HORIZONTAL)
1871 1873  
1872 1874 try:
1873 1875 self.conect2D.SetSelection(choices2d.index(str(self.config.con_2d)))
... ... @@ -1883,21 +1885,24 @@ class FFillOptionsDialog(wx.Dialog):
1883 1885 self.conect3D.SetSelection(0)
1884 1886 self.config.con_3d = 6
1885 1887  
1886   - sizer.Add(self.target, (0, 0), (1, 3), flag=wx.EXPAND, border=5)
1887   - sizer.Add(self.conect2D, (1, 0), flag=wx.EXPAND, border=5)
1888   - sizer.Add(self.conect3D, (2, 0), flag=wx.EXPAND, border=5)
  1888 + sizer.Add(wx.StaticText(self, -1, _(u"Parameters")), (0, 0), flag=wx.TOP | wx.LEFT | wx.RIGHT, border=5)
  1889 + sizer.AddStretchSpacer((0, 5))
  1890 + sizer.Add(self.target_2d, (1, 0), (1, 3))
  1891 + sizer.Add(self.target_3d, (2, 0), (1, 3))
  1892 + sizer.Add(self.conect2D, (3, 0), flag=wx.TOP | wx.LEFT | wx.RIGHT, border=5)
  1893 + sizer.Add(self.conect3D, (4, 0), flag=wx.TOP | wx.LEFT | wx.RIGHT, border=5)
1889 1894  
1890 1895 self.SetSizer(sizer)
1891 1896 sizer.Fit(self)
1892 1897 self.Layout()
1893 1898  
1894   - self.target.Bind(wx.EVT_RADIOBOX, self.OnSetTarget)
  1899 + self.Bind(wx.EVT_RADIOBUTTON, self.OnSetTarget)
1895 1900 self.conect2D.Bind(wx.EVT_RADIOBOX, self.OnSetCon2D)
1896 1901 self.conect3D.Bind(wx.EVT_RADIOBOX, self.OnSetCon3D)
1897 1902 self.Bind(wx.EVT_CLOSE, self.OnClose)
1898 1903  
1899 1904 def OnSetTarget(self, evt):
1900   - if self.target.GetSelection() == 0:
  1905 + if self.target_2d.GetValue():
1901 1906 self.config.target = "2D"
1902 1907 else:
1903 1908 self.config.target = "3D"
... ...