1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
class myVirtualTree (VirtualTree):
def __init__ (self, *args, **kwargs):
self.source = kwargs.pop('source')
VirtualTree.__init__(self, *args, **kwargs)
size = (16, 16)
self.imageList = wx.ImageList(*size)
for art in wx.ART_FOLDER, wx.ART_FILE_OPEN, wx.ART_NORMAL_FILE:
self.imageList.Add(wx.ArtProvider.GetBitmap(art, wx.ART_OTHER, size))
self.AssignImageList(self.imageList)
class VirtualTreeListCtrl(myVirtualTree, TreeListCtrl):
def __init__ (self, *args, **kwargs):
kwargs['style'] = wx.TR_DEFAULT_STYLE|wx.TR_FULL_ROW_HIGHLIGHT
super(VirtualTreeListCtrl, self).__init__(*args, **kwargs)
self.AddColumn("Lemmes", 140) # 0
self.AddColumn("Drapeaux", 65) # 1
self.AddColumn("Morph.", 55) # 2
self.AddColumn("A", 20) # 3
self.AddColumn("Dictionnaires", 80) # 4
self.AddColumn("Décision", 50) # 5
#self.SetMainColumn(0)
for art in wx.ART_TIP, wx.ART_WARNING:
self.imageList.Add(wx.ArtProvider.GetBitmap(art, wx.ART_OTHER, (16, 16)))
def OnGetItemText (self, indices, column=0):
[...]
def OnGetChildrenCount (self, indices):
[...]
def OnGetItemChildren (self, index, False):
[...]
def OnGetItemImage (self, indices, which, column=0):
[...]
def OnGetItemFont(self, indices):
[...]
def OnGetItemTextColour(self, indices):
[...]
def OnGetItemBackgroundColour(self, indices):
[...] |