Allow wxApp::MacOpenFile, MacPrintFile, MacNewFile, and MacReopenApp
to be overridden in Python. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -80,6 +80,9 @@ Updated wx.lib.calendar with many fixes and enhancements from Joerg
|
|||||||
|
|
||||||
Added wx.Display and wx.VideoMode.
|
Added wx.Display and wx.VideoMode.
|
||||||
|
|
||||||
|
AppleEvents can be handled by overriding wx.App methods MacOpenFile,
|
||||||
|
MacPrintFile, MacNewFile, and MacReopenApp.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -579,6 +579,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
// virtual int FilterEvent(wxEvent& event); // This one too????
|
// virtual int FilterEvent(wxEvent& event); // This one too????
|
||||||
|
|
||||||
|
// For catching Apple Events
|
||||||
|
virtual void MacOpenFile(const wxString &fileName);
|
||||||
|
virtual void MacPrintFile(const wxString &fileName);
|
||||||
|
virtual void MacNewFile();
|
||||||
|
virtual void MacReopenApp();
|
||||||
|
|
||||||
static bool GetMacSupportPCMenuShortcuts();
|
static bool GetMacSupportPCMenuShortcuts();
|
||||||
static long GetMacAboutMenuItemId();
|
static long GetMacAboutMenuItemId();
|
||||||
|
@@ -244,6 +244,44 @@ void wxPyApp::OnAssert(const wxChar *file,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For catching Apple Events
|
||||||
|
void wxPyApp::MacOpenFile(const wxString &fileName)
|
||||||
|
{
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
if (wxPyCBH_findCallback(m_myInst, "MacOpenFile")) {
|
||||||
|
PyObject* s = wx2PyString(fileName);
|
||||||
|
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));
|
||||||
|
Py_DECREF(s);
|
||||||
|
}
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPyApp::MacPrintFile(const wxString &fileName)
|
||||||
|
{
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
if (wxPyCBH_findCallback(m_myInst, "MacPrintFile")) {
|
||||||
|
PyObject* s = wx2PyString(fileName);
|
||||||
|
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));
|
||||||
|
Py_DECREF(s);
|
||||||
|
}
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPyApp::MacNewFile()
|
||||||
|
{
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
if (wxPyCBH_findCallback(m_myInst, "MacNewFile"))
|
||||||
|
wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPyApp::MacReopenApp()
|
||||||
|
{
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
if (wxPyCBH_findCallback(m_myInst, "MacReopenApp"))
|
||||||
|
wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*static*/
|
/*static*/
|
||||||
|
Reference in New Issue
Block a user