-/////////////////////////////////////////////////////////////////////////////
-//
-// $Log$
-// Revision 1.5 1998/12/15 20:41:17 RD
-// Changed the import semantics from "from wxPython import *" to "from
-// wxPython.wx import *" This is for people who are worried about
-// namespace pollution, they can use "from wxPython import wx" and then
-// prefix all the wxPython identifiers with "wx."
-//
-// Added wxTaskbarIcon for wxMSW.
-//
-// Made the events work for wxGrid.
-//
-// Added wxConfig.
-//
-// Added wxMiniFrame for wxGTK, (untested.)
-//
-// Changed many of the args and return values that were pointers to gdi
-// objects to references to reflect changes in the wxWindows API.
-//
-// Other assorted fixes and additions.
-//
-// Revision 1.4 1998/11/16 00:00:55 RD
-// Generic treectrl for wxPython/GTK compiles...
-//
-// Revision 1.3 1998/10/20 06:43:56 RD
-// New wxTreeCtrl wrappers (untested)
-// some changes in helpers
-// etc.
-//
-// Revision 1.2 1998/08/15 07:36:33 RD
-// - Moved the header in the .i files out of the code that gets put into
-// the .cpp files. It caused CVS conflicts because of the RCS ID being
-// different each time.
-//
-// - A few minor fixes.
-//
-// Revision 1.1 1998/08/09 08:25:50 RD
-// Initial version
-//
-//
+ void SetChangedWindow(wxWindow* win);
+ wxWindow* GetChangedWindow();
+
+};
+
+//---------------------------------------------------------------------------
+
+class wxQueryNewPaletteEvent : public wxEvent {
+public:
+ wxQueryNewPaletteEvent(wxWindowID id = 0);
+
+ void SetPaletteRealized(bool realized);
+ bool GetPaletteRealized();
+};
+
+
+//---------------------------------------------------------------------------
+
+class wxWindowCreateEvent : public wxEvent {
+public:
+ wxWindowCreateEvent(wxWindow *win = NULL);
+
+ wxWindow *GetWindow();
+};
+
+class wxWindowDestroyEvent : public wxEvent {
+public:
+ wxWindowDestroyEvent(wxWindow *win = NULL);
+
+ wxWindow *GetWindow();
+};
+
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+// This one can be derived from in Python and passed through the event
+// system without loosing anything so long as the Python data is saved with
+// SetPyData...
+
+%{
+class wxPyEvent : public wxEvent {
+ DECLARE_DYNAMIC_CLASS(wxPyEvent)
+public:
+ wxPyEvent(int id=0, PyObject* userData = Py_None)
+ : wxEvent(id) {
+ m_userData = userData;
+ Py_INCREF(m_userData);
+ }
+
+ ~wxPyEvent() {
+ bool doSave = wxPyRestoreThread();
+ Py_DECREF(m_userData);
+ wxPySaveThread(doSave);
+ }
+
+ void SetPyData(PyObject* userData) {
+ bool doSave = wxPyRestoreThread();
+ Py_DECREF(m_userData);
+ m_userData = userData;
+ Py_INCREF(m_userData);
+ wxPySaveThread(doSave);
+ }
+
+ PyObject* GetPyData() const {
+ Py_INCREF(m_userData);
+ return m_userData;
+ }
+
+ // This one is so the event object can be Cloned...
+ void CopyObject(wxObject& dest) const {
+ wxEvent::CopyObject(dest);
+ ((wxPyEvent*)&dest)->SetPyData(m_userData);
+ }
+
+private:
+ PyObject* m_userData;
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxPyEvent, wxEvent)
+
+%}
+
+
+class wxPyEvent : public wxEvent {
+public:
+ wxPyEvent(int id=0, PyObject* userData = Py_None);
+ ~wxPyEvent();
+
+ void SetPyData(PyObject* userData);
+ PyObject* GetPyData();
+};
+
+//---------------------------------------------------------------------------
+// Same for this one except it is a wxCommandEvent and so will get passed up the
+// containment heirarchy.
+
+%{
+class wxPyCommandEvent : public wxCommandEvent {
+ DECLARE_DYNAMIC_CLASS(wxPyCommandEvent)
+public:
+ wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0, PyObject* userData = Py_None)
+ : wxCommandEvent(commandType, id) {
+ m_userData = userData;
+ Py_INCREF(m_userData);
+ }
+
+ ~wxPyCommandEvent() {
+ bool doSave = wxPyRestoreThread();
+ Py_DECREF(m_userData);
+ wxPySaveThread(doSave);
+ }
+
+ void SetPyData(PyObject* userData) {
+ bool doSave = wxPyRestoreThread();
+ Py_DECREF(m_userData);
+ m_userData = userData;
+ Py_INCREF(m_userData);
+ wxPySaveThread(doSave);
+ }
+
+ PyObject* GetPyData() const {
+ Py_INCREF(m_userData);
+ return m_userData;
+ }
+
+ // This one is so the event object can be Cloned...
+ void CopyObject(wxObject& dest) const {
+ wxCommandEvent::CopyObject(dest);
+ ((wxPyCommandEvent*)&dest)->SetPyData(m_userData);
+ }
+
+private:
+ PyObject* m_userData;
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxPyCommandEvent, wxCommandEvent)
+
+%}
+
+
+class wxPyCommandEvent : public wxCommandEvent {
+public:
+ wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0, PyObject* userData = Py_None);
+ ~wxPyCommandEvent();
+
+ void SetPyData(PyObject* userData);
+ PyObject* GetPyData();
+};
+
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------