Commit 2301b99320b9042e613020a97a1a28dc535b34c1

Authored by Thiago Franco de Moraes
1 parent 70caa2bc
Exists in master

Not allowing to set spacing values as 0

Showing 1 changed file with 8 additions and 1 deletions   Show diff stats
invesalius/gui/dialogs.py
... ... @@ -4460,7 +4460,14 @@ class SetSpacingDialog(wx.Dialog):
4460 4460 self.txt_spacing_new_z.ChangeValue(str(sz))
4461 4461  
4462 4462 def OnOk(self, evt):
4463   - self.EndModal(wx.ID_OK)
  4463 + if self.spacing_new_x == 0.0:
  4464 + self.txt_spacing_new_x.SetFocus()
  4465 + elif self.spacing_new_y == 0.0:
  4466 + self.txt_spacing_new_y.SetFocus()
  4467 + elif self.spacing_new_z == 0.0:
  4468 + self.txt_spacing_new_z.SetFocus()
  4469 + else:
  4470 + self.EndModal(wx.ID_OK)
4464 4471  
4465 4472 def OnCancel(self, evt):
4466 4473 self.EndModal(wx.ID_CANCEL)
... ...