Exemple #1
0
    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
Exemple #2
0
 def OnTest(self, event):
     checklist.test(self.n).test_code = self.Test.Value
     self.refresh()
Exemple #3
0
 def OnFormat(self, event):
     checklist.test(self.n).format = self.Format.Value
     self.refresh()
Exemple #4
0
 def OnValue(self, event):
     checklist.test(self.n).value_code = self.Value.Value
     self.refresh()
Exemple #5
0
 def OnLabel(self, event):
     checklist.test(self.n).label = self.myLabel.Value
     self.refresh()
Exemple #6
0
 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
Exemple #7
0
 def OnEnable(self, event):
     checklist.test(self.n).enabled = event.Checked()
     self.refresh()
Exemple #8
0
 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
Exemple #9
0
 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)