wxASSERT and others are converted to Python Exceptions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-10-04 00:40:31 +00:00
parent 1d4874621e
commit 9312e5d6db
10 changed files with 352 additions and 50 deletions

View File

@@ -20,21 +20,7 @@
typedef unsigned char byte;
class wxPyApp: public wxApp
{
public:
wxPyApp();
~wxPyApp();
bool OnInit();
int MainLoop();
};
extern wxPyApp *wxPythonApp;
//----------------------------------------------------------------------
void __wxPreStart();
void __wxPreStart(PyObject*);
PyObject* __wxStart(PyObject*, PyObject* args);
void __wxCleanup();
@@ -404,19 +390,59 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh);
//---------------------------------------------------------------------------
// This is used in C++ classes that need to be able to make callback to
// "overloaded" python methods
#define PYPRIVATE \
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=1) { \
wxPyCBH_setCallbackInfo(m_myInst, self, _class, incref); \
} \
private: wxPyCallbackHelper m_myInst
//---------------------------------------------------------------------------
enum {
wxPYAPP_ASSERT_SUPPRESS = 1,
wxPYAPP_ASSERT_EXCEPTION = 2,
wxPYAPP_ASSERT_DIALOG = 4
};
class wxPyApp: public wxApp
{
DECLARE_ABSTRACT_CLASS(wxPyApp);
public:
wxPyApp();
~wxPyApp();
bool OnInit();
int MainLoop();
int GetAssertMode() { return m_assertMode; }
void SetAssertMode(int mode) { m_assertMode = mode; }
virtual bool OnInitGui();
virtual int OnExit();
virtual void OnAssert(const wxChar *file,
int line,
const wxChar *cond,
const wxChar *msg);
// virtual int FilterEvent(wxEvent& event); // This one too????
PYPRIVATE;
int m_assertMode;
};
extern wxPyApp *wxPythonApp;
//----------------------------------------------------------------------
// These macros are used to implement the virtual methods that should
// redirect to a Python method if one exists. The names designate the
// return type, if any, as well as any parameter types.
//---------------------------------------------------------------------------
#define PYPRIVATE \
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=1) { \
wxPyCBH_setCallbackInfo(m_myInst, self, _class, incref); \
} \
private: wxPyCallbackHelper m_myInst
//---------------------------------------------------------------------------
#define DEC_PYCALLBACK__(CBNAME) \
void CBNAME(); \
void base_##CBNAME();