def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_REPORT|wx.LC_NO_HEADER|wx.LC_SINGLE_SEL|wx.LC_VIRTUAL): wx.ListCtrl.__init__(self, parent, ID, style=style) listmix.ListCtrlAutoWidthMixin.__init__(self) font = self.GetFont() font.SetPointSize(API.config.fontsize) self.SetFont(font) self.InsertColumn(0, "First") self.attr1 = wx.ListItemAttr() self.attr1.SetBackgroundColour("black") font.SetPointSize(API.config.fontsize) self.attr1.SetFont(font) self.attr2 = wx.ListItemAttr() self.attr2.SetBackgroundColour("black") font.SetPointSize(API.config.fontsize - 10) self.attr2.SetFont(font) # set up image list and default icon_size = [API.config.fontsize]*2 self.lst = wx.ImageList(*icon_size) self.default_idx = self.lst.Add(wx.EmptyImage(*icon_size).ConvertToBitmap()) # index our covers self.artcache = covers.cache_covers(API.config.mp3path, icon_size) self.idx_cache = {} for key, bmp in self.artcache.items(): self.idx_cache[key] = self.lst.Add(bmp) self.SetImageList(self.lst, wx.IMAGE_LIST_SMALL) utils.setColours(self, foreground="white")
def __init__(self, parent): BasePlugin.__init__(self, parent) gradient_percent = 0.35 # one main area called content self.content = utils.GradientPanel(self, percent=gradient_percent) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(self.content, 100, flag=wx.EXPAND) self.SetSizer(hsizer) utils.setColours(self)