]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/windows.cpp
Added SplitTree sample to the demo
[wxWidgets.git] / wxPython / src / gtk / windows.cpp
index 9c8bd1639e4b9530f382c7705a82b431095121f8..0d1bd059175b498385c519ccfe323cdf73eeb687 100644 (file)
@@ -89,7 +89,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 #if PYTHON_API_VERSION >= 1009
     static char* wxStringErrorMsg = "String or Unicode type required";
 #else
-    static char* wxStringErrorMsg = "string type is required for parameter";
+    static char* wxStringErrorMsg = "String type required";
 #endif
 
     static wxString wxPyEmptyStr("");
@@ -446,6 +446,14 @@ static void  wxEvtHandler_Connect(wxEvtHandler *self,int  id,int  lastId,int  ev
                           (wxObjectEventFunction) &wxPyCallback::EventThunker,
                           new wxPyCallback(func));
             }
+            else if (func == Py_None) {
+                self->Disconnect(id, lastId, eventType,
+                                 (wxObjectEventFunction)
+                                 &wxPyCallback::EventThunker);
+            }
+            else {
+                PyErr_SetString(PyExc_TypeError, "Expected callable object or None.");
+            }
         }
 static PyObject *_wrap_wxEvtHandler_Connect(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -517,6 +525,41 @@ static PyObject *_wrap_wxEvtHandler_Disconnect(PyObject *self, PyObject *args, P
     return _resultobj;
 }
 
+static void  wxEvtHandler__setOORInfo(wxEvtHandler *self,PyObject * _self) {
+            self->SetClientObject(new wxPyClientData(_self));
+        }
+static PyObject *_wrap_wxEvtHandler__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxEvtHandler * _arg0;
+    PyObject * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    char *_kwnames[] = { "self","_self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxEvtHandler__setOORInfo",_kwnames,&_argo0,&_obj1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvtHandler_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvtHandler__setOORInfo. Expected _wxEvtHandler_p.");
+        return NULL;
+        }
+    }
+{
+  _arg1 = _obj1;
+}
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxEvtHandler__setOORInfo(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 static void *SwigwxValidatorTowxEvtHandler(void *ptr) {
     wxValidator *src;
     wxEvtHandler *dest;
@@ -739,8 +782,8 @@ static PyObject *_wrap_new_wxPyValidator(PyObject *self, PyObject *args, PyObjec
     return _resultobj;
 }
 
-#define wxPyValidator__setSelf(_swigobj,_swigarg0,_swigarg1,_swigarg2)  (_swigobj->_setSelf(_swigarg0,_swigarg1,_swigarg2))
-static PyObject *_wrap_wxPyValidator__setSelf(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxPyValidator__setCallbackInfo(_swigobj,_swigarg0,_swigarg1,_swigarg2)  (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1,_swigarg2))
+static PyObject *_wrap_wxPyValidator__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxPyValidator * _arg0;
     PyObject * _arg1;
@@ -752,12 +795,12 @@ static PyObject *_wrap_wxPyValidator__setSelf(PyObject *self, PyObject *args, Py
     char *_kwnames[] = { "self","self","_class","incref", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|i:wxPyValidator__setSelf",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|i:wxPyValidator__setCallbackInfo",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
         else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyValidator_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyValidator__setSelf. Expected _wxPyValidator_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyValidator__setCallbackInfo. Expected _wxPyValidator_p.");
         return NULL;
         }
     }
@@ -769,7 +812,7 @@ static PyObject *_wrap_wxPyValidator__setSelf(PyObject *self, PyObject *args, Py
 }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxPyValidator__setSelf(_arg0,_arg1,_arg2,_arg3);
+        wxPyValidator__setCallbackInfo(_arg0,_arg1,_arg2,_arg3);
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
@@ -1788,18 +1831,12 @@ static PyObject *_wrap_wxWindow_GetFont(PyObject *self, PyObject *args, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxFont & _result_ref = wxWindow_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxWindow_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -4495,13 +4532,13 @@ static PyObject *_wrap_wxWindow_Show(PyObject *self, PyObject *args, PyObject *k
     PyObject * _resultobj;
     bool  _result;
     wxWindow * _arg0;
-    bool  _arg1;
+    bool  _arg1 = (bool ) TRUE;
     PyObject * _argo0 = 0;
-    int tempbool1;
+    int tempbool1 = (int) TRUE;
     char *_kwnames[] = { "self","show", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxWindow_Show",_kwnames,&_argo0,&tempbool1)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_Show",_kwnames,&_argo0,&tempbool1)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -4965,7 +5002,7 @@ static PyObject *_wrap_wxWindow_GetSizer(PyObject *self, PyObject *args, PyObjec
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}{ _resultobj = wxPyMake_wxObject(_result); }
+}{ _resultobj = wxPyMake_wxSizer(_result); }
     return _resultobj;
 }
 
@@ -10153,7 +10190,7 @@ static PyMethodDef windowscMethods[] = {
         { "wxWindow_Create", (PyCFunction) _wrap_wxWindow_Create, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPreWindow", (PyCFunction) _wrap_new_wxPreWindow, METH_VARARGS | METH_KEYWORDS },
         { "new_wxWindow", (PyCFunction) _wrap_new_wxWindow, METH_VARARGS | METH_KEYWORDS },
-        { "wxPyValidator__setSelf", (PyCFunction) _wrap_wxPyValidator__setSelf, METH_VARARGS | METH_KEYWORDS },
+        { "wxPyValidator__setCallbackInfo", (PyCFunction) _wrap_wxPyValidator__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPyValidator", (PyCFunction) _wrap_new_wxPyValidator, METH_VARARGS | METH_KEYWORDS },
         { "wxValidator_SetBellOnError", (PyCFunction) _wrap_wxValidator_SetBellOnError, METH_VARARGS | METH_KEYWORDS },
         { "wxValidator_IsSilent", (PyCFunction) _wrap_wxValidator_IsSilent, METH_VARARGS | METH_KEYWORDS },
@@ -10161,6 +10198,7 @@ static PyMethodDef windowscMethods[] = {
         { "wxValidator_GetWindow", (PyCFunction) _wrap_wxValidator_GetWindow, METH_VARARGS | METH_KEYWORDS },
         { "wxValidator_Clone", (PyCFunction) _wrap_wxValidator_Clone, METH_VARARGS | METH_KEYWORDS },
         { "new_wxValidator", (PyCFunction) _wrap_new_wxValidator, METH_VARARGS | METH_KEYWORDS },
+        { "wxEvtHandler__setOORInfo", (PyCFunction) _wrap_wxEvtHandler__setOORInfo, METH_VARARGS | METH_KEYWORDS },
         { "wxEvtHandler_Disconnect", (PyCFunction) _wrap_wxEvtHandler_Disconnect, METH_VARARGS | METH_KEYWORDS },
         { "wxEvtHandler_Connect", (PyCFunction) _wrap_wxEvtHandler_Connect, METH_VARARGS | METH_KEYWORDS },
         { "wxEvtHandler_SetPreviousHandler", (PyCFunction) _wrap_wxEvtHandler_SetPreviousHandler, METH_VARARGS | METH_KEYWORDS },
@@ -10191,41 +10229,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
-    { "_class_wxEvtHandler","_class_wxMenuBar",SwigwxMenuBarTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxMenuBar",SwigwxMenuBarTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxMenu",SwigwxMenuTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxMenu",SwigwxMenuTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxScrolledWindow",SwigwxScrolledWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxScrolledWindow",SwigwxScrolledWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxPanel",SwigwxPanelTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxPanel",SwigwxPanelTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxWindow",SwigwxWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxWindow",SwigwxWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxPyValidator",SwigwxPyValidatorTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxPyValidator",SwigwxPyValidatorTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxValidator",SwigwxValidatorTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxValidator",SwigwxValidatorTowxEvtHandler},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
-    { "_class_wxObject","_class_wxMenuItem",SwigwxMenuItemTowxObject},
-    { "_class_wxObject","_wxMenuItem",SwigwxMenuItemTowxObject},
-    { "_class_wxObject","_class_wxMenuBar",SwigwxMenuBarTowxObject},
-    { "_class_wxObject","_wxMenuBar",SwigwxMenuBarTowxObject},
-    { "_class_wxObject","_class_wxMenu",SwigwxMenuTowxObject},
-    { "_class_wxObject","_wxMenu",SwigwxMenuTowxObject},
-    { "_class_wxObject","_class_wxScrolledWindow",SwigwxScrolledWindowTowxObject},
-    { "_class_wxObject","_wxScrolledWindow",SwigwxScrolledWindowTowxObject},
-    { "_class_wxObject","_class_wxPanel",SwigwxPanelTowxObject},
-    { "_class_wxObject","_wxPanel",SwigwxPanelTowxObject},
-    { "_class_wxObject","_class_wxWindow",SwigwxWindowTowxObject},
-    { "_class_wxObject","_wxWindow",SwigwxWindowTowxObject},
-    { "_class_wxObject","_class_wxPyValidator",SwigwxPyValidatorTowxObject},
-    { "_class_wxObject","_wxPyValidator",SwigwxPyValidatorTowxObject},
-    { "_class_wxObject","_class_wxValidator",SwigwxValidatorTowxObject},
-    { "_class_wxObject","_wxValidator",SwigwxValidatorTowxObject},
-    { "_class_wxObject","_class_wxEvtHandler",SwigwxEvtHandlerTowxObject},
-    { "_class_wxObject","_wxEvtHandler",SwigwxEvtHandlerTowxObject},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_size_t","_time_t",0},
@@ -10233,7 +10239,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_size_t","_int",0},
     { "_size_t","_wxWindowID",0},
     { "_size_t","_uint",0},
-    { "_wxPanel","_class_wxScrolledWindow",SwigwxScrolledWindowTowxPanel},
     { "_wxPanel","_wxScrolledWindow",SwigwxScrolledWindowTowxPanel},
     { "_uint","_wxCoord",0},
     { "_uint","_wxPrintQuality",0},
@@ -10244,8 +10249,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_uint","_wxWindowID",0},
     { "_wxChar","_char",0},
     { "_char","_wxChar",0},
-    { "_class_wxValidator","_class_wxPyValidator",SwigwxPyValidatorTowxValidator},
-    { "_class_wxValidator","_wxPyValidator",SwigwxPyValidatorTowxValidator},
     { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
     { "_EBool","_wxCoord",0},
     { "_EBool","_wxPrintQuality",0},
@@ -10254,8 +10257,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_EBool","_wxWindowID",0},
     { "_unsigned_long","_long",0},
     { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
-    { "_class_wxPanel","_class_wxScrolledWindow",SwigwxScrolledWindowTowxPanel},
-    { "_class_wxPanel","_wxScrolledWindow",SwigwxScrolledWindowTowxPanel},
     { "_signed_int","_wxCoord",0},
     { "_signed_int","_wxPrintQuality",0},
     { "_signed_int","_EBool",0},
@@ -10266,29 +10267,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_WXTYPE","_unsigned_short",0},
     { "_unsigned_short","_WXTYPE",0},
     { "_unsigned_short","_short",0},
-    { "_class_wxWindow","_class_wxMenuBar",SwigwxMenuBarTowxWindow},
-    { "_class_wxWindow","_wxMenuBar",SwigwxMenuBarTowxWindow},
-    { "_class_wxWindow","_class_wxScrolledWindow",SwigwxScrolledWindowTowxWindow},
-    { "_class_wxWindow","_wxScrolledWindow",SwigwxScrolledWindowTowxWindow},
-    { "_class_wxWindow","_class_wxPanel",SwigwxPanelTowxWindow},
-    { "_class_wxWindow","_wxPanel",SwigwxPanelTowxWindow},
-    { "_wxObject","_class_wxMenuItem",SwigwxMenuItemTowxObject},
     { "_wxObject","_wxMenuItem",SwigwxMenuItemTowxObject},
-    { "_wxObject","_class_wxMenuBar",SwigwxMenuBarTowxObject},
     { "_wxObject","_wxMenuBar",SwigwxMenuBarTowxObject},
-    { "_wxObject","_class_wxMenu",SwigwxMenuTowxObject},
     { "_wxObject","_wxMenu",SwigwxMenuTowxObject},
-    { "_wxObject","_class_wxScrolledWindow",SwigwxScrolledWindowTowxObject},
     { "_wxObject","_wxScrolledWindow",SwigwxScrolledWindowTowxObject},
-    { "_wxObject","_class_wxPanel",SwigwxPanelTowxObject},
     { "_wxObject","_wxPanel",SwigwxPanelTowxObject},
-    { "_wxObject","_class_wxWindow",SwigwxWindowTowxObject},
     { "_wxObject","_wxWindow",SwigwxWindowTowxObject},
-    { "_wxObject","_class_wxPyValidator",SwigwxPyValidatorTowxObject},
     { "_wxObject","_wxPyValidator",SwigwxPyValidatorTowxObject},
-    { "_wxObject","_class_wxValidator",SwigwxValidatorTowxObject},
     { "_wxObject","_wxValidator",SwigwxValidatorTowxObject},
-    { "_wxObject","_class_wxEvtHandler",SwigwxEvtHandlerTowxObject},
     { "_wxObject","_wxEvtHandler",SwigwxEvtHandlerTowxObject},
     { "_signed_short","_WXTYPE",0},
     { "_signed_short","_short",0},
@@ -10328,7 +10314,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_time_t","_wxWindowID",0},
     { "_time_t","_uint",0},
     { "_time_t","_size_t",0},
-    { "_wxValidator","_class_wxPyValidator",SwigwxPyValidatorTowxValidator},
     { "_wxValidator","_wxPyValidator",SwigwxPyValidatorTowxValidator},
     { "_wxCoord","_int",0},
     { "_wxCoord","_signed_int",0},
@@ -10339,25 +10324,15 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxCoord","_size_t",0},
     { "_wxCoord","_time_t",0},
     { "_wxCoord","_wxPrintQuality",0},
-    { "_wxEvtHandler","_class_wxMenuBar",SwigwxMenuBarTowxEvtHandler},
     { "_wxEvtHandler","_wxMenuBar",SwigwxMenuBarTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxMenu",SwigwxMenuTowxEvtHandler},
     { "_wxEvtHandler","_wxMenu",SwigwxMenuTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxScrolledWindow",SwigwxScrolledWindowTowxEvtHandler},
     { "_wxEvtHandler","_wxScrolledWindow",SwigwxScrolledWindowTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxPanel",SwigwxPanelTowxEvtHandler},
     { "_wxEvtHandler","_wxPanel",SwigwxPanelTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxWindow",SwigwxWindowTowxEvtHandler},
     { "_wxEvtHandler","_wxWindow",SwigwxWindowTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxPyValidator",SwigwxPyValidatorTowxEvtHandler},
     { "_wxEvtHandler","_wxPyValidator",SwigwxPyValidatorTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxValidator",SwigwxValidatorTowxEvtHandler},
     { "_wxEvtHandler","_wxValidator",SwigwxValidatorTowxEvtHandler},
-    { "_wxWindow","_class_wxMenuBar",SwigwxMenuBarTowxWindow},
     { "_wxWindow","_wxMenuBar",SwigwxMenuBarTowxWindow},
-    { "_wxWindow","_class_wxScrolledWindow",SwigwxScrolledWindowTowxWindow},
     { "_wxWindow","_wxScrolledWindow",SwigwxScrolledWindowTowxWindow},
-    { "_wxWindow","_class_wxPanel",SwigwxPanelTowxWindow},
     { "_wxWindow","_wxPanel",SwigwxPanelTowxWindow},
 {0,0,0}};