X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/26eb87155b872225618d3c738fb5f3dff1f7381f..59d04dff037f66e9e73b389de72835211f5f0bcd:/wxPython/src/mac/wx.py diff --git a/wxPython/src/mac/wx.py b/wxPython/src/mac/wx.py index b1a9333931..159bf91e0e 100644 --- a/wxPython/src/mac/wx.py +++ b/wxPython/src/mac/wx.py @@ -282,8 +282,13 @@ wxSB_HORIZONTAL = wxc.wxSB_HORIZONTAL wxSB_VERTICAL = wxc.wxSB_VERTICAL wxST_SIZEGRIP = wxc.wxST_SIZEGRIP wxST_NO_AUTORESIZE = wxc.wxST_NO_AUTORESIZE -wxBU_AUTODRAW = wxc.wxBU_AUTODRAW wxBU_NOAUTODRAW = wxc.wxBU_NOAUTODRAW +wxBU_AUTODRAW = wxc.wxBU_AUTODRAW +wxBU_LEFT = wxc.wxBU_LEFT +wxBU_TOP = wxc.wxBU_TOP +wxBU_RIGHT = wxc.wxBU_RIGHT +wxBU_BOTTOM = wxc.wxBU_BOTTOM +wxBU_EXACTFIT = wxc.wxBU_EXACTFIT wxSP_VERTICAL = wxc.wxSP_VERTICAL wxSP_HORIZONTAL = wxc.wxSP_HORIZONTAL wxSP_ARROW_KEYS = wxc.wxSP_ARROW_KEYS @@ -339,6 +344,8 @@ wxPRINT_QUALITY_HIGH = wxc.wxPRINT_QUALITY_HIGH wxPRINT_QUALITY_MEDIUM = wxc.wxPRINT_QUALITY_MEDIUM wxPRINT_QUALITY_LOW = wxc.wxPRINT_QUALITY_LOW wxPRINT_QUALITY_DRAFT = wxc.wxPRINT_QUALITY_DRAFT +wxID_ANY = wxc.wxID_ANY +wxID_SEPARATOR = wxc.wxID_SEPARATOR wxID_OPEN = wxc.wxID_OPEN wxID_CLOSE = wxc.wxID_CLOSE wxID_NEW = wxc.wxID_NEW @@ -456,6 +463,13 @@ wxMM_ISOTROPIC = wxc.wxMM_ISOTROPIC wxMM_ANISOTROPIC = wxc.wxMM_ANISOTROPIC wxMM_POINTS = wxc.wxMM_POINTS wxMM_METRIC = wxc.wxMM_METRIC +wxTIMER_CONTINUOUS = wxc.wxTIMER_CONTINUOUS +wxTIMER_ONE_SHOT = wxc.wxTIMER_ONE_SHOT +wxMOUSE_BTN_ANY = wxc.wxMOUSE_BTN_ANY +wxMOUSE_BTN_NONE = wxc.wxMOUSE_BTN_NONE +wxMOUSE_BTN_LEFT = wxc.wxMOUSE_BTN_LEFT +wxMOUSE_BTN_MIDDLE = wxc.wxMOUSE_BTN_MIDDLE +wxMOUSE_BTN_RIGHT = wxc.wxMOUSE_BTN_RIGHT wxBORDER_DEFAULT = wxc.wxBORDER_DEFAULT wxBORDER_NONE = wxc.wxBORDER_NONE wxBORDER_STATIC = wxc.wxBORDER_STATIC @@ -827,6 +841,7 @@ wxEVT_NC_LEAVE_WINDOW = wxc.wxEVT_NC_LEAVE_WINDOW wxEVT_NC_LEFT_DCLICK = wxc.wxEVT_NC_LEFT_DCLICK wxEVT_NC_MIDDLE_DCLICK = wxc.wxEVT_NC_MIDDLE_DCLICK wxEVT_NC_RIGHT_DCLICK = wxc.wxEVT_NC_RIGHT_DCLICK +wxEVT_SET_CURSOR = wxc.wxEVT_SET_CURSOR wxEVT_CHAR = wxc.wxEVT_CHAR wxEVT_KEY_DOWN = wxc.wxEVT_KEY_DOWN wxEVT_KEY_UP = wxc.wxEVT_KEY_UP @@ -839,6 +854,7 @@ wxEVT_SCROLL_PAGEUP = wxc.wxEVT_SCROLL_PAGEUP wxEVT_SCROLL_PAGEDOWN = wxc.wxEVT_SCROLL_PAGEDOWN wxEVT_SCROLL_THUMBTRACK = wxc.wxEVT_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBRELEASE = wxc.wxEVT_SCROLL_THUMBRELEASE +wxEVT_SCROLL_ENDSCROLL = wxc.wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLLWIN_TOP = wxc.wxEVT_SCROLLWIN_TOP wxEVT_SCROLLWIN_BOTTOM = wxc.wxEVT_SCROLLWIN_BOTTOM wxEVT_SCROLLWIN_LINEUP = wxc.wxEVT_SCROLLWIN_LINEUP @@ -1034,6 +1050,9 @@ def EVT_WINDOW_CREATE(win, func): def EVT_WINDOW_DESTROY(win, func): win.Connect(-1, -1, wxEVT_DESTROY, func) +def EVT_SET_CURSOR(win, func): + win.Connect(-1, -1, wxEVT_SET_CURSOR, func) + def EVT_IDLE(win, func): @@ -1114,14 +1133,15 @@ def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): # Scrolling def EVT_SCROLL(win, func): - win.Connect(-1, -1, wxEVT_SCROLL_TOP, func) - win.Connect(-1, -1, wxEVT_SCROLL_BOTTOM, func) - win.Connect(-1, -1, wxEVT_SCROLL_LINEUP, func) - win.Connect(-1, -1, wxEVT_SCROLL_LINEDOWN, func) - win.Connect(-1, -1, wxEVT_SCROLL_PAGEUP, func) - win.Connect(-1, -1, wxEVT_SCROLL_PAGEDOWN, func) - win.Connect(-1, -1, wxEVT_SCROLL_THUMBTRACK,func) + win.Connect(-1, -1, wxEVT_SCROLL_TOP, func) + win.Connect(-1, -1, wxEVT_SCROLL_BOTTOM, func) + win.Connect(-1, -1, wxEVT_SCROLL_LINEUP, func) + win.Connect(-1, -1, wxEVT_SCROLL_LINEDOWN, func) + win.Connect(-1, -1, wxEVT_SCROLL_PAGEUP, func) + win.Connect(-1, -1, wxEVT_SCROLL_PAGEDOWN, func) + win.Connect(-1, -1, wxEVT_SCROLL_THUMBTRACK, func) win.Connect(-1, -1, wxEVT_SCROLL_THUMBRELEASE,func) + win.Connect(-1, -1, wxEVT_SCROLL_ENDSCROLL, func) def EVT_SCROLL_TOP(win, func): win.Connect(-1, -1, wxEVT_SCROLL_TOP, func) @@ -1147,6 +1167,9 @@ def EVT_SCROLL_THUMBTRACK(win, func): def EVT_SCROLL_THUMBRELEASE(win, func): win.Connect(-1, -1, wxEVT_SCROLL_THUMBRELEASE, func) +def EVT_SCROLL_ENDSCROLL(win, func): + win.Connect(-1, -1, wxEVT_SCROLL_ENDSCROLL, func) + # Scrolling, with an id @@ -1159,6 +1182,7 @@ def EVT_COMMAND_SCROLL(win, id, func): win.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN, func) win.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK,func) win.Connect(id, -1, wxEVT_SCROLL_THUMBRELEASE,func) + win.Connect(-1, -1, wxEVT_SCROLL_ENDSCROLL, func) def EVT_COMMAND_SCROLL_TOP(win, id, func): win.Connect(id, -1, wxEVT_SCROLL_TOP, func) @@ -1184,6 +1208,9 @@ def EVT_COMMAND_SCROLL_THUMBTRACK(win, id, func): def EVT_COMMAND_SCROLL_THUMBRELEASE(win, id, func): win.Connect(id, -1, wxEVT_SCROLL_THUMBRELEASE, func) +def EVT_COMMAND_SCROLL_ENDSCROLL(win, id, func): + win.Connect(id, -1, wxEVT_SCROLL_ENDSCROLL, func) + #--- def EVT_SCROLLWIN(win, func): win.Connect(-1, -1, wxEVT_SCROLLWIN_TOP, func) @@ -1554,6 +1581,30 @@ def wxPyTypeCast(obj, typeStr): #---------------------------------------------------------------------------- +_wxCallAfterId = None + +def wxCallAfter(callable, *args, **kw): + """ + Call the specified function after the current and pending event + handlers have been completed. This is also good for making GUI + method calls from non-GUI threads. + """ + app = wxGetApp() + assert app, 'No wxApp created yet' + + global _wxCallAfterId + if _wxCallAfterId is None: + _wxCallAfterId = wxNewId() + app.Connect(-1, -1, _wxCallAfterId, + lambda event: apply(event.callable, event.args, event.kw) ) + evt = wxPyEvent() + evt.SetEventType(_wxCallAfterId) + evt.callable = callable + evt.args = args + evt.kw = kw + wxPostEvent(app, evt) + +#---------------------------------------------------------------------- class wxPyDeadObjectError(AttributeError): pass @@ -1679,6 +1730,7 @@ class wxPySimpleApp(wxApp): def __init__(self, flag=0): wxApp.__init__(self, flag) def OnInit(self): + wxInitAllImageHandlers() return true