- 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)
else:
# new style text control Ok/Fail
def makeTC(txt,colour):
txt = wx.StaticText(self,-1,txt)
def makeTC(colour):
txt = wx.StaticText(self,-1,cl.getOkay())
font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)
txt.SetFont(font)
txt.SetForegroundColour(colour)
grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10)
if cl.okay:
makeTC("Ok","forest green")
if cl.getVerified():
makeTC("forest green")
else:
makeTC("Fail","red")
makeTC("dark green")
else:
if cl.getVerified():
makeTC("red")
else:
makeTC("dark red")
xpos += 1
# verified?

View File

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