Commit 38b69e7d authored by Keegi's avatar Keegi

another attempt to get popup menu for buttons on mac

parent e6f4f9df
...@@ -707,8 +707,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -707,8 +707,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.cbuttons_reload() self.cbuttons_reload()
def editbutton(self,e): def editbutton(self,e):
if e.ButtonUp(wx.MOUSE_BTN_RIGHT) or (e.ButtonUp(wx.MOUSE_BTN_LEFT) and (e.AltDown() or e.ControlDown())): if e.IsCommandEvent() or e.ButtonUp(wx.MOUSE_BTN_RIGHT):
pos = e.GetPosition() if e.IsCommandEvent():
pos = (0,0)
else:
pos = e.GetPosition()
popupmenu = wx.Menu() popupmenu = wx.Menu()
obj = e.GetEventObject() obj = e.GetEventObject()
if hasattr(obj,"custombutton"): if hasattr(obj,"custombutton"):
...@@ -733,6 +736,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -733,6 +736,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def procbutton(self,e): def procbutton(self,e):
try: try:
if hasattr(e.GetEventObject(),"custombutton"): if hasattr(e.GetEventObject(),"custombutton"):
if wx.GetKeyState(wx.WXK_CONTROL) or wx.GetkeyState(wx.WXK_ALT):
return self.editbutton(e)
self.cur_button=e.GetEventObject().custombutton self.cur_button=e.GetEventObject().custombutton
self.onecmd(e.GetEventObject().properties[1]) self.onecmd(e.GetEventObject().properties[1])
self.cur_button=None self.cur_button=None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment