def refresh_status(self, event=None): """Update the controls with current values""" red = (255, 0, 0) green = (0, 255, 0) gray = (180, 180, 180) label = checklist.test(self.n).label self.myEnabled.Label = "%s: %s" % (label, self.values["formatted_value"]) color = green if self.values["OK"] else red if not self.values["test_code_OK"]: color = gray self.State.BackgroundColour = color self.State.ForegroundColour = color self.State.Refresh() # work-around for a GenButton bug in Windows
def OnTest(self, event): checklist.test(self.n).test_code = self.Test.Value self.refresh()
def OnFormat(self, event): checklist.test(self.n).format = self.Format.Value self.refresh()
def OnValue(self, event): checklist.test(self.n).value_code = self.Value.Value self.refresh()
def OnLabel(self, event): checklist.test(self.n).label = self.myLabel.Value self.refresh()
def refresh(self, Event=0): self.myLabel.Value = checklist.test(self.n).label self.Value.Value = checklist.test(self.n).value_code self.Format.Value = checklist.test(self.n).format self.Test.Value = checklist.test(self.n).test_code
def OnEnable(self, event): checklist.test(self.n).enabled = event.Checked() self.refresh()
def refresh_label(self, event=None): """Update the controls with current values""" self.Title = checklist.test(self.n).label self.myEnabled.Value = checklist.test(self.n).enabled self.myEnabled.Label = checklist.test(self.n).label
def update_data(self): """Retreive status information""" self.old_values = dict(self.values) # make a copy for n in self.attributes: self.values[n] = getattr(checklist.test(self.n), n)