+import random
+
+#----------------------------------------------------------------------
+
+ID_BackgroundColour = wx.NewId()
+ID_GradientFrom = wx.NewId()
+ID_GradientTo = wx.NewId()
+ID_BorderColour = wx.NewId()
+ID_CaptionColour = wx.NewId()
+ID_ButtonTextColour = wx.NewId()
+ID_SelectionBrush = wx.NewId()
+ID_SelectionPen = wx.NewId()
+ID_SeparatorColour = wx.NewId()
+
+
+#----------------------------------------------------------------------
+# Some icons for the demo
+#----------------------------------------------------------------------
+def GetMondrianData():
+ return \
+'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00 \x08\x06\x00\
+\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\x00qID\
+ATX\x85\xed\xd6;\n\x800\x10E\xd1{\xc5\x8d\xb9r\x97\x16\x0b\xad$\x8a\x82:\x16\
+o\xda\x84pB2\x1f\x81Fa\x8c\x9c\x08\x04Z{\xcf\xa72\xbcv\xfa\xc5\x08 \x80r\x80\
+\xfc\xa2\x0e\x1c\xe4\xba\xfaX\x1d\xd0\xde]S\x07\x02\xd8>\xe1wa-`\x9fQ\xe9\
+\x86\x01\x04\x10\x00\\(Dk\x1b-\x04\xdc\x1d\x07\x14\x98;\x0bS\x7f\x7f\xf9\x13\
+\x04\x10@\xf9X\xbe\x00\xc9 \x14K\xc1<={\x00\x00\x00\x00IEND\xaeB`\x82'
+
+
+def GetMondrianBitmap():
+ return wx.BitmapFromImage(GetMondrianImage())
+
+
+def GetMondrianImage():
+ import cStringIO
+ stream = cStringIO.StringIO(GetMondrianData())
+ return wx.ImageFromStream(stream)
+
+
+def GetMondrianIcon():
+ icon = wx.EmptyIcon()
+ icon.CopyFromBitmap(GetMondrianBitmap())
+ return icon
+
+
+#----------------------------------------------------------------------
+
+class SettingsPanel(wx.MiniFrame):
+
+ def __init__(self, parent, id=wx.ID_ANY, title="Settings Panel", pos=wx.DefaultPosition,
+ size=wx.DefaultSize,
+ style=wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.FRAME_NO_TASKBAR
+ | wx.FRAME_FLOAT_ON_PARENT | wx.CLIP_CHILDREN):
+
+ wx.MiniFrame.__init__(self, parent, id, title, pos, size, style)
+
+ self.targetTitleBar = parent.titleBar
+ self.parent = parent
+ self.panel = wx.Panel(self, -1)
+
+ self.coloursizer_staticbox = wx.StaticBox(self.panel, -1, "Colour Options")
+ self.bottomsizer_staticbox = wx.StaticBox(self.panel, -1, "Size Options")
+ self.stylesizer_staticbox = wx.StaticBox(self.panel, -1, "ButtonPanel Styles")
+ self.defaultstyle = wx.RadioButton(self.panel, -1, "Default Style", style=wx.RB_GROUP)
+ self.gradientstyle = wx.RadioButton(self.panel, -1, "Gradient Style")
+ self.verticalgradient = wx.RadioButton(self.panel, -1, "Vertical Gradient", style=wx.RB_GROUP)
+ self.horizontalgradient = wx.RadioButton(self.panel, -1, "Horizontal Gradient")
+
+ b = self.CreateColorBitmap(wx.BLACK)
+
+ self.bakbrush = wx.BitmapButton(self.panel, ID_BackgroundColour, b, size=wx.Size(50,25))
+ self.gradientfrom = wx.BitmapButton(self.panel, ID_GradientFrom, b, size=wx.Size(50,25))
+ self.gradientto = wx.BitmapButton(self.panel, ID_GradientTo, b, size=wx.Size(50,25))
+ self.bordercolour = wx.BitmapButton(self.panel, ID_BorderColour, b, size=wx.Size(50,25))
+ self.captioncolour = wx.BitmapButton(self.panel, ID_CaptionColour, b, size=wx.Size(50,25))
+ self.textbuttoncolour = wx.BitmapButton(self.panel, ID_ButtonTextColour, b, size=wx.Size(50,25))
+ self.selectionbrush = wx.BitmapButton(self.panel, ID_SelectionBrush, b, size=wx.Size(50,25))
+ self.selectionpen = wx.BitmapButton(self.panel, ID_SelectionPen, b, size=wx.Size(50,25))
+ self.separatorcolour = wx.BitmapButton(self.panel, ID_SeparatorColour, b, size=wx.Size(50,25))
+
+ self.separatorspin = wx.SpinCtrl(self.panel, -1, "7", min=3, max=20,
+ style=wx.SP_ARROW_KEYS)
+ self.marginspin = wx.SpinCtrl(self.panel, -1, "6", min=3, max=20,
+ style=wx.SP_ARROW_KEYS)
+ self.paddingspin = wx.SpinCtrl(self.panel, -1, "6", min=3, max=20,
+ style=wx.SP_ARROW_KEYS)
+ self.borderspin = wx.SpinCtrl(self.panel, -1, "3", min=3, max=7,
+ style=wx.SP_ARROW_KEYS)
+
+ self.__set_properties()
+ self.__do_layout()
+
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnDefaultStyle, self.defaultstyle)
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnGradientStyle, self.gradientstyle)
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnVerticalGradient, self.verticalgradient)
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnHorizontalGradient, self.horizontalgradient)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_BackgroundColour)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_GradientFrom)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_GradientTo)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_BorderColour)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_CaptionColour)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_ButtonTextColour)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_SelectionBrush)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_SelectionPen)
+ self.Bind(wx.EVT_BUTTON, self.OnSetColour, id=ID_SeparatorColour)
+
+ self.Bind(wx.EVT_SPINCTRL, self.OnSeparator, self.separatorspin)
+ self.Bind(wx.EVT_SPINCTRL, self.OnMargins, self.marginspin)
+ self.Bind(wx.EVT_SPINCTRL, self.OnPadding, self.paddingspin)
+ self.Bind(wx.EVT_SPINCTRL, self.OnBorder, self.borderspin)
+
+ self.Bind(wx.EVT_CLOSE, self.OnClose)
+
+
+ def __set_properties(self):
+
+ self.defaultstyle.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
+ self.defaultstyle.SetValue(1)
+ self.gradientstyle.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
+ self.verticalgradient.SetValue(1)
+
+ if self.targetTitleBar.GetStyle() & bp.BP_DEFAULT_STYLE:
+ self.verticalgradient.Enable(False)
+ self.horizontalgradient.Enable(False)
+ self.defaultstyle.SetValue(1)
+ else:
+ self.gradientstyle.SetValue(1)
+
+ self.borderspin.SetValue(self.targetTitleBar.GetBPArt().GetMetric(bp.BP_BORDER_SIZE))
+ self.separatorspin.SetValue(self.targetTitleBar.GetBPArt().GetMetric(bp.BP_SEPARATOR_SIZE))
+ self.marginspin.SetValue(self.targetTitleBar.GetBPArt().GetMetric(bp.BP_MARGINS_SIZE).x)
+ self.paddingspin.SetValue(self.targetTitleBar.GetBPArt().GetMetric(bp.BP_PADDING_SIZE).x)
+
+ self.UpdateColors()
+
+
+ def __do_layout(self):
+
+ mainsizer = wx.BoxSizer(wx.VERTICAL)
+ buttonsizer = wx.BoxSizer(wx.HORIZONTAL)
+ bottomsizer = wx.StaticBoxSizer(self.bottomsizer_staticbox, wx.VERTICAL)
+ sizer_13 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_12 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_11 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_10 = wx.BoxSizer(wx.HORIZONTAL)
+ coloursizer = wx.StaticBoxSizer(self.coloursizer_staticbox, wx.HORIZONTAL)
+ rightsizer = wx.BoxSizer(wx.VERTICAL)
+ sizer_9 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
+ leftsizer = wx.BoxSizer(wx.VERTICAL)
+ sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
+ sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
+ stylesizer = wx.StaticBoxSizer(self.stylesizer_staticbox, wx.VERTICAL)
+ tophsizer = wx.BoxSizer(wx.HORIZONTAL)
+ tophsizer2 = wx.BoxSizer(wx.VERTICAL)
+
+ stylesizer.Add(self.defaultstyle, 0, wx.ALL|wx.EXPAND|wx.ADJUST_MINSIZE, 5)
+
+ tophsizer.Add(self.gradientstyle, 0, wx.LEFT|wx.RIGHT|wx.EXPAND|
+ wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+
+ tophsizer2.Add(self.verticalgradient, 0, wx.BOTTOM|wx.ADJUST_MINSIZE, 3)
+ tophsizer2.Add(self.horizontalgradient, 0, wx.ADJUST_MINSIZE, 0)
+
+ tophsizer.Add(tophsizer2, 1, wx.LEFT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
+
+ stylesizer.Add(tophsizer, 1, wx.EXPAND, 0)
+
+ mainsizer.Add(stylesizer, 0, wx.ALL|wx.EXPAND, 5)
+
+ label_1 = wx.StaticText(self.panel, -1, "Background Brush Colour:")
+ sizer_1.Add(label_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_1.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_1.Add(self.bakbrush, 0, wx.ADJUST_MINSIZE, 0)
+
+ leftsizer.Add(sizer_1, 1, wx.EXPAND, 0)
+
+ label_2 = wx.StaticText(self.panel, -1, "Gradient Colour From:")
+ sizer_2.Add(label_2, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_2.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_2.Add(self.gradientfrom, 0, wx.ADJUST_MINSIZE, 0)
+
+ leftsizer.Add(sizer_2, 1, wx.EXPAND, 0)
+
+ label_3 = wx.StaticText(self.panel, -1, "Gradient Colour To:")
+ sizer_3.Add(label_3, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_3.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_3.Add(self.gradientto, 0, wx.ADJUST_MINSIZE, 0)
+
+ leftsizer.Add(sizer_3, 1, wx.EXPAND, 0)
+
+ label_4 = wx.StaticText(self.panel, -1, "Border Colour:")
+ sizer_4.Add(label_4, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_4.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_4.Add(self.bordercolour, 0, wx.ADJUST_MINSIZE, 0)
+
+ leftsizer.Add(sizer_4, 1, wx.EXPAND, 0)
+
+ label_5 = wx.StaticText(self.panel, -1, "Main Caption Colour:")
+ sizer_5.Add(label_5, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_5.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_5.Add(self.captioncolour, 0, wx.ADJUST_MINSIZE, 0)
+
+ leftsizer.Add(sizer_5, 1, wx.EXPAND, 0)
+
+ coloursizer.Add(leftsizer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
+ coloursizer.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+
+ label_6 = wx.StaticText(self.panel, -1, "Text Button Colour:")
+ sizer_6.Add(label_6, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_6.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_6.Add(self.textbuttoncolour, 0, wx.ADJUST_MINSIZE, 0)
+
+ rightsizer.Add(sizer_6, 1, wx.EXPAND, 0)
+
+ label_7 = wx.StaticText(self.panel, -1, "Selection Brush Colour:")
+ sizer_7.Add(label_7, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_7.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_7.Add(self.selectionbrush, 0, wx.ADJUST_MINSIZE, 0)
+
+ rightsizer.Add(sizer_7, 1, wx.EXPAND, 0)
+
+ label_8 = wx.StaticText(self.panel, -1, "Selection Pen Colour:")
+ sizer_8.Add(label_8, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_8.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_8.Add(self.selectionpen, 0, wx.ADJUST_MINSIZE, 0)
+
+ rightsizer.Add(sizer_8, 1, wx.EXPAND, 0)
+
+ label_9 = wx.StaticText(self.panel, -1, "Separator Colour:")
+ sizer_9.Add(label_9, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_9.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_9.Add(self.separatorcolour, 0, wx.ADJUST_MINSIZE, 0)
+
+ rightsizer.Add(sizer_9, 1, wx.EXPAND, 0)
+
+ coloursizer.Add(rightsizer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
+
+ mainsizer.Add(coloursizer, 0, wx.ALL|wx.EXPAND, 5)
+
+ label_10 = wx.StaticText(self.panel, -1, "Separator Size:")
+ sizer_10.Add(label_10, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_10.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_10.Add(self.separatorspin, 0, wx.ALL|wx.ADJUST_MINSIZE, 5)
+
+ bottomsizer.Add(sizer_10, 1, wx.EXPAND, 0)
+
+ label_11 = wx.StaticText(self.panel, -1, "Margins Size:")
+ sizer_11.Add(label_11, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_11.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_11.Add(self.marginspin, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ADJUST_MINSIZE, 5)
+
+ bottomsizer.Add(sizer_11, 1, wx.EXPAND, 0)
+
+ label_12 = wx.StaticText(self.panel, -1, "Padding Size:")
+ sizer_12.Add(label_12, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_12.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_12.Add(self.paddingspin, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ADJUST_MINSIZE, 5)
+
+ bottomsizer.Add(sizer_12, 1, wx.EXPAND, 0)
+
+ label_13 = wx.StaticText(self.panel, -1, "Border Size:")
+ sizer_13.Add(label_13, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
+ sizer_13.Add((0, 0), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+ sizer_13.Add(self.borderspin, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ADJUST_MINSIZE, 5)
+
+ bottomsizer.Add(sizer_13, 1, wx.EXPAND, 0)
+
+ mainsizer.Add(bottomsizer, 0, wx.ALL|wx.EXPAND, 5)
+
+ self.panel.SetSizer(mainsizer)
+ sizer = wx.BoxSizer()
+ sizer.Add(self.panel, 1, wx.EXPAND)
+ self.SetSizer(sizer)
+ self.Fit()
+
+
+ def CreateColorBitmap(self, c):
+
+ image = wx.EmptyImage(25, 14)
+
+ for x in xrange(25):
+ for y in xrange(14):
+ pixcol = c
+ if x == 0 or x == 24 or y == 0 or y == 13:
+ pixcol = wx.BLACK
+
+ image.SetRGB(x, y, pixcol.Red(), pixcol.Green(), pixcol.Blue())
+
+ return image.ConvertToBitmap()
+
+
+ def UpdateColors(self):
+
+ bk = self.targetTitleBar.GetBPArt().GetColor(bp.BP_BACKGROUND_COLOR)
+ self.bakbrush.SetBitmapLabel(self.CreateColorBitmap(bk))
+
+ capfrom = self.targetTitleBar.GetBPArt().GetColor(bp.BP_GRADIENT_COLOR_FROM)
+ self.gradientfrom.SetBitmapLabel(self.CreateColorBitmap(capfrom))
+
+ capto = self.targetTitleBar.GetBPArt().GetColor(bp.BP_GRADIENT_COLOR_TO)
+ self.gradientto.SetBitmapLabel(self.CreateColorBitmap(capto))
+
+ captxt = self.targetTitleBar.GetBPArt().GetColor(bp.BP_TEXT_COLOR)
+ self.captioncolour.SetBitmapLabel(self.CreateColorBitmap(captxt))
+
+ bor = self.targetTitleBar.GetBPArt().GetColor(bp.BP_BORDER_COLOR)
+ self.bordercolour.SetBitmapLabel(self.CreateColorBitmap(bor))
+
+ btntext = self.targetTitleBar.GetBPArt().GetColor(bp.BP_BUTTONTEXT_COLOR)
+ self.textbuttoncolour.SetBitmapLabel(self.CreateColorBitmap(btntext))
+
+ selb = self.targetTitleBar.GetBPArt().GetColor(bp.BP_SELECTION_BRUSH_COLOR)
+ self.selectionbrush.SetBitmapLabel(self.CreateColorBitmap(selb))
+
+ selp = self.targetTitleBar.GetBPArt().GetColor(bp.BP_SELECTION_PEN_COLOR)
+ self.selectionpen.SetBitmapLabel(self.CreateColorBitmap(selp))
+
+ sepc = self.targetTitleBar.GetBPArt().GetColor(bp.BP_SEPARATOR_COLOR)
+ self.separatorcolour.SetBitmapLabel(self.CreateColorBitmap(sepc))
+
+
+ def OnDefaultStyle(self, event):
+
+ self.verticalgradient.Enable(False)
+ self.horizontalgradient.Enable(False)
+ self.targetTitleBar.SetStyle(bp.BP_DEFAULT_STYLE)
+
+ self.targetTitleBar.Refresh()
+
+ event.Skip()
+
+
+ def OnGradientStyle(self, event):
+
+ self.verticalgradient.Enable(True)
+ self.horizontalgradient.Enable(True)
+ self.targetTitleBar.SetStyle(bp.BP_USE_GRADIENT)
+ self.targetTitleBar.Refresh()
+
+ event.Skip()
+
+
+ def OnVerticalGradient(self, event):
+
+ self.targetTitleBar.GetBPArt().SetGradientType(bp.BP_GRADIENT_VERTICAL)
+ self.targetTitleBar.SetStyle(bp.BP_USE_GRADIENT)
+ self.targetTitleBar.Refresh()
+
+ event.Skip()
+
+
+ def OnHorizontalGradient(self, event):
+
+ self.targetTitleBar.GetBPArt().SetGradientType(bp.BP_GRADIENT_HORIZONTAL)
+ self.targetTitleBar.SetStyle(bp.BP_USE_GRADIENT)
+ self.targetTitleBar.Refresh()
+
+ event.Skip()
+
+
+ def OnSetColour(self, event):
+
+ dlg = wx.ColourDialog(self.parent)
+
+ dlg.SetTitle("Color Picker")
+
+ if dlg.ShowModal() != wx.ID_OK:
+ return
+
+ var = 0
+ if event.GetId() == ID_BackgroundColour:
+ var = bp.BP_BACKGROUND_COLOR
+ elif event.GetId() == ID_GradientFrom:
+ var = bp.BP_GRADIENT_COLOR_FROM
+ elif event.GetId() == ID_GradientTo:
+ var = bp.BP_GRADIENT_COLOR_TO
+ elif event.GetId() == ID_BorderColour:
+ var = bp.BP_BORDER_COLOR
+ elif event.GetId() == ID_CaptionColour:
+ var = bp.BP_TEXT_COLOR
+ elif event.GetId() == ID_ButtonTextColour:
+ var = bp.BP_BUTTONTEXT_COLOR
+ elif event.GetId() == ID_SelectionBrush:
+ var = bp.BP_SELECTION_BRUSH_COLOR
+ elif event.GetId() == ID_SelectionPen:
+ var = bp.BP_SELECTION_PEN_COLOR
+ elif event.GetId() == ID_SeparatorColour:
+ var = bp.BP_SEPARATOR_COLOR
+ else:
+ return
+
+ self.targetTitleBar.GetBPArt().SetColor(var, dlg.GetColourData().GetColour())
+ self.targetTitleBar.Refresh()
+ self.UpdateColors()
+
+ self.parent.useredited = True
+
+
+ def OnSeparator(self, event):
+
+ self.targetTitleBar.GetBPArt().SetMetric(bp.BP_SEPARATOR_SIZE,
+ event.GetInt())
+
+ self.targetTitleBar.DoLayout()
+ self.parent.mainPanel.Layout()
+ self.parent.useredited = True
+
+ event.Skip()
+
+
+ def OnMargins(self, event):
+
+ self.targetTitleBar.GetBPArt().SetMetric(bp.BP_MARGINS_SIZE,
+ wx.Size(event.GetInt(), event.GetInt()))
+
+ self.targetTitleBar.DoLayout()
+ self.parent.mainPanel.Layout()
+
+ self.parent.useredited = True
+
+ event.Skip()
+
+
+ def OnPadding(self, event):
+
+ self.targetTitleBar.GetBPArt().SetMetric(bp.BP_PADDING_SIZE,
+ wx.Size(event.GetInt(), event.GetInt()))
+
+ self.targetTitleBar.DoLayout()
+ self.parent.mainPanel.Layout()
+ self.parent.useredited = True
+
+ event.Skip()
+
+
+ def OnBorder(self, event):
+
+ self.targetTitleBar.GetBPArt().SetMetric(bp.BP_BORDER_SIZE,
+ event.GetInt())
+
+ self.targetTitleBar.DoLayout()
+ self.parent.mainPanel.Layout()
+
+ self.parent.useredited = True
+
+ event.Skip()
+
+
+ def OnClose(self, event):
+
+ self.parent.hassettingpanel = False
+ self.Destroy()
+
+