]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxPyLog so log targets can be created in Python with the
authorRobin Dunn <robin@alldunn.com>
Fri, 5 Oct 2001 18:29:29 +0000 (18:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 5 Oct 2001 18:29:29 +0000 (18:29 +0000)
appropriate callbacks.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/CHANGES.txt
wxPython/README.txt
wxPython/demo/Main.py
wxPython/demo/wxButton.py
wxPython/src/misc2.i
wxPython/src/msw/misc2.cpp
wxPython/src/msw/misc2.py
wxPython/src/msw/windows.cpp
wxPython/src/msw/windows.py

index 11130bdba4b37510a78cdac0f48bcc613fc8ba6f..8d16f5116f83bfd147da68775e9351b8eec5a068 100644 (file)
@@ -46,6 +46,11 @@ Significantly changed how the Python interpreter lock and thread state
 are managed, which should fix the problem of running on a
 multi-processor machine.
 
+Added wxPyLog so log targets can be created in Python to handle log
+messages however is wished.  See demo/Main.py for an example.
+
+
+
 
 
 2.3.1
index 87388be57d61524e2b9e03415690f20db53fb7ea..9e32c5f3153a3e440f484666ddd4f700828c4382 100644 (file)
@@ -24,7 +24,7 @@ HTML Help format.  If your system doesn't know what to do with the help
 file, you can install the HTML Help Viewer as part of IE 4+, NT
 Service Pack 4+, or the HTML Workshop at
 
-http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp.
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp
 
 For some features, the latest common controls library from microsoft
 is required.  You can get this by installing IE 5.0 or Office 2000.
index aa32a418d0b9a062449e3e11cbfec22b625ad40c..228f428b944c8741459a67067e27d1b29f636df4 100644 (file)
@@ -11,7 +11,7 @@
 # Licence:      wxWindows license
 #----------------------------------------------------------------------------
 
-import sys, os
+import sys, os, time
 from   wxPython.wx import *
 from   wxPython.lib.splashscreen import SplashScreen
 from   wxPython.html import wxHtmlWindow
@@ -74,6 +74,21 @@ _treeList = [
 
 #---------------------------------------------------------------------------
 
+class MyLog(wxPyLog):
+    def __init__(self, textCtrl, logTime=0):
+        wxPyLog.__init__(self)
+        self.tc = textCtrl
+        self.logTime = logTime
+
+    def DoLogString(self, message, timeStamp):
+        if self.logTime:
+            message = time.strftime("%X", time.localtime(timeStamp)) + \
+                      ": " + message
+        self.tc.AppendText(message + '\n')
+
+
+#---------------------------------------------------------------------------
+
 class wxPythonDemo(wxFrame):
 
     def __init__(self, parent, id, title):
@@ -217,7 +232,8 @@ class wxPythonDemo(wxFrame):
         self.log = wxTextCtrl(splitter2, -1,
                               style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
         # Set the wxWindows log target to be this textctrl
-        wxLog_SetActiveTarget(wxLogTextCtrl(self.log))
+        #wxLog_SetActiveTarget(wxLogTextCtrl(self.log))
+        wxLog_SetActiveTarget(MyLog(self.log))
 
 
 
index f615727c94892a55968ce2992844c9c5f5134331..a8956f3db982586d9de25aee99f9b2d451dbe24d 100644 (file)
@@ -25,7 +25,7 @@ class TestPanel(wxPanel):
         mask = wxMaskColour(bmp, wxBLUE)
         bmp.SetMask(mask)
 
-        print bmp.GetWidth(), bmp.GetHeight()
+        ##print bmp.GetWidth(), bmp.GetHeight()
 
         wxBitmapButton(self, 30, bmp, wxPoint(140, 20),
                        wxSize(bmp.GetWidth()+10, bmp.GetHeight()+10))
index 7cea032de86071df22eaa95855cd14b29deb63f2..ca975d61f8f0909122548685eb949a9244e3e158 100644 (file)
@@ -558,12 +558,24 @@ public:
     static void SetTraceMask(wxTraceMask ulMask);
     static void AddTraceMask(const wxString& str);
     static void RemoveTraceMask(const wxString& str);
+    static void ClearTraceMasks();
+
+    static void SetTimestamp(const wxChar *ts);
+    static const wxChar *GetTimestamp();
 
     bool GetVerbose() const { return m_bVerbose; }
 
     static wxTraceMask GetTraceMask();
     static bool IsAllowedTraceMask(const char *mask);
 
+    // static void TimeStamp(wxString *str);
+    %addmethods {
+        wxString TimeStamp() {
+            wxString msg;
+            wxLog::TimeStamp(&msg);
+            return msg;
+        }
+    }
 };
 
 
@@ -611,6 +623,17 @@ public:
 };
 
 
+class wxLogChain : public wxLog
+{
+public:
+    wxLogChain(wxLog *logger);
+    void SetLog(wxLog *logger);
+    void PassMessages(bool bDoPass);
+    bool IsPassingMessages();
+    wxLog *GetOldLog();
+};
+
+
 unsigned long wxSysErrorCode();
 const char* wxSysErrorMsg(unsigned long nErrCode = 0);
 void wxLogFatalError(const char *szFormat);
@@ -624,6 +647,46 @@ void wxLogStatus(const char *szFormat);
 void wxLogSysError(const char *szFormat);
 
 
+%{
+// A Log class that can be derived from in wxPython
+class wxPyLog : public wxLog {
+public:
+    wxPyLog() : wxLog() {}
+
+    virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t) {
+        bool found;
+        wxPyTState* state = wxPyBeginBlockThreads();
+        if ((found = wxPyCBH_findCallback(m_myInst, "DoLog")))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(isi)", level, szString, t));
+        wxPyEndBlockThreads(state);
+        if (! found)
+            wxLog::DoLog(level, szString, t);
+    }
+
+    virtual void DoLogString(const wxChar *szString, time_t t) {
+        bool found;
+        wxPyTState* state = wxPyBeginBlockThreads();
+        if ((found = wxPyCBH_findCallback(m_myInst, "DoLogString")))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(si)", szString, t));
+        wxPyEndBlockThreads(state);
+        if (! found)
+            wxLog::DoLogString(szString, t);
+    }
+
+    PYPRIVATE;
+};
+%}
+
+// Now tell SWIG about it
+class wxPyLog : public wxLog {
+public:
+    wxPyLog();
+    void _setSelf(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyLog)"
+    %addmethods { void Destroy() { delete self; } }
+
+};
+
 
 //----------------------------------------------------------------------
 
index 156e83a7e2df67951bbe2d2a3a2dce2b2c31be90..276ab5f6eccee8ff0cece5b6d4e9b46155a5adc3 100644 (file)
@@ -160,6 +160,34 @@ IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
 
 
 #include <wx/generic/dragimgg.h>
+
+// A Log class that can be derived from in wxPython
+class wxPyLog : public wxLog {
+public:
+    wxPyLog() : wxLog() {}
+
+    virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t) {
+        bool found;
+        wxPyTState* state = wxPyBeginBlockThreads();
+        if ((found = wxPyCBH_findCallback(m_myInst, "DoLog")))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(isi)", level, szString, t));
+        wxPyEndBlockThreads(state);
+        if (! found)
+            wxLog::DoLog(level, szString, t);
+    }
+
+    virtual void DoLogString(const wxChar *szString, time_t t) {
+        bool found;
+        wxPyTState* state = wxPyBeginBlockThreads();
+        if ((found = wxPyCBH_findCallback(m_myInst, "DoLogString")))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(si)", szString, t));
+        wxPyEndBlockThreads(state);
+        if (! found)
+            wxLog::DoLogString(szString, t);
+    }
+
+    PYPRIVATE;
+};
  // C++ version of wxProcess derived class
 
 class wxPyProcess : public wxProcess {
@@ -4691,6 +4719,58 @@ static PyObject *_wrap_wxLog_RemoveTraceMask(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
+static PyObject *_wrap_wxLog_ClearTraceMasks(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    char *_kwnames[] = {  NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxLog_ClearTraceMasks",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxLog::ClearTraceMasks();
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxLog_SetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxChar * _arg0;
+    char *_kwnames[] = { "ts", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"s:wxLog_SetTimestamp",_kwnames,&_arg0)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxLog::SetTimestamp(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxLog_GetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxChar * _result;
+    char *_kwnames[] = {  NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxLog_GetTimestamp",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxChar *)wxLog::GetTimestamp();
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("s", _result);
+    return _resultobj;
+}
+
 #define wxLog_GetVerbose(_swigobj)  (_swigobj->GetVerbose())
 static PyObject *_wrap_wxLog_GetVerbose(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -4755,6 +4835,42 @@ static PyObject *_wrap_wxLog_IsAllowedTraceMask(PyObject *self, PyObject *args,
     return _resultobj;
 }
 
+static wxString  wxLog_TimeStamp(wxLog *self) {
+            wxString msg;
+            wxLog::TimeStamp(&msg);
+            return msg;
+        }
+static PyObject *_wrap_wxLog_TimeStamp(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxString * _result;
+    wxLog * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLog_TimeStamp",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxLog_TimeStamp. Expected _wxLog_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = new wxString (wxLog_TimeStamp(_arg0));
+
+    wxPy_END_ALLOW_THREADS;
+}{
+    _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+}
+{
+    delete _result;
+}
+    return _resultobj;
+}
+
 static void *SwigwxLogStderrTowxLog(void *ptr) {
     wxLogStderr *src;
     wxLog *dest;
@@ -5112,6 +5228,272 @@ static PyObject *_wrap_delete_wxLogNull(PyObject *self, PyObject *args, PyObject
     return _resultobj;
 }
 
+static void *SwigwxLogChainTowxLog(void *ptr) {
+    wxLogChain *src;
+    wxLog *dest;
+    src = (wxLogChain *) ptr;
+    dest = (wxLog *) src;
+    return (void *) dest;
+}
+
+#define new_wxLogChain(_swigarg0) (new wxLogChain(_swigarg0))
+static PyObject *_wrap_new_wxLogChain(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxLogChain * _result;
+    wxLog * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "logger", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxLogChain",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxLogChain. Expected _wxLog_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxLogChain *)new_wxLogChain(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxLogChain_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
+#define wxLogChain_SetLog(_swigobj,_swigarg0)  (_swigobj->SetLog(_swigarg0))
+static PyObject *_wrap_wxLogChain_SetLog(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxLogChain * _arg0;
+    wxLog * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _argo1 = 0;
+    char *_kwnames[] = { "self","logger", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxLogChain_SetLog",_kwnames,&_argo0,&_argo1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogChain_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxLogChain_SetLog. Expected _wxLogChain_p.");
+        return NULL;
+        }
+    }
+    if (_argo1) {
+        if (_argo1 == Py_None) { _arg1 = NULL; }
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxLog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxLogChain_SetLog. Expected _wxLog_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxLogChain_SetLog(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+#define wxLogChain_PassMessages(_swigobj,_swigarg0)  (_swigobj->PassMessages(_swigarg0))
+static PyObject *_wrap_wxLogChain_PassMessages(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxLogChain * _arg0;
+    bool  _arg1;
+    PyObject * _argo0 = 0;
+    int tempbool1;
+    char *_kwnames[] = { "self","bDoPass", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxLogChain_PassMessages",_kwnames,&_argo0,&tempbool1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogChain_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxLogChain_PassMessages. Expected _wxLogChain_p.");
+        return NULL;
+        }
+    }
+    _arg1 = (bool ) tempbool1;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxLogChain_PassMessages(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+#define wxLogChain_IsPassingMessages(_swigobj)  (_swigobj->IsPassingMessages())
+static PyObject *_wrap_wxLogChain_IsPassingMessages(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    bool  _result;
+    wxLogChain * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLogChain_IsPassingMessages",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogChain_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxLogChain_IsPassingMessages. Expected _wxLogChain_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxLogChain_IsPassingMessages(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
+    return _resultobj;
+}
+
+#define wxLogChain_GetOldLog(_swigobj)  (_swigobj->GetOldLog())
+static PyObject *_wrap_wxLogChain_GetOldLog(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxLog * _result;
+    wxLogChain * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLogChain_GetOldLog",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogChain_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxLogChain_GetOldLog. Expected _wxLogChain_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxLog *)wxLogChain_GetOldLog(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxLog_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
+static void *SwigwxPyLogTowxLog(void *ptr) {
+    wxPyLog *src;
+    wxLog *dest;
+    src = (wxPyLog *) ptr;
+    dest = (wxLog *) src;
+    return (void *) dest;
+}
+
+#define new_wxPyLog() (new wxPyLog())
+static PyObject *_wrap_new_wxPyLog(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyLog * _result;
+    char *_kwnames[] = {  NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPyLog",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPyLog *)new_wxPyLog();
+
+    wxPy_END_ALLOW_THREADS;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyLog_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
+#define wxPyLog__setSelf(_swigobj,_swigarg0,_swigarg1)  (_swigobj->_setSelf(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxPyLog__setSelf(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyLog * _arg0;
+    PyObject * _arg1;
+    PyObject * _arg2;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    PyObject * _obj2 = 0;
+    char *_kwnames[] = { "self","self","_class", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPyLog__setSelf",_kwnames,&_argo0,&_obj1,&_obj2)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyLog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyLog__setSelf. Expected _wxPyLog_p.");
+        return NULL;
+        }
+    }
+{
+  _arg1 = _obj1;
+}
+{
+  _arg2 = _obj2;
+}
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPyLog__setSelf(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+static void  wxPyLog_Destroy(wxPyLog *self) { delete self; }
+static PyObject *_wrap_wxPyLog_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyLog * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyLog_Destroy",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyLog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyLog_Destroy. Expected _wxPyLog_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPyLog_Destroy(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 static void *SwigwxProcessEventTowxEvent(void *ptr) {
     wxProcessEvent *src;
     wxEvent *dest;
@@ -7101,6 +7483,14 @@ static PyMethodDef misc2cMethods[] = {
         { "wxProcessEvent_GetExitCode", (PyCFunction) _wrap_wxProcessEvent_GetExitCode, METH_VARARGS | METH_KEYWORDS },
         { "wxProcessEvent_GetPid", (PyCFunction) _wrap_wxProcessEvent_GetPid, METH_VARARGS | METH_KEYWORDS },
         { "new_wxProcessEvent", (PyCFunction) _wrap_new_wxProcessEvent, METH_VARARGS | METH_KEYWORDS },
+        { "wxPyLog_Destroy", (PyCFunction) _wrap_wxPyLog_Destroy, METH_VARARGS | METH_KEYWORDS },
+        { "wxPyLog__setSelf", (PyCFunction) _wrap_wxPyLog__setSelf, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxPyLog", (PyCFunction) _wrap_new_wxPyLog, METH_VARARGS | METH_KEYWORDS },
+        { "wxLogChain_GetOldLog", (PyCFunction) _wrap_wxLogChain_GetOldLog, METH_VARARGS | METH_KEYWORDS },
+        { "wxLogChain_IsPassingMessages", (PyCFunction) _wrap_wxLogChain_IsPassingMessages, METH_VARARGS | METH_KEYWORDS },
+        { "wxLogChain_PassMessages", (PyCFunction) _wrap_wxLogChain_PassMessages, METH_VARARGS | METH_KEYWORDS },
+        { "wxLogChain_SetLog", (PyCFunction) _wrap_wxLogChain_SetLog, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxLogChain", (PyCFunction) _wrap_new_wxLogChain, METH_VARARGS | METH_KEYWORDS },
         { "delete_wxLogNull", (PyCFunction) _wrap_delete_wxLogNull, METH_VARARGS | METH_KEYWORDS },
         { "new_wxLogNull", (PyCFunction) _wrap_new_wxLogNull, METH_VARARGS | METH_KEYWORDS },
         { "wxLogWindow_PassMessages", (PyCFunction) _wrap_wxLogWindow_PassMessages, METH_VARARGS | METH_KEYWORDS },
@@ -7112,9 +7502,13 @@ static PyMethodDef misc2cMethods[] = {
         { "new_wxLogGui", (PyCFunction) _wrap_new_wxLogGui, METH_VARARGS | METH_KEYWORDS },
         { "new_wxLogTextCtrl", (PyCFunction) _wrap_new_wxLogTextCtrl, METH_VARARGS | METH_KEYWORDS },
         { "new_wxLogStderr", (PyCFunction) _wrap_new_wxLogStderr, METH_VARARGS | METH_KEYWORDS },
+        { "wxLog_TimeStamp", (PyCFunction) _wrap_wxLog_TimeStamp, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_IsAllowedTraceMask", (PyCFunction) _wrap_wxLog_IsAllowedTraceMask, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_GetTraceMask", (PyCFunction) _wrap_wxLog_GetTraceMask, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_GetVerbose", (PyCFunction) _wrap_wxLog_GetVerbose, METH_VARARGS | METH_KEYWORDS },
+        { "wxLog_GetTimestamp", (PyCFunction) _wrap_wxLog_GetTimestamp, METH_VARARGS | METH_KEYWORDS },
+        { "wxLog_SetTimestamp", (PyCFunction) _wrap_wxLog_SetTimestamp, METH_VARARGS | METH_KEYWORDS },
+        { "wxLog_ClearTraceMasks", (PyCFunction) _wrap_wxLog_ClearTraceMasks, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_RemoveTraceMask", (PyCFunction) _wrap_wxLog_RemoveTraceMask, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_AddTraceMask", (PyCFunction) _wrap_wxLog_AddTraceMask, METH_VARARGS | METH_KEYWORDS },
         { "wxLog_SetTraceMask", (PyCFunction) _wrap_wxLog_SetTraceMask, METH_VARARGS | METH_KEYWORDS },
@@ -7273,6 +7667,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
+    { "_wxLog","_wxPyLog",SwigwxPyLogTowxLog},
+    { "_wxLog","_wxLogChain",SwigwxLogChainTowxLog},
     { "_wxLog","_wxLogWindow",SwigwxLogWindowTowxLog},
     { "_wxLog","_wxLogGui",SwigwxLogGuiTowxLog},
     { "_wxLog","_wxLogTextCtrl",SwigwxLogTextCtrlTowxLog},
index f14a5b3935f5d98685684e64538c828bef8c321a..5ff8674ee2c2b55568ebf512f82ca71ebd6895ee 100644 (file)
@@ -329,6 +329,9 @@ class wxLogPtr :
     def GetVerbose(self, *_args, **_kwargs):
         val = apply(misc2c.wxLog_GetVerbose,(self,) + _args, _kwargs)
         return val
+    def TimeStamp(self, *_args, **_kwargs):
+        val = apply(misc2c.wxLog_TimeStamp,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxLog instance at %s>" % (self.this,)
 class wxLog(wxLogPtr):
@@ -428,6 +431,54 @@ class wxLogNull(wxLogNullPtr):
 
 
 
+class wxLogChainPtr(wxLogPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def SetLog(self, *_args, **_kwargs):
+        val = apply(misc2c.wxLogChain_SetLog,(self,) + _args, _kwargs)
+        return val
+    def PassMessages(self, *_args, **_kwargs):
+        val = apply(misc2c.wxLogChain_PassMessages,(self,) + _args, _kwargs)
+        return val
+    def IsPassingMessages(self, *_args, **_kwargs):
+        val = apply(misc2c.wxLogChain_IsPassingMessages,(self,) + _args, _kwargs)
+        return val
+    def GetOldLog(self, *_args, **_kwargs):
+        val = apply(misc2c.wxLogChain_GetOldLog,(self,) + _args, _kwargs)
+        if val: val = wxLogPtr(val) 
+        return val
+    def __repr__(self):
+        return "<C wxLogChain instance at %s>" % (self.this,)
+class wxLogChain(wxLogChainPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(misc2c.new_wxLogChain,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
+class wxPyLogPtr(wxLogPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def _setSelf(self, *_args, **_kwargs):
+        val = apply(misc2c.wxPyLog__setSelf,(self,) + _args, _kwargs)
+        return val
+    def Destroy(self, *_args, **_kwargs):
+        val = apply(misc2c.wxPyLog_Destroy,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxPyLog instance at %s>" % (self.this,)
+class wxPyLog(wxPyLogPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(misc2c.new_wxPyLog,_args,_kwargs)
+        self.thisown = 1
+        self._setSelf(self, wxPyLog)
+
+
+
+
 class wxProcessEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
@@ -874,6 +925,12 @@ wxLog_AddTraceMask = misc2c.wxLog_AddTraceMask
 
 wxLog_RemoveTraceMask = misc2c.wxLog_RemoveTraceMask
 
+wxLog_ClearTraceMasks = misc2c.wxLog_ClearTraceMasks
+
+wxLog_SetTimestamp = misc2c.wxLog_SetTimestamp
+
+wxLog_GetTimestamp = misc2c.wxLog_GetTimestamp
+
 wxLog_GetTraceMask = misc2c.wxLog_GetTraceMask
 
 wxLog_IsAllowedTraceMask = misc2c.wxLog_IsAllowedTraceMask
index b68e04dee8b04e56346c64d87b8129587d4bbc58..b527efdcd2268ac8f2af845a268eb6cc38f1e85f 100644 (file)
@@ -3699,43 +3699,6 @@ static PyObject *_wrap_wxWindow_ScrollWindow(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
-#define wxWindow_SetAcceleratorTable(_swigobj,_swigarg0)  (_swigobj->SetAcceleratorTable(_swigarg0))
-static PyObject *_wrap_wxWindow_SetAcceleratorTable(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject * _resultobj;
-    wxWindow * _arg0;
-    wxAcceleratorTable * _arg1;
-    PyObject * _argo0 = 0;
-    PyObject * _argo1 = 0;
-    char *_kwnames[] = { "self","accel", NULL };
-
-    self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetAcceleratorTable",_kwnames,&_argo0,&_argo1)) 
-        return NULL;
-    if (_argo0) {
-        if (_argo0 == Py_None) { _arg0 = NULL; }
-        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_SetAcceleratorTable. Expected _wxWindow_p.");
-        return NULL;
-        }
-    }
-    if (_argo1) {
-        if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxAcceleratorTable_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetAcceleratorTable. Expected _wxAcceleratorTable_p.");
-        return NULL;
-        }
-    }
-{
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxWindow_SetAcceleratorTable(_arg0,*_arg1);
-
-    wxPy_END_ALLOW_THREADS;
-    if (PyErr_Occurred()) return NULL;
-}    Py_INCREF(Py_None);
-    _resultobj = Py_None;
-    return _resultobj;
-}
-
 #define wxWindow_SetAutoLayout(_swigobj,_swigarg0)  (_swigobj->SetAutoLayout(_swigarg0))
 static PyObject *_wrap_wxWindow_SetAutoLayout(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -5715,6 +5678,43 @@ static PyObject *_wrap_wxWindow_PrevControlId(PyObject *self, PyObject *args, Py
     return _resultobj;
 }
 
+#define wxWindow_SetAcceleratorTable(_swigobj,_swigarg0)  (_swigobj->SetAcceleratorTable(_swigarg0))
+static PyObject *_wrap_wxWindow_SetAcceleratorTable(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    wxAcceleratorTable * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _argo1 = 0;
+    char *_kwnames[] = { "self","accel", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetAcceleratorTable",_kwnames,&_argo0,&_argo1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_SetAcceleratorTable. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+    if (_argo1) {
+        if (_argo1 == Py_None) { _arg1 = NULL; }
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxAcceleratorTable_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetAcceleratorTable. Expected _wxAcceleratorTable_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxWindow_SetAcceleratorTable(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 #define wxWindow_GetAcceleratorTable(_swigobj)  (_swigobj->GetAcceleratorTable())
 static PyObject *_wrap_wxWindow_GetAcceleratorTable(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -10538,6 +10538,7 @@ static PyMethodDef windowscMethods[] = {
         { "new_wxPrePanel", (PyCFunction) _wrap_new_wxPrePanel, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetAcceleratorTable", (PyCFunction) _wrap_wxWindow_GetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
+        { "wxWindow_SetAcceleratorTable", (PyCFunction) _wrap_wxWindow_SetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_NextControlId", (PyCFunction) _wrap_wxWindow_NextControlId, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_NewControlId", (PyCFunction) _wrap_wxWindow_NewControlId, METH_VARARGS | METH_KEYWORDS },
@@ -10600,7 +10601,6 @@ static PyMethodDef windowscMethods[] = {
         { "wxWindow_SetBackgroundColour", (PyCFunction) _wrap_wxWindow_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetAutoLayout", (PyCFunction) _wrap_wxWindow_GetAutoLayout, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_SetAutoLayout", (PyCFunction) _wrap_wxWindow_SetAutoLayout, METH_VARARGS | METH_KEYWORDS },
-        { "wxWindow_SetAcceleratorTable", (PyCFunction) _wrap_wxWindow_SetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_ScrollWindow", (PyCFunction) _wrap_wxWindow_ScrollWindow, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_ScreenToClient", (PyCFunction) _wrap_wxWindow_ScreenToClient, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_ScreenToClientXY", (PyCFunction) _wrap_wxWindow_ScreenToClientXY, METH_VARARGS | METH_KEYWORDS },
index 7e42b84ac07d59122e4c4a1a7ae208494b96b9aa..d093db3dee03adcefff6e798ef84b03965ebcaa3 100644 (file)
@@ -360,9 +360,6 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def ScrollWindow(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_ScrollWindow,(self,) + _args, _kwargs)
         return val
-    def SetAcceleratorTable(self, *_args, **_kwargs):
-        val = apply(windowsc.wxWindow_SetAcceleratorTable,(self,) + _args, _kwargs)
-        return val
     def SetAutoLayout(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_SetAutoLayout,(self,) + _args, _kwargs)
         return val
@@ -547,6 +544,9 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def PageDown(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_PageDown,(self,) + _args, _kwargs)
         return val
+    def SetAcceleratorTable(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_SetAcceleratorTable,(self,) + _args, _kwargs)
+        return val
     def GetAcceleratorTable(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_GetAcceleratorTable,(self,) + _args, _kwargs)
         if val: val = wxAcceleratorTablePtr(val)