def __init__(self, parent, win_id=wx.ID_ANY, value=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=wx.DefaultValidator, name=wx.ComboBoxNameStr, monospace=False, defaultValue=wx.EmptyString, required=False, outLabel=None): OwnerDrawnComboBox.__init__(self, parent, win_id, value, pos, size, choices, style, validator, name) InputField.__init__(self, defaultValue, required, outLabel) if wx.MAJOR_VERSION < 3: self.clr_disabled = self.GetBackgroundColour() self.clr_enabled = self.GetTextCtrl().GetBackgroundColour() if monospace: self.TextCtrl.SetFont(MONOSPACED_MD) # FIXME: This doesn't work (use monospace in popup list) self.PopupControl.GetControl().SetFont(MONOSPACED_MD)
def __init__(self, parent, id=-1, **kwargs): if kwargs.get('choices', None) is None: choices = db.get_linkable_tables() choices += [TableComboBox.OTHER_TABLE] else: choices = kwargs['choices'] ComboBox.__init__(self, parent, id, choices=choices, **kwargs) if p.image_table: self.SetStringSelection(p.image_table) else: self.Select(0)
def __init__(self, parent, win_id=wx.ID_ANY, value=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=wx.DefaultValidator, name=wx.ComboBoxNameStr): OwnerDrawnComboBox.__init__(self, parent, win_id, value, pos, size, choices, style, validator, name) self.Default = self.GetLabel() self.Priority = [] if wx.MAJOR_VERSION <= 2: self.BGDefault = self.TextCtrl.GetBackgroundColour() self.BGDisabled = self.TextCtrl.GetForegroundColour()