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.
This commit is contained in:
Markus Hitter 2015-05-30 19:14:32 +02:00
parent 9976640d92
commit b3bc26c6f4
4 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class HeatersPage(wx.Panel, Page):
bsz = wx.BoxSizer(wx.VERTICAL) bsz = wx.BoxSizer(wx.VERTICAL)
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL) self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour())
self.bAdd.SetFont(font) self.bAdd.SetFont(font)
self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd) self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd)
self.bAdd.SetToolTipString("Add a heater to the configuration.") self.bAdd.SetToolTipString("Add a heater to the configuration.")
@ -34,6 +35,7 @@ class HeatersPage(wx.Panel, Page):
bsz.AddSpacer((10, 10)) bsz.AddSpacer((10, 10))
self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL) self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL)
self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour())
self.bDelete.SetFont(font) self.bDelete.SetFont(font)
self.bDelete.Enable(False) self.bDelete.Enable(False)
self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete) self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete)

View File

@ -129,6 +129,7 @@ class MechanicalPage(wx.Panel, Page):
bsz = wx.BoxSizer(wx.VERTICAL) bsz = wx.BoxSizer(wx.VERTICAL)
b = wx.Button(self, wx.ID_ANY, "Calculate\nBelt Driven", size = BSIZE) b = wx.Button(self, wx.ID_ANY, "Calculate\nBelt Driven", size = BSIZE)
b.SetBackgroundColour(self.deco.getBackgroundColour())
b.SetFont(font) b.SetFont(font)
b.SetToolTipString("Open the calculator for axes that are belt-driven.") b.SetToolTipString("Open the calculator for axes that are belt-driven.")
self.Bind(wx.EVT_BUTTON, self.onCalcBelt, b) self.Bind(wx.EVT_BUTTON, self.onCalcBelt, b)
@ -136,6 +137,7 @@ class MechanicalPage(wx.Panel, Page):
bsz.Add(b, 1, wx.ALL, 5) bsz.Add(b, 1, wx.ALL, 5)
b = wx.Button(self, wx.ID_ANY, "Calculate\nScrew Driven", size = BSIZE) b = wx.Button(self, wx.ID_ANY, "Calculate\nScrew Driven", size = BSIZE)
b.SetBackgroundColour(self.deco.getBackgroundColour())
b.SetFont(font) b.SetFont(font)
bsz.Add(b, 1, wx.ALL, 5) bsz.Add(b, 1, wx.ALL, 5)
b.SetToolTipString("Open the calculator for axes that are screw-driven.") b.SetToolTipString("Open the calculator for axes that are screw-driven.")

View File

@ -78,6 +78,7 @@ class Page:
lsz.Add(st, 1, wx.TOP, offsetChLabel) lsz.Add(st, 1, wx.TOP, offsetChLabel)
ch = wx.Choice(self, wx.ID_ANY, choices = choices, size = size, name = name) ch = wx.Choice(self, wx.ID_ANY, choices = choices, size = size, name = name)
ch.SetBackgroundColour(self.deco.getBackgroundColour())
ch.SetFont(self.font) ch.SetFont(self.font)
ch.Bind(wx.EVT_CHOICE, validator) ch.Bind(wx.EVT_CHOICE, validator)
ch.SetSelection(selection) ch.SetSelection(selection)
@ -100,6 +101,7 @@ class Page:
ch = wx.Choice(self, wx.ID_ANY, choices = opts, name = name, ch = wx.Choice(self, wx.ID_ANY, choices = opts, name = name,
style = wx.CB_SORT) style = wx.CB_SORT)
ch.SetBackgroundColour(self.deco.getBackgroundColour())
ch.SetFont(self.font) ch.SetFont(self.font)
ch.Bind(wx.EVT_CHOICE, self.onChoice) ch.Bind(wx.EVT_CHOICE, self.onChoice)
self.choices[name] = ch self.choices[name] = ch

View File

@ -36,6 +36,7 @@ class SensorsPage(wx.Panel, Page):
bsz = wx.BoxSizer(wx.VERTICAL) bsz = wx.BoxSizer(wx.VERTICAL)
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL) self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour())
self.bAdd.SetFont(font) self.bAdd.SetFont(font)
self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd) self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd)
self.bAdd.Enable(False) self.bAdd.Enable(False)
@ -45,6 +46,7 @@ class SensorsPage(wx.Panel, Page):
bsz.AddSpacer((10, 10)) bsz.AddSpacer((10, 10))
self.bModify = wx.Button(self, wx.ID_ANY, "Modify", size = BSIZESMALL) self.bModify = wx.Button(self, wx.ID_ANY, "Modify", size = BSIZESMALL)
self.bModify.SetBackgroundColour(self.deco.getBackgroundColour())
self.bModify.SetFont(font) self.bModify.SetFont(font)
self.bModify.Enable(False) self.bModify.Enable(False)
self.Bind(wx.EVT_BUTTON, self.doModify, self.bModify) self.Bind(wx.EVT_BUTTON, self.doModify, self.bModify)
@ -53,6 +55,7 @@ class SensorsPage(wx.Panel, Page):
bsz.AddSpacer((10, 10)) bsz.AddSpacer((10, 10))
self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL) self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL)
self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour())
self.bDelete.SetFont(font) self.bDelete.SetFont(font)
self.bDelete.Enable(False) self.bDelete.Enable(False)
self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete) self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete)