From b3bc26c6f49c546bfeec512f0ce55b0c296ea081 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sat, 30 May 2015 19:14:32 +0200 Subject: [PATCH] Configtool: adjust background color of controls, too. That is, buttons and choices. Coices apparently don't work. Tried a bit on the table heaters of the sensor and heater lists, but found nothing which would result in an effect. This control is not exactly well documented. --- configtool/heaterspage.py | 2 ++ configtool/mechanicalpage.py | 2 ++ configtool/page.py | 2 ++ configtool/sensorpage.py | 3 +++ 4 files changed, 9 insertions(+) diff --git a/configtool/heaterspage.py b/configtool/heaterspage.py index 30429a0..783472c 100644 --- a/configtool/heaterspage.py +++ b/configtool/heaterspage.py @@ -26,6 +26,7 @@ class HeatersPage(wx.Panel, Page): bsz = wx.BoxSizer(wx.VERTICAL) self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL) + self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour()) self.bAdd.SetFont(font) self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd) self.bAdd.SetToolTipString("Add a heater to the configuration.") @@ -34,6 +35,7 @@ class HeatersPage(wx.Panel, Page): bsz.AddSpacer((10, 10)) self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL) + self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour()) self.bDelete.SetFont(font) self.bDelete.Enable(False) self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete) diff --git a/configtool/mechanicalpage.py b/configtool/mechanicalpage.py index 3aa1942..6138f2d 100644 --- a/configtool/mechanicalpage.py +++ b/configtool/mechanicalpage.py @@ -129,6 +129,7 @@ class MechanicalPage(wx.Panel, Page): bsz = wx.BoxSizer(wx.VERTICAL) b = wx.Button(self, wx.ID_ANY, "Calculate\nBelt Driven", size = BSIZE) + b.SetBackgroundColour(self.deco.getBackgroundColour()) b.SetFont(font) b.SetToolTipString("Open the calculator for axes that are belt-driven.") self.Bind(wx.EVT_BUTTON, self.onCalcBelt, b) @@ -136,6 +137,7 @@ class MechanicalPage(wx.Panel, Page): bsz.Add(b, 1, wx.ALL, 5) b = wx.Button(self, wx.ID_ANY, "Calculate\nScrew Driven", size = BSIZE) + b.SetBackgroundColour(self.deco.getBackgroundColour()) b.SetFont(font) bsz.Add(b, 1, wx.ALL, 5) b.SetToolTipString("Open the calculator for axes that are screw-driven.") diff --git a/configtool/page.py b/configtool/page.py index 6b2069f..a3bf713 100644 --- a/configtool/page.py +++ b/configtool/page.py @@ -78,6 +78,7 @@ class Page: lsz.Add(st, 1, wx.TOP, offsetChLabel) ch = wx.Choice(self, wx.ID_ANY, choices = choices, size = size, name = name) + ch.SetBackgroundColour(self.deco.getBackgroundColour()) ch.SetFont(self.font) ch.Bind(wx.EVT_CHOICE, validator) ch.SetSelection(selection) @@ -100,6 +101,7 @@ class Page: ch = wx.Choice(self, wx.ID_ANY, choices = opts, name = name, style = wx.CB_SORT) + ch.SetBackgroundColour(self.deco.getBackgroundColour()) ch.SetFont(self.font) ch.Bind(wx.EVT_CHOICE, self.onChoice) self.choices[name] = ch diff --git a/configtool/sensorpage.py b/configtool/sensorpage.py index bb93649..270ebc1 100644 --- a/configtool/sensorpage.py +++ b/configtool/sensorpage.py @@ -36,6 +36,7 @@ class SensorsPage(wx.Panel, Page): bsz = wx.BoxSizer(wx.VERTICAL) self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL) + self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour()) self.bAdd.SetFont(font) self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd) self.bAdd.Enable(False) @@ -45,6 +46,7 @@ class SensorsPage(wx.Panel, Page): bsz.AddSpacer((10, 10)) self.bModify = wx.Button(self, wx.ID_ANY, "Modify", size = BSIZESMALL) + self.bModify.SetBackgroundColour(self.deco.getBackgroundColour()) self.bModify.SetFont(font) self.bModify.Enable(False) self.Bind(wx.EVT_BUTTON, self.doModify, self.bModify) @@ -53,6 +55,7 @@ class SensorsPage(wx.Panel, Page): bsz.AddSpacer((10, 10)) self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL) + self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour()) self.bDelete.SetFont(font) self.bDelete.Enable(False) self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete)