chiark / gitweb /
Changed the way the default background colour for controls is set after validation...
authordaid <daid303@gmail.com>
Mon, 12 Mar 2012 11:31:27 +0000 (12:31 +0100)
committerdaid <daid303@gmail.com>
Mon, 12 Mar 2012 11:31:27 +0000 (12:31 +0100)
SkeinPyPy_NewUI/newui/configBase.py
SkeinPyPy_NewUI/newui/mainWindow.py

index 0f939de34e44350d60c5192852d5499e2d5e7c24..7f55448cb3a5f11f4ee77e852baa7ac4588395f5 100644 (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)
index 0ea254f6c4a302abeb2ac54598c5633ab6c5b1cb..960a0ff65e920632b59d6c94813619acc7bd2f42 100644 (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)