Add a V in front of the active damage pattern and allow different

bitmaps per menu item when multiple are passed
This commit is contained in:
cncfanatics
2010-10-11 21:54:53 +02:00
parent 51813be6d1
commit 37c34a32f3
2 changed files with 28 additions and 5 deletions

View File

@@ -42,14 +42,20 @@ class ContextMenu(object):
if isinstance(texts, basestring):
texts = (texts,)
bitmap = m.getBitmap(context, selection)
multiple = not isinstance(bitmap, wx.Bitmap)
for it, text in enumerate(texts):
id = wx.NewId()
item = wx.MenuItem(menu, id, text)
menu.info[id] = (m, context, it)
bitmap = m.getBitmap(context, selection)
if bitmap:
item.SetBitmap(bitmap)
if bitmap is not None:
if multiple:
bp = bitmap[it]
if bp:
item.SetBitmap(bp)
else:
item.SetBitmap(bitmap)
menu.AppendItem(item)