Commit 7adf2d471134e09e11e3d69c76b3a3e503ad8984

Authored by Thiago Franco de Moraes
1 parent 30b43a7b
Exists in ffill_gui

better pos

Showing 1 changed file with 34 additions and 13 deletions   Show diff stats
invesalius/gui/dialogs.py
@@ -1954,17 +1954,33 @@ class PanelFFillDynamic(wx.Panel): @@ -1954,17 +1954,33 @@ class PanelFFillDynamic(wx.Panel):
1954 self._init_gui() 1954 self._init_gui()
1955 1955
1956 def _init_gui(self): 1956 def _init_gui(self):
1957 - self.use_ww_wl = wx.CheckBox(self, -1, _(u"Use WW\&WL")) 1957 + self.use_ww_wl = wx.CheckBox(self, -1, _(u"Use WW&WL"))
1958 self.use_ww_wl.SetValue(self.config.use_ww_wl) 1958 self.use_ww_wl.SetValue(self.config.use_ww_wl)
1959 1959
1960 self.deviation_min = wx.SpinCtrl(self, -1, value='%d' % self.config.dev_min, min=0, max=10000) 1960 self.deviation_min = wx.SpinCtrl(self, -1, value='%d' % self.config.dev_min, min=0, max=10000)
  1961 + w, h = self.deviation_min.GetTextExtent('M')
  1962 + self.deviation_min.SetMinSize((w*5, -1))
  1963 +
1961 self.deviation_max = wx.SpinCtrl(self, -1, value='%d' % self.config.dev_max, min=0, max=10000) 1964 self.deviation_max = wx.SpinCtrl(self, -1, value='%d' % self.config.dev_max, min=0, max=10000)
  1965 + self.deviation_max.SetMinSize((w*5, -1))
1962 1966
1963 - sizer = wx.BoxSizer(wx.VERTICAL) 1967 + sizer = wx.GridBagSizer(5, 5)
  1968 +
  1969 + sizer.AddStretchSpacer((0, 0))
  1970 +
  1971 + sizer.Add(self.use_ww_wl, (1, 0), (1, 6), flag=wx.LEFT, border=5)
  1972 +
  1973 + sizer.AddStretchSpacer((2, 0))
1964 1974
1965 - sizer.Add(self.use_ww_wl)  
1966 - sizer.Add(self.deviation_min)  
1967 - sizer.Add(self.deviation_max) 1975 + sizer.Add(wx.StaticText(self, -1, _(u"Deviation")), (3, 0), (1, 6), flag=wx.LEFT, border=5)
  1976 +
  1977 + sizer.Add(wx.StaticText(self, -1, _(u"Min:")), (4, 0), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT, border=9)
  1978 + sizer.Add(self.deviation_min, (4, 1))
  1979 +
  1980 + sizer.Add(wx.StaticText(self, -1, _(u"Max:")), (4, 2), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT, border=9)
  1981 + sizer.Add(self.deviation_max, (4, 3))
  1982 +
  1983 + sizer.AddStretchSpacer((5, 0))
1968 1984
1969 self.SetSizer(sizer) 1985 self.SetSizer(sizer)
1970 sizer.Fit(self) 1986 sizer.Fit(self)
@@ -2232,12 +2248,12 @@ class FFillSegmentationOptionsDialog(wx.Dialog): @@ -2232,12 +2248,12 @@ class FFillSegmentationOptionsDialog(wx.Dialog):
2232 self.cmb_method.SetSelection(0) 2248 self.cmb_method.SetSelection(0)
2233 self.config.method = 'threshold' 2249 self.config.method = 'threshold'
2234 2250
2235 - self.panel_ffill_threshold = PanelFFillThreshold(self, self.config, -1)  
2236 - self.panel_ffill_threshold.SetMinSize((300, -1)) 2251 + self.panel_ffill_threshold = PanelFFillThreshold(self, self.config, -1, style=border_style|wx.TAB_TRAVERSAL)
  2252 + self.panel_ffill_threshold.SetMinSize((250, -1))
2237 self.panel_ffill_threshold.Hide() 2253 self.panel_ffill_threshold.Hide()
2238 2254
2239 - self.panel_ffill_dynamic = PanelFFillDynamic(self, self.config, -1)  
2240 - self.panel_ffill_dynamic.SetMinSize((300, -1)) 2255 + self.panel_ffill_dynamic = PanelFFillDynamic(self, self.config, -1, style=border_style|wx.TAB_TRAVERSAL)
  2256 + self.panel_ffill_dynamic.SetMinSize((250, -1))
2241 self.panel_ffill_dynamic.Hide() 2257 self.panel_ffill_dynamic.Hide()
2242 2258
2243 self.close_btn = wx.Button(self, wx.ID_CLOSE) 2259 self.close_btn = wx.Button(self, wx.ID_CLOSE)
@@ -2255,18 +2271,23 @@ class FFillSegmentationOptionsDialog(wx.Dialog): @@ -2255,18 +2271,23 @@ class FFillSegmentationOptionsDialog(wx.Dialog):
2255 sizer.Add(self.panel3dcon, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7) 2271 sizer.Add(self.panel3dcon, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7)
2256 sizer.AddSpacer(5) 2272 sizer.AddSpacer(5)
2257 2273
2258 - sizer.Add(wx.StaticText(self, -1, _(u"Method")), flag=wx.LEFT, border=9) 2274 + sizer_m = wx.BoxSizer(wx.HORIZONTAL)
  2275 +
  2276 + sizer_m.Add(wx.StaticText(self, -1, _(u"Method"), style=wx.ALIGN_CENTER_VERTICAL), 0, flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, border=7)
  2277 + sizer_m.Add(self.cmb_method, 1, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7)
  2278 +
  2279 + sizer.Add(sizer_m, 1, wx.EXPAND)
  2280 +
2259 sizer.AddSpacer(5) 2281 sizer.AddSpacer(5)
2260 - sizer.Add(self.cmb_method, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7)  
2261 2282
2262 if self.config.method == 'dynamic': 2283 if self.config.method == 'dynamic':
2263 self.cmb_method.SetSelection(1) 2284 self.cmb_method.SetSelection(1)
2264 self.panel_ffill_dynamic.Show() 2285 self.panel_ffill_dynamic.Show()
2265 - sizer.Add(self.panel_ffill_dynamic, flag=wx.LEFT, border=11) 2286 + sizer.Add(self.panel_ffill_dynamic, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7)
2266 else: 2287 else:
2267 self.cmb_method.SetSelection(0) 2288 self.cmb_method.SetSelection(0)
2268 self.panel_ffill_threshold.Show() 2289 self.panel_ffill_threshold.Show()
2269 - sizer.Add(self.panel_ffill_threshold, flag=wx.LEFT, border=11) 2290 + sizer.Add(self.panel_ffill_threshold, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=7)
2270 self.config.method = 'threshold' 2291 self.config.method = 'threshold'
2271 2292
2272 sizer.AddSpacer(5) 2293 sizer.AddSpacer(5)