From: Robin Dunn <robin@alldunn.com>
Date: Thu, 28 Feb 2002 16:59:20 +0000 (+0000)
Subject: Moved declaratrions of wxPyInputStream and etc. into it's own header
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4152e8b9fd8679a53ecbb58312f5db3fd346b7ba

Moved declaratrions of wxPyInputStream and etc. into it's own header
file.

SWIGged updates for wxGTK


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

diff --git a/wxPython/src/gtk/events.cpp b/wxPython/src/gtk/events.cpp
index 84d6c249fb..b5fca3d48c 100644
--- a/wxPython/src/gtk/events.cpp
+++ b/wxPython/src/gtk/events.cpp
@@ -4734,6 +4734,34 @@ static PyObject *_wrap_wxMenuEvent_GetMenuId(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
+#define wxMenuEvent_IsPopup(_swigobj)  (_swigobj->IsPopup())
+static PyObject *_wrap_wxMenuEvent_IsPopup(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    bool  _result;
+    wxMenuEvent * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenuEvent_IsPopup",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenuEvent_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuEvent_IsPopup. Expected _wxMenuEvent_p.");
+        return NULL;
+        }
+    }
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+        _result = (bool )wxMenuEvent_IsPopup(_arg0);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    _resultobj = Py_BuildValue("i",_result);
+    return _resultobj;
+}
+
 static void *SwigwxShowEventTowxEvent(void *ptr) {
     wxShowEvent *src;
     wxEvent *dest;
@@ -7184,6 +7212,7 @@ static PyMethodDef eventscMethods[] = {
 	 { "wxShowEvent_GetShow", (PyCFunction) _wrap_wxShowEvent_GetShow, METH_VARARGS | METH_KEYWORDS },
 	 { "wxShowEvent_SetShow", (PyCFunction) _wrap_wxShowEvent_SetShow, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxShowEvent", (PyCFunction) _wrap_new_wxShowEvent, METH_VARARGS | METH_KEYWORDS },
+	 { "wxMenuEvent_IsPopup", (PyCFunction) _wrap_wxMenuEvent_IsPopup, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMenuEvent_GetMenuId", (PyCFunction) _wrap_wxMenuEvent_GetMenuId, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxMenuEvent", (PyCFunction) _wrap_new_wxMenuEvent, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxInitDialogEvent", (PyCFunction) _wrap_new_wxInitDialogEvent, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/gtk/events.py b/wxPython/src/gtk/events.py
index d6ba0941e7..38be62abe4 100644
--- a/wxPython/src/gtk/events.py
+++ b/wxPython/src/gtk/events.py
@@ -629,6 +629,9 @@ class wxMenuEventPtr(wxEventPtr):
     def GetMenuId(self, *_args, **_kwargs):
         val = apply(eventsc.wxMenuEvent_GetMenuId,(self,) + _args, _kwargs)
         return val
+    def IsPopup(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMenuEvent_IsPopup,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxMenuEvent instance at %s>" % (self.this,)
 class wxMenuEvent(wxMenuEventPtr):
diff --git a/wxPython/src/gtk/filesys.cpp b/wxPython/src/gtk/filesys.cpp
index 0b2186bfbe..8c9f53633e 100644
--- a/wxPython/src/gtk/filesys.cpp
+++ b/wxPython/src/gtk/filesys.cpp
@@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void);
 #define SWIG_name    "filesysc"
 
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/filesys.h>
 #include <wx/fs_inet.h>
 #include <wx/fs_mem.h>
diff --git a/wxPython/src/gtk/image.cpp b/wxPython/src/gtk/image.cpp
index 2b4d773e63..0796f706fe 100644
--- a/wxPython/src/gtk/image.cpp
+++ b/wxPython/src/gtk/image.cpp
@@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void);
 #define SWIG_name    "imagec"
 
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/image.h>
 
 
diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp
index 0c5016b3fb..fab3942670 100644
--- a/wxPython/src/gtk/misc2.cpp
+++ b/wxPython/src/gtk/misc2.cpp
@@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void);
 #define SWIG_name    "misc2c"
 
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/resource.h>
 #include <wx/tooltip.h>
 #include <wx/caret.h>
diff --git a/wxPython/src/gtk/streams.cpp b/wxPython/src/gtk/streams.cpp
index 3e628fd98f..2822bd02f3 100644
--- a/wxPython/src/gtk/streams.cpp
+++ b/wxPython/src/gtk/streams.cpp
@@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void);
 #define SWIG_name    "streamsc"
 
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/stream.h>
 #include <wx/list.h>
 
diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp
index ca356122f5..e10bc1d09d 100644
--- a/wxPython/src/gtk/wx.cpp
+++ b/wxPython/src/gtk/wx.cpp
@@ -2561,10 +2561,9 @@ SWIGEXPORT(void) initwxc() {
 	 PyDict_SetItemString(d,"wxEVT_ERASE_BACKGROUND", PyInt_FromLong((long) wxEVT_ERASE_BACKGROUND));
 	 PyDict_SetItemString(d,"wxEVT_NC_PAINT", PyInt_FromLong((long) wxEVT_NC_PAINT));
 	 PyDict_SetItemString(d,"wxEVT_PAINT_ICON", PyInt_FromLong((long) wxEVT_PAINT_ICON));
-	 PyDict_SetItemString(d,"wxEVT_MENU_CHAR", PyInt_FromLong((long) wxEVT_MENU_CHAR));
-	 PyDict_SetItemString(d,"wxEVT_MENU_INIT", PyInt_FromLong((long) wxEVT_MENU_INIT));
+	 PyDict_SetItemString(d,"wxEVT_MENU_OPEN", PyInt_FromLong((long) wxEVT_MENU_OPEN));
+	 PyDict_SetItemString(d,"wxEVT_MENU_CLOSE", PyInt_FromLong((long) wxEVT_MENU_CLOSE));
 	 PyDict_SetItemString(d,"wxEVT_MENU_HIGHLIGHT", PyInt_FromLong((long) wxEVT_MENU_HIGHLIGHT));
-	 PyDict_SetItemString(d,"wxEVT_POPUP_MENU_INIT", PyInt_FromLong((long) wxEVT_POPUP_MENU_INIT));
 	 PyDict_SetItemString(d,"wxEVT_SYS_COLOUR_CHANGED", PyInt_FromLong((long) wxEVT_SYS_COLOUR_CHANGED));
 	 PyDict_SetItemString(d,"wxEVT_DISPLAY_CHANGED", PyInt_FromLong((long) wxEVT_DISPLAY_CHANGED));
 	 PyDict_SetItemString(d,"wxEVT_SETTING_CHANGED", PyInt_FromLong((long) wxEVT_SETTING_CHANGED));
diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py
index 81aec65c68..679823cd89 100644
--- a/wxPython/src/gtk/wx.py
+++ b/wxPython/src/gtk/wx.py
@@ -848,10 +848,9 @@ wxEVT_PAINT = wxc.wxEVT_PAINT
 wxEVT_ERASE_BACKGROUND = wxc.wxEVT_ERASE_BACKGROUND
 wxEVT_NC_PAINT = wxc.wxEVT_NC_PAINT
 wxEVT_PAINT_ICON = wxc.wxEVT_PAINT_ICON
-wxEVT_MENU_CHAR = wxc.wxEVT_MENU_CHAR
-wxEVT_MENU_INIT = wxc.wxEVT_MENU_INIT
+wxEVT_MENU_OPEN = wxc.wxEVT_MENU_OPEN
+wxEVT_MENU_CLOSE = wxc.wxEVT_MENU_CLOSE
 wxEVT_MENU_HIGHLIGHT = wxc.wxEVT_MENU_HIGHLIGHT
-wxEVT_POPUP_MENU_INIT = wxc.wxEVT_POPUP_MENU_INIT
 wxEVT_SYS_COLOUR_CHANGED = wxc.wxEVT_SYS_COLOUR_CHANGED
 wxEVT_DISPLAY_CHANGED = wxc.wxEVT_DISPLAY_CHANGED
 wxEVT_SETTING_CHANGED = wxc.wxEVT_SETTING_CHANGED
@@ -949,6 +948,12 @@ def EVT_KEY_DOWN(win, func):
 def EVT_KEY_UP(win, func):
     win.Connect(-1, -1, wxEVT_KEY_UP, func)
 
+def EVT_MENU_OPEN(win, func):
+    win.Connect(-1, -1, wxEVT_MENU_OPEN, func)
+
+def EVT_MENU_CLOSE(win, func):
+    win.Connect(-1, -1, wxEVT_MENU_CLOSE, func)
+
 def EVT_MENU_HIGHLIGHT(win, id, func):
     win.Connect(id, -1, wxEVT_MENU_HIGHLIGHT, func)
 
diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp
index f653ed1c41..bf1d3402f3 100644
--- a/wxPython/src/helpers.cpp
+++ b/wxPython/src/helpers.cpp
@@ -906,11 +906,11 @@ void wxPyCallbackHelper::setSelf(PyObject* self, PyObject* klass, int incref) {
 // Prior to Python 2.2 PyMethod_GetClass returned the class object
 // in which the method was defined.  Starting with 2.2 it returns
 // "class that asked for the method" which seems totally bogus to me
-// but apprently if fixes some obscure problem waiting to happen in
+// but apprently it fixes some obscure problem waiting to happen in
 // Python.  Since the API was not documented Guido and the gang felt
 // safe in changing it.  Needless to say that totally screwed up the
 // logic below in wxPyCallbackHelper::findCallback, hence this icky
-// code to find the class where the method is actuallt defined...
+// code to find the class where the method is actually defined...
 
 static
 PyObject* PyFindClassWithAttr(PyObject *klass, PyObject *name)
@@ -958,6 +958,7 @@ PyObject* PyFindClassWithAttr(PyObject *klass, PyObject *name)
         }
         return NULL;
     }
+    return NULL;
 }
 #endif
 
diff --git a/wxPython/src/image.i b/wxPython/src/image.i
index 457887f7f1..ba3f7ecb15 100644
--- a/wxPython/src/image.i
+++ b/wxPython/src/image.i
@@ -15,6 +15,7 @@
 
 %{
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/image.h>
 %}
 
diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i
index 3c5fe21590..1e01336806 100644
--- a/wxPython/src/misc2.i
+++ b/wxPython/src/misc2.i
@@ -16,6 +16,7 @@
 
 %{
 #include "helpers.h"
+#include "pyistream.h"
 #include <wx/resource.h>
 #include <wx/tooltip.h>
 #include <wx/caret.h>