Commit 4dcf4dfcb1fb64ae2863671d453531003815b98b

Authored by tfmoraes
1 parent 1bbb3a3a

In MacOSX it wasn't possible to use mouse in the dialog used to create a new surface

Showing 1 changed file with 9 additions and 5 deletions   Show diff stats
invesalius/gui/dialogs.py
@@ -1024,15 +1024,18 @@ class SurfaceCreationDialog(wx.Dialog): @@ -1024,15 +1024,18 @@ class SurfaceCreationDialog(wx.Dialog):
1024 1024
1025 self.CenterOnScreen() 1025 self.CenterOnScreen()
1026 1026
  1027 + # It's necessary to create a staticbox before is children widgets
  1028 + # because otherwise in MacOSX it'll not be possible to use the mouse in
  1029 + # static's children widgets.
  1030 + sb_nsd = wx.StaticBox(self, -1, _('Surface creation options'))
1027 self.nsd = SurfaceCreationOptionsPanel(self, -1) 1031 self.nsd = SurfaceCreationOptionsPanel(self, -1)
1028 self.nsd.Bind(EVT_MASK_SET, self.OnSetMask) 1032 self.nsd.Bind(EVT_MASK_SET, self.OnSetMask)
1029 - surface_options_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1,  
1030 - _('Surface creation options')), wx.VERTICAL) 1033 + surface_options_sizer = wx.StaticBoxSizer(sb_nsd, wx.VERTICAL)
1031 surface_options_sizer.Add(self.nsd, 1, wx.EXPAND|wx.ALL, 5) 1034 surface_options_sizer.Add(self.nsd, 1, wx.EXPAND|wx.ALL, 5)
1032 1035
  1036 + sb_ca = wx.StaticBox(self, -1, _('Surface creation method'))
1033 self.ca = SurfaceMethodPanel(self, -1, mask_edited) 1037 self.ca = SurfaceMethodPanel(self, -1, mask_edited)
1034 - surface_method_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1,  
1035 - _('Surface creation method')), wx.VERTICAL) 1038 + surface_method_sizer = wx.StaticBoxSizer(sb_ca, wx.VERTICAL)
1036 surface_method_sizer.Add(self.ca, 1, wx.EXPAND|wx.ALL, 5) 1039 surface_method_sizer.Add(self.ca, 1, wx.EXPAND|wx.ALL, 5)
1037 1040
1038 btn_ok = wx.Button(self, wx.ID_OK) 1041 btn_ok = wx.Button(self, wx.ID_OK)
@@ -1178,6 +1181,7 @@ class CAOptions(wx.Panel): @@ -1178,6 +1181,7 @@ class CAOptions(wx.Panel):
1178 self._build_widgets() 1181 self._build_widgets()
1179 1182
1180 def _build_widgets(self): 1183 def _build_widgets(self):
  1184 + sb = wx.StaticBox(self, -1, _('Context aware options'))
1181 self.angle = floatspin.FloatSpin(self, -1, value=0.7, min_val=0.0, 1185 self.angle = floatspin.FloatSpin(self, -1, value=0.7, min_val=0.0,
1182 max_val=1.0, increment=0.1, 1186 max_val=1.0, increment=0.1,
1183 digits=1) 1187 digits=1)
@@ -1202,7 +1206,7 @@ class CAOptions(wx.Panel): @@ -1202,7 +1206,7 @@ class CAOptions(wx.Panel):
1202 layout_sizer.Add(wx.StaticText(self, -1, _(u'N. steps:')), 0, wx.EXPAND) 1206 layout_sizer.Add(wx.StaticText(self, -1, _(u'N. steps:')), 0, wx.EXPAND)
1203 layout_sizer.Add(self.steps, 0, wx.EXPAND) 1207 layout_sizer.Add(self.steps, 0, wx.EXPAND)
1204 1208
1205 - self.main_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, _('Context aware options')), wx.VERTICAL) 1209 + self.main_sizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
1206 self.main_sizer.Add(layout_sizer, 0, wx.EXPAND | wx.ALL, 5) 1210 self.main_sizer.Add(layout_sizer, 0, wx.EXPAND | wx.ALL, 5)
1207 self.SetSizer(self.main_sizer) 1211 self.SetSizer(self.main_sizer)
1208 1212