Configtool: color background matching the background picture.

Actual color is easily changeable in Decoration, as this is a
Singleton.
This commit is contained in:
Markus Hitter 2015-05-24 16:43:53 +02:00
parent 95d7f0fa1e
commit 9976640d92
5 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,7 @@ class ConfigFrame(wx.Frame):
self.deco = Decoration()
panel = wx.Panel(self, -1)
panel.SetBackgroundColour(self.deco.getBackgroundColour())
panel.Bind(wx.EVT_PAINT, self.deco.onPaintBackground)
self.settings = Settings(self, cmd_folder)
@ -67,6 +68,7 @@ class ConfigFrame(wx.Frame):
self.nb = wx.Notebook(panel, wx.ID_ANY, size = (880, 550),
style = wx.BK_DEFAULT)
self.nb.SetBackgroundColour(self.deco.getBackgroundColour())
self.nb.SetFont(self.settings.font)
self.printerFileName = None

View File

@ -41,11 +41,13 @@ class BoardPanel(wx.Panel):
self.candThermPins = []
self.dir = os.path.join(self.settings.folder, "config")
self.SetBackgroundColour(self.deco.getBackgroundColour())
self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground)
sz = wx.BoxSizer(wx.HORIZONTAL)
self.nb = wx.Notebook(self, wx.ID_ANY, size = (21, 21),
style = wx.BK_DEFAULT)
self.nb.SetBackgroundColour(self.deco.getBackgroundColour())
self.nb.SetFont(self.settings.font)
self.pages = []

View File

@ -29,6 +29,9 @@ class Decoration(object):
else:
print "Background picture %s doesn't exist." % backPicPath
def getBackgroundColour(self):
return wx.Colour(237, 237, 237)
# On wxFrames, bind this to wx.EVT_ERASE_BACKGROUND
# On wxPanels, bind this to wx.EVT_PAINT
def onPaintBackground(self, evt):

View File

@ -18,6 +18,7 @@ class Page:
self.deco = Decoration()
self.font = font
self.SetBackgroundColour(self.deco.getBackgroundColour())
self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground)
def enableAll(self, flag = True):

View File

@ -30,11 +30,13 @@ class PrinterPanel(wx.Panel):
self.heaters = []
self.dir = os.path.join(self.settings.folder, "config")
self.SetBackgroundColour(self.deco.getBackgroundColour())
self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground)
sz = wx.BoxSizer(wx.HORIZONTAL)
self.nb = wx.Notebook(self, wx.ID_ANY, size = (21, 21),
style = wx.BK_DEFAULT)
self.nb.SetBackgroundColour(self.deco.getBackgroundColour())
self.nb.SetFont(self.settings.font)
self.pages = []