def Draw(self, dc):
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
x, y = self.Parent.CalcUnscrolledPosition(self.x_offset, self.y_offset)
text = self.GetInstanceName()
if self.ActionState is not None:
text += " ("
dc.DrawText(text, x, y)
tw, th = dc.GetTextExtent(text)
if self.ActionState is not None:
text = self.VALUE_TRANSLATION[self.ActionState]
if self.ActionState:
dc.SetTextForeground(wx.GREEN)
dc.DrawText(text, x + tw, y)
if self.ActionState:
dc.SetTextForeground(wx.BLACK)
tw = tw + dc.GetTextExtent(text)[0]
text = ")"
dc.DrawText(text, x + tw, y)
dc.SetUserScale(scalex, scaley)
评论列表
文章目录