There is a context menu on buffers. When the applications key or the right mouse button is pressed that menu is displayed. It only works for the GUI

This commit is contained in:
2014-12-01 05:55:25 -06:00
parent 855cefeb8d
commit 2f7eb12104
6 changed files with 174 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import sound
import config
import platform
import gui.dialogs
import menus
import output
import logging as original_logger
from multiplatform_widgets import widgets
@@ -36,6 +37,8 @@ class eventsPanel(wx.Panel):
def bind_events(self):
self.Bind(event.MyEVT_OBJECT, self.update)
self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.showMenu, self.list.list)
self.Bind(wx.EVT_LIST_KEY_DOWN, self.showMenuByKey, self.list.list)
def put_items(self, items):
pass
@@ -131,4 +134,13 @@ class eventsPanel(wx.Panel):
try:
ev.Skip()
except:
pass
pass
def showMenu(self, ev):
if self.list.get_count() == 0: return
self.PopupMenu(menus.eventsPanelMenu(self), ev.GetPosition())
def showMenuByKey(self, ev):
if self.list.get_count() == 0: return
if ev.GetKeyCode() == wx.WXK_WINDOWS_MENU:
self.PopupMenu(menus.eventsPanelMenu(self), self.list.list.GetPosition())