- Added more colour states

This commit is contained in:
ccremers 2006-08-10 15:39:09 +00:00
parent e927056c06
commit 10840031ca
2 changed files with 24 additions and 18 deletions

View File

@ -395,16 +395,22 @@ class ResultWindow(wx.Frame):
grid.Add(bmpfield,(ypos,xpos),(1,1),wx.ALIGN_CENTER_VERTICAL|wx.ALL,10) grid.Add(bmpfield,(ypos,xpos),(1,1),wx.ALIGN_CENTER_VERTICAL|wx.ALL,10)
else: else:
# new style text control Ok/Fail # new style text control Ok/Fail
def makeTC(txt,colour): def makeTC(colour):
txt = wx.StaticText(self,-1,txt) txt = wx.StaticText(self,-1,cl.getOkay())
font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD) font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)
txt.SetFont(font) txt.SetFont(font)
txt.SetForegroundColour(colour) txt.SetForegroundColour(colour)
grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10) grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10)
if cl.okay: if cl.okay:
makeTC("Ok","forest green") if cl.getVerified():
makeTC("forest green")
else:
makeTC("dark green")
else: else:
makeTC("Fail","red") if cl.getVerified():
makeTC("red")
else:
makeTC("dark red")
xpos += 1 xpos += 1
# verified? # verified?

View File

@ -94,6 +94,15 @@ class Claim(object):
remark = "Exactly %i %s" % (n,atxt) remark = "Exactly %i %s" % (n,atxt)
return remark + "." return remark + "."
def getOkay(self):
"""
returns "Ok" or "Fail"
"""
if self.okay:
return "Ok"
else:
return "Fail"
def getVerified(self): def getVerified(self):
""" """
returns an element of [None,'Verified','Falsified'] returns an element of [None,'Verified','Falsified']
@ -119,25 +128,16 @@ class Claim(object):
""" """
Resulting string Resulting string
""" """
s = "claim id [%s]" % (self.id) s = "claim id [%s], %s" % (self.id,self.claimtype)
s+= " " + str(self.claimtype)
if self.parameter: if self.parameter:
s+= " " + str(self.parameter) s+= " %s" % self.parameter
# determine status # determine status
s+= " : " s+= " : %s status : %i %s" % (self.getOkay(),self.failed,self.stateName(self.failed))
if self.okay:
s+= "[Ok] "
else:
s+= "[Fail] "
s+= " %i " % (self.failed)
s+= self.stateName(self.failed)
vt = self.getVerified() vt = self.getVerified()
if vt: if vt:
s+= " (%s)" % vt s+= ", and thus the claim is %s" % vt
s+= " [%s]" % self.getComment() s+= ". %s" % self.getComment()
return s return s