From 19a3036527f1978bd0b23eed74f372cc2d0d53ff Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Mon, 27 Jun 2016 10:48:32 +0100 Subject: [PATCH] Fixed CheckBoxMessageDialog default button selection --- fsl/utils/dialog.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fsl/utils/dialog.py b/fsl/utils/dialog.py index 81d95e9cf..83dd52a7e 100644 --- a/fsl/utils/dialog.py +++ b/fsl/utils/dialog.py @@ -852,14 +852,13 @@ class CheckBoxMessageDialog(wx.Dialog): self.__message.Wrap(self.GetSize().GetWidth()) - yes = self.__yesButton - no = self.__noButton - cancel = self.__cancelButton - - # TODO This does not work. - if focus == 'yes': yes .SetFocus() - elif focus == 'no' and no is not None: no .SetFocus() - elif focus == 'cancel' and cancel is not None: cancel.SetFocus() + yes = self.__yesButton + no = self.__noButton + cncl = self.__cancelButton + + if focus == 'yes': yes .SetDefault() + elif focus == 'no' and no is not None: no .SetDefault() + elif focus == 'cancel' and cncl is not None: cncl.SetDefault() self.SetSizer(self.__mainSizer) self.Layout() -- GitLab