Changed the way the default background colour for controls is set after validation. The documented way of setting wx.NullColour does not work correctly on windows XP style and MacOS

master
daid 2012-03-12 12:31:27 +01:00
parent dc339de638
commit a8ec211df9
2 changed files with 4 additions and 1 deletions

View File

@ -125,6 +125,8 @@ class SettingRow():
self.ctrl.Bind(wx.EVT_ENTER_WINDOW, lambda e: panel.main.OnPopupDisplay(self))
self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, panel.main.OnPopupHide)
self.defaultBGColour = self.ctrl.GetBackgroundColour()
panel.main.settingControlList.append(self)
sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL)
@ -151,7 +153,7 @@ class SettingRow():
elif result == validators.WARNING:
self.ctrl.SetBackgroundColour('Yellow')
else:
self.ctrl.SetBackgroundColour(wx.NullColour)
self.ctrl.SetBackgroundColour(self.defaultBGColour)
self.ctrl.Refresh()
self.validationMsg = '\n'.join(msgs)

View File

@ -110,6 +110,7 @@ class mainWindow(configBase.configWindowBase):
configBase.TitleRow(right, "Filament")
c = configBase.SettingRow(right, "Diameter (mm)", 'filament_diameter', '2.89', 'Diameter of your filament, as accurately as possible.\nIf you cannot measure this value you will have to callibrate it, a higher number means less extrusion, a smaller number generates more extrusion.')
validators.validFloat(c, 1.0)
validators.warningAbove(c, 3.5, "Are you sure your filament is that thick? Normal filament is around 3mm or 1.75mm.")
c = configBase.SettingRow(right, "Packing Density", 'filament_density', '1.00', 'Packing density of your filament. This should be 1.00 for PLA and 0.85 for ABS')
validators.validFloat(c, 0.5, 1.5)