From 8ca8a4ea73b7328695be84dc2356c82bd51e51a4 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Fri, 19 Aug 2016 10:13:22 -0300 Subject: [PATCH] Better gui --- invesalius/data/styles.py | 6 +++++- invesalius/gui/dialogs.py | 4 ++-- invesalius/gui/frame.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 385726d..f5d6755 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1778,12 +1778,14 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): self.t1 = 1 self.fill_value = 254 + self._dlg_title = _(u"Fill holes") + self.AddObserver("LeftButtonPressEvent", self.OnFFClick) def SetUp(self): if not self.config.dlg_visible: self.config.dlg_visible = True - self.dlg_ffill = dialogs.FFillOptionsDialog(self.config) + self.dlg_ffill = dialogs.FFillOptionsDialog(self._dlg_title, self.config) self.dlg_ffill.Show() def CleanUp(self): @@ -1909,6 +1911,8 @@ class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): self.t1 = 255 self.fill_value = 1 + self._dlg_title = _(u"Remove parts") + def get_style(style): STYLES = { diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 9c00fc4..839cdc8 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -1841,9 +1841,9 @@ def BitmapNotSameSize(): class FFillOptionsDialog(wx.Dialog): - def __init__(self, config): + def __init__(self, title, config): pre = wx.PreDialog() - pre.Create(wx.GetApp().GetTopWindow(), -1, _(u'Floodfill options'), style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT) + pre.Create(wx.GetApp().GetTopWindow(), -1, title, style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT) self.PostCreate(pre) self.config = config diff --git a/invesalius/gui/frame.py b/invesalius/gui/frame.py index 2e61155..90e10f3 100644 --- a/invesalius/gui/frame.py +++ b/invesalius/gui/frame.py @@ -703,7 +703,7 @@ class MenuBar(wx.MenuBar): self.clean_mask_menu = mask_menu.Append(const.ID_CLEAN_MASK, _(u"Clean Mask\tCtrl+Shift+A")) self.clean_mask_menu.Enable(False) - self.fill_hole_mask_menu = mask_menu.Append(const.ID_FLOODFILL_MASK, _(u"Fill mask holes manually")) + self.fill_hole_mask_menu = mask_menu.Append(const.ID_FLOODFILL_MASK, _(u"Fill holes manually")) self.fill_hole_mask_menu.Enable(False) self.remove_mask_part_menu = mask_menu.Append(const.ID_REMOVE_MASK_PART, _(u"Remove parts")) -- libgit2 0.21.2