From 3a3d1ea61ddcad16b359516ef1f1e90a669108e0 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 6 May 2015 10:32:42 -0300 Subject: [PATCH] Fixed the problems with backgroundcolour from statictext in the taskbar --- invesalius/gui/task_exporter.py | 9 ++++++++- invesalius/gui/task_importer.py | 16 +++++++++++++--- invesalius/gui/task_slice.py | 10 ++++++---- invesalius/gui/task_surface.py | 16 ++++++++-------- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/invesalius/gui/task_exporter.py b/invesalius/gui/task_exporter.py index f1b4522..afd143d 100644 --- a/invesalius/gui/task_exporter.py +++ b/invesalius/gui/task_exporter.py @@ -99,7 +99,8 @@ class InnerTaskPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) - self.SetBackgroundColour(wx.Colour(255,255,255)) + backgroud_colour = wx.Colour(255,255,255) + self.SetBackgroundColour(backgroud_colour) self.SetAutoLayout(1) # Counter for projects loaded in current GUI @@ -109,7 +110,9 @@ class InnerTaskPanel(wx.Panel): link_export_picture = hl.HyperLinkCtrl(self, -1, _("Export picture...")) link_export_picture.SetUnderlines(False, False, False) + link_export_picture.SetBold(True) link_export_picture.SetColours("BLACK", "BLACK", "BLACK") + link_export_picture.SetBackgroundColour(self.GetBackgroundColour()) link_export_picture.SetToolTip(tooltip) link_export_picture.AutoBrowse(False) link_export_picture.UpdateLink() @@ -119,7 +122,9 @@ class InnerTaskPanel(wx.Panel): tooltip = wx.ToolTip(_("Export 3D surface")) link_export_surface = hl.HyperLinkCtrl(self, -1,_("Export 3D surface...")) link_export_surface.SetUnderlines(False, False, False) + link_export_surface.SetBold(True) link_export_surface.SetColours("BLACK", "BLACK", "BLACK") + link_export_surface.SetBackgroundColour(self.GetBackgroundColour()) link_export_surface.SetToolTip(tooltip) link_export_surface.AutoBrowse(False) link_export_surface.UpdateLink() @@ -189,11 +194,13 @@ class InnerTaskPanel(wx.Panel): button_picture = pbtn.PlateButton(self, BTN_PICTURE, "", BMP_TAKE_PICTURE, style=button_style) + button_picture.SetBackgroundColour(self.GetBackgroundColour()) self.button_picture = button_picture button_surface = pbtn.PlateButton(self, BTN_SURFACE, "", BMP_EXPORT_SURFACE, style=button_style) + button_surface.SetBackgroundColour(self.GetBackgroundColour()) #button_mask = pbtn.PlateButton(self, BTN_MASK, "", # BMP_EXPORT_MASK, # style=button_style) diff --git a/invesalius/gui/task_importer.py b/invesalius/gui/task_importer.py index 0cf763a..758bb95 100644 --- a/invesalius/gui/task_importer.py +++ b/invesalius/gui/task_importer.py @@ -51,7 +51,10 @@ class TaskPanel(wx.Panel): class InnerTaskPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) - self.SetBackgroundColour(wx.Colour(255,255,255)) + + backgroud_colour = wx.Colour(255,255,255) + + self.SetBackgroundColour(backgroud_colour) self.SetAutoLayout(1) # Counter for projects loaded in current GUI @@ -64,7 +67,9 @@ class InnerTaskPanel(wx.Panel): tooltip = wx.ToolTip(_("Select DICOM or Analyze files to be reconstructed")) link_import_local = hl.HyperLinkCtrl(self, -1, _("Import medical images...")) link_import_local.SetUnderlines(False, False, False) + link_import_local.SetBold(True) link_import_local.SetColours("BLACK", "BLACK", "BLACK") + link_import_local.SetBackgroundColour(backgroud_colour) link_import_local.SetToolTip(tooltip) link_import_local.AutoBrowse(False) link_import_local.UpdateLink() @@ -82,7 +87,9 @@ class InnerTaskPanel(wx.Panel): tooltip = wx.ToolTip(_("Open an existing InVesalius project...")) link_open_proj = hl.HyperLinkCtrl(self,-1,_("Open an existing project...")) link_open_proj.SetUnderlines(False, False, False) + link_open_proj.SetBold(True) link_open_proj.SetColours("BLACK", "BLACK", "BLACK") + link_open_proj.SetBackgroundColour(backgroud_colour) link_open_proj.SetToolTip(tooltip) link_open_proj.AutoBrowse(False) link_open_proj.UpdateLink() @@ -105,8 +112,10 @@ class InnerTaskPanel(wx.Panel): # style=button_style) button_import_local = pbtn.PlateButton(self, BTN_IMPORT_LOCAL, "", BMP_IMPORT, style=button_style) + button_import_local.SetBackgroundColour(self.GetBackgroundColour()) button_open_proj = pbtn.PlateButton(self, BTN_OPEN_PROJECT, "", BMP_OPEN_PROJECT, style=button_style) + button_open_proj.SetBackgroundColour(self.GetBackgroundColour()) # When using PlaneButton, it is necessary to bind events from parent win self.Bind(wx.EVT_BUTTON, self.OnButton) @@ -185,6 +194,7 @@ class InnerTaskPanel(wx.Panel): proj_link = hl.HyperLinkCtrl(self, -1, label) proj_link.SetUnderlines(False, False, False) proj_link.SetColours("BLACK", "BLACK", "BLACK") + proj_link.SetBackgroundColour(self.GetBackgroundColour()) proj_link.AutoBrowse(False) proj_link.UpdateLink() proj_link.Bind(hl.EVT_HYPERLINK_LEFT, @@ -201,7 +211,7 @@ class InnerTaskPanel(wx.Panel): def OnLinkImport(self, event): self.ImportDicom() event.Skip() - + def OnLinkImportPACS(self, event): self.ImportPACS() event.Skip() @@ -210,7 +220,7 @@ class InnerTaskPanel(wx.Panel): self.OpenProject() event.Skip() - + def ImportPACS(self): print "TODO: Send Signal - Import DICOM files from PACS" diff --git a/invesalius/gui/task_slice.py b/invesalius/gui/task_slice.py index e1bf8a7..f5bd8a2 100644 --- a/invesalius/gui/task_slice.py +++ b/invesalius/gui/task_slice.py @@ -65,7 +65,8 @@ class TaskPanel(wx.Panel): class InnerTaskPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) - self.SetBackgroundColour(wx.Colour(255,255,255)) + backgroud_colour = wx.Colour(255,255,255) + self.SetBackgroundColour(backgroud_colour) self.SetAutoLayout(1) # Image(s) for buttons @@ -76,6 +77,7 @@ class InnerTaskPanel(wx.Panel): # Button for creating new surface button_new_mask = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\ pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT) + button_new_mask.SetBackgroundColour(self.GetBackgroundColour()) self.Bind(wx.EVT_BUTTON, self.OnButton) @@ -83,7 +85,9 @@ class InnerTaskPanel(wx.Panel): tooltip = wx.ToolTip(_("Create mask for slice segmentation and editing")) link_new_mask = hl.HyperLinkCtrl(self, -1, _("Create new mask")) link_new_mask.SetUnderlines(False, False, False) + link_new_mask.SetBold(True) link_new_mask.SetColours("BLACK", "BLACK", "BLACK") + link_new_mask.SetBackgroundColour(self.GetBackgroundColour()) link_new_mask.SetToolTip(tooltip) link_new_mask.AutoBrowse(False) link_new_mask.UpdateLink() @@ -201,7 +205,6 @@ class InnerTaskPanel(wx.Panel): class FoldPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) - self.SetBackgroundColour(wx.Colour(0,255,0)) inner_panel = InnerFoldPanel(self) @@ -223,8 +226,7 @@ class InnerFoldPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) - #self.SetBackgroundColour(default_colour) - self.SetBackgroundColour((255, 0, 0)) + self.SetBackgroundColour(default_colour) # Fold panel and its style settings # FIXME: If we dont insert a value in size or if we set wx.DefaultSize, diff --git a/invesalius/gui/task_surface.py b/invesalius/gui/task_surface.py index 4790360..9bf489c 100644 --- a/invesalius/gui/task_surface.py +++ b/invesalius/gui/task_surface.py @@ -68,8 +68,8 @@ class InnerTaskPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) default_colour = self.GetBackgroundColour() - #self.SetBackgroundColour(wx.Colour(255,255,255)) - self.SetBackgroundColour(wx.Colour(0,0,255)) + backgroud_colour = wx.Colour(255,255,255) + self.SetBackgroundColour(backgroud_colour) self.SetAutoLayout(1) @@ -80,13 +80,16 @@ class InnerTaskPanel(wx.Panel): # Button for creating new surface button_new_surface = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\ pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT) + button_new_surface.SetBackgroundColour(self.GetBackgroundColour()) self.Bind(wx.EVT_BUTTON, self.OnButton) # Fixed hyperlink items tooltip = wx.ToolTip(_("Create 3D surface based on a mask")) link_new_surface = hl.HyperLinkCtrl(self, -1, _("Create new 3D surface")) link_new_surface.SetUnderlines(False, False, False) + link_new_surface.SetBold(True) link_new_surface.SetColours("BLACK", "BLACK", "BLACK") + link_new_surface.SetBackgroundColour(self.GetBackgroundColour()) link_new_surface.SetToolTip(tooltip) link_new_surface.AutoBrowse(False) link_new_surface.UpdateLink() @@ -177,7 +180,6 @@ class InnerTaskPanel(wx.Panel): class FoldPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, size=(50,700)) - self.SetBackgroundColour(wx.Colour(0,255,0)) inner_panel = InnerFoldPanel(self) @@ -262,8 +264,7 @@ class SurfaceTools(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) - #self.SetBackgroundColour(default_colour) - self.SetBackgroundColour((0, 255, 0)) + self.SetBackgroundColour(default_colour) #self.SetBackgroundColour(wx.Colour(255,255,255)) self.SetAutoLayout(1) @@ -397,8 +398,7 @@ class SurfaceProperties(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) - #self.SetBackgroundColour(default_colour) - self.SetBackgroundColour((255, 0, 0)) + self.SetBackgroundColour(default_colour) self.surface_dict = utl.TwoWaysDictionary() @@ -458,7 +458,7 @@ class SurfaceProperties(wx.Panel): #sizer.Add(cb, 0, wx.GROW|wx.EXPAND|wx.RIGHT|wx.LEFT|wx.TOP|wx.BOTTOM, 5) sizer.Fit(self) - self.SetSizer(sizer) + self.SetSizerAndFit(sizer) self.Update() #self.SetAutoLayout(1) -- libgit2 0.21.2