another attempt to get popup menu for buttons on mac
parent
e6f4f9dfb5
commit
38b69e7d74
|
@ -707,7 +707,10 @@ 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):
|
||||||
|
if e.IsCommandEvent():
|
||||||
|
pos = (0,0)
|
||||||
|
else:
|
||||||
pos = e.GetPosition()
|
pos = e.GetPosition()
|
||||||
popupmenu = wx.Menu()
|
popupmenu = wx.Menu()
|
||||||
obj = e.GetEventObject()
|
obj = e.GetEventObject()
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue