def __init__(self, argument_control, label): self.argument_control = argument_control wx.StaticText.__init__(self, argument_control, label=label, size=argument_control.box_size, style=wx.ALIGN_CENTER_HORIZONTAL) old_foreground_color = self.GetForegroundColour() faint_color = wx_tools.mix_wx_color(0.5, old_foreground_color, wx_tools.get_background_color()) self.SetForegroundColour(faint_color) self.SetMinSize(argument_control.box_size) self.SetMaxSize(argument_control.box_size)
def get_error_background_color(): '''Get the background color of a text control which has invalid input.''' red = wx.Colour(255, 0, 0) return wx_tools.mix_wx_color(0.2, red, wx.Colour(255, 255, 255))