Text align fix + removal of early polish applied to statspane gauges

This commit is contained in:
HomeWorld
2010-08-28 18:56:20 +03:00
committed by cncfanatics
parent 4e385f334e
commit 6ac2e677ae
2 changed files with 7 additions and 10 deletions

View File

@@ -264,14 +264,14 @@ class PyGauge(wx.PyWindow):
dc.DrawRectangleRect(r)
dc.SetTextForeground(wx.Colour(255,255,255))
font1 = wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL)
font1 = wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL)
dc.SetFont(font1)
if self._skipDigits == True:
textWidth=len(str(int(self._value[0]*100/self._range)) + "%") * 7
dc.DrawText(str(int(self._value[0]*100/self._range)) + "%",rect.width/2-textWidth/2,(rect.height-8)/2)
textWidth=len(str(int(self._value[0]*100/self._range)) + "%") * 9
dc.DrawText(str(int(self._value[0]*100/self._range)) + "%",(rect.width-2)/2 - textWidth/4,(rect.height-11)/2)
else:
textWidth=len(str(round(float(self._value[0]*100/self._range),1))+ "%") * 7
dc.DrawText(str(round(float(self._value[0]*100/self._range),1)) + "%",rect.width/2-textWidth/2,(rect.height-8)/2)
textWidth=len(str(round(float(self._value[0]*100/self._range),1))+ "%")*9
dc.DrawText(str(round(float(self._value[0]*100/self._range),1)) + "%",(rect.width-2)/2-textWidth/4,(rect.height-11)/2)
def OnTimer(self,event):
"""