From 17c0e08c61c69b77e58b3e9ffc78d58fcf105940 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 26 Oct 2001 07:23:04 +0000 Subject: [PATCH] fixes for the wxPre* helpers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/calendar.i | 2 +- wxPython/src/cmndlgs.i | 2 +- wxPython/src/controls.i | 42 ++--- wxPython/src/controls2.i | 6 +- wxPython/src/frames.i | 8 +- wxPython/src/gdi.i | 33 +++- wxPython/src/gtk/calendar.py | 2 +- wxPython/src/gtk/clip_dnd.cpp | 133 +++++++++++++++ wxPython/src/gtk/clip_dnd.py | 21 +++ wxPython/src/gtk/cmndlgs.py | 2 +- wxPython/src/gtk/controls.py | 42 ++--- wxPython/src/gtk/controls2.py | 6 +- wxPython/src/gtk/frames.py | 7 +- wxPython/src/gtk/gdi.cpp | 1 - wxPython/src/gtk/mdi.py | 6 +- wxPython/src/gtk/sizers.cpp | 36 ++++ wxPython/src/gtk/sizers.py | 9 + wxPython/src/gtk/stattool.py | 6 +- wxPython/src/gtk/windows.py | 4 +- wxPython/src/gtk/windows2.py | 4 +- wxPython/src/gtk/windows3.py | 8 +- wxPython/src/mdi.i | 6 +- wxPython/src/msw/calendar.py | 2 +- wxPython/src/msw/cmndlgs.py | 2 +- wxPython/src/msw/controls.py | 42 ++--- wxPython/src/msw/controls2.py | 6 +- wxPython/src/msw/frames.py | 7 +- wxPython/src/msw/gdi.cpp | 309 +++++++++++++++++++++++++++++++++- wxPython/src/msw/gdi.py | 37 ++++ wxPython/src/msw/mdi.py | 6 +- wxPython/src/msw/stattool.py | 6 +- wxPython/src/msw/windows.py | 4 +- wxPython/src/msw/windows2.py | 4 +- wxPython/src/msw/windows3.py | 8 +- wxPython/src/stattool.i | 6 +- wxPython/src/windows.i | 4 +- wxPython/src/windows2.i | 4 +- wxPython/src/windows3.i | 8 +- 38 files changed, 702 insertions(+), 139 deletions(-) diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index 38dee465fe..586587a80e 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -168,7 +168,7 @@ public: const char* name = "calendar"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreCalendarCtrl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreCalendarCtrl:val._setOORInfo(val)" // set/get the current date // ------------------------ diff --git a/wxPython/src/cmndlgs.i b/wxPython/src/cmndlgs.i index 8b4252a4ed..a10349f9cb 100644 --- a/wxPython/src/cmndlgs.i +++ b/wxPython/src/cmndlgs.i @@ -354,7 +354,7 @@ public: int style = 0); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)" const wxFindReplaceData *GetData(); void SetData(wxFindReplaceData *data); diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index 66487ecaa8..91903f9f66 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -75,7 +75,7 @@ public: const char* name="control"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)" void Command(wxCommandEvent& event); wxString GetLabel(); @@ -154,7 +154,7 @@ public: char* name = "button"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)" void SetDefault(); void SetBackgroundColour(const wxColour& colour); @@ -186,7 +186,7 @@ public: char* name = "button"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)" wxBitmap& GetBitmapLabel(); wxBitmap& GetBitmapDisabled(); @@ -222,7 +222,7 @@ public: char* name = "checkBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)" bool GetValue(); void SetValue(const bool state); @@ -250,7 +250,7 @@ public: char* name = "choice"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)" void Clear(); @@ -287,7 +287,7 @@ public: char* name = "comboBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)" void Copy(); void Cut(); @@ -325,7 +325,7 @@ public: char* name = "gauge"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)" int GetBezelFace(); int GetRange(); @@ -355,7 +355,7 @@ public: char* name = "staticBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)" }; @@ -378,7 +378,7 @@ public: const char* name = "staticLine" ); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)" }; @@ -400,7 +400,7 @@ public: char* name = "staticText"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)" wxString GetLabel(); void SetLabel(const wxString& label); @@ -428,7 +428,7 @@ public: char* name = "listBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)" void Clear(); void Deselect(int n); @@ -484,7 +484,7 @@ public: char* name = "listBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)" bool IsChecked(int uiIndex); void Check(int uiIndex, int bCheck = TRUE); @@ -540,7 +540,7 @@ public: char* name = "text"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)" void Clear(); void Copy(); @@ -612,7 +612,7 @@ public: char* name = "scrollBar"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)" int GetRange(); int GetPageSize(); @@ -643,7 +643,7 @@ public: char* name = "spinButton"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)" int GetMax(); int GetMin(); @@ -672,7 +672,7 @@ public: char* name = "staticBitmap"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)" const wxBitmap& GetBitmap(); void SetBitmap(const wxBitmap& bitmap); @@ -705,7 +705,7 @@ public: char* name = "radioBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)" void Enable(bool enable); %name(EnableItem)void Enable(int n, bool enable); @@ -759,7 +759,7 @@ public: char* name = "radioButton"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)" bool GetValue(); void SetValue(bool value); @@ -787,7 +787,7 @@ public: char* name = "slider"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)" void ClearSel(); void ClearTicks(); @@ -835,7 +835,7 @@ public: const char* name = "wxSpinCtrl"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)" int GetMax(); int GetMin(); @@ -872,7 +872,7 @@ public: const char* name = "toggle"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)" void SetValue(bool value); bool GetValue() const ; diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index d0b3ae8bea..9ace925b79 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -414,7 +414,7 @@ public: %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxListCtrl)" %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreListCtrl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreListCtrl:val._setOORInfo(val)" // Set the control colours bool SetForegroundColour(const wxColour& col); @@ -734,7 +734,7 @@ public: const wxString &name = "listctrl" ); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreListView:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreListView:val._setOORInfo(val)" // [de]select an item void Select(long n, bool on = TRUE); @@ -1064,7 +1064,7 @@ public: %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxTreeCtrl)" %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreTreeCtrl:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreTreeCtrl:val._setOORInfo(val)" size_t GetCount(); unsigned int GetIndent(); diff --git a/wxPython/src/frames.i b/wxPython/src/frames.i index d0fd4866b1..b100fc2501 100644 --- a/wxPython/src/frames.i +++ b/wxPython/src/frames.i @@ -72,7 +72,7 @@ public: const char* name = "frame"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreTopLevelWindowXXX:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)" // maximize = TRUE => maximize, otherwise - restore virtual void Maximize(bool maximize = TRUE); @@ -125,7 +125,7 @@ public: char* name = "frame"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" wxPoint GetClientAreaOrigin(); @@ -189,7 +189,7 @@ public: const char* name = "dialogBox"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" void Centre(int direction = wxBOTH); void EndModal(int retCode); @@ -224,7 +224,7 @@ public: char* name = "frame"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" }; diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index dae285e482..1e053ba4ea 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -15,7 +15,6 @@ %{ #include "helpers.h" -#include #include #ifndef __WXMSW__ #include @@ -830,7 +829,7 @@ public: %addmethods { // NOTE: These methods are VERY SIMILAR in implentation. It would be - // nice to factor out code and or turn them into a set of + // nice to factor out common code and or turn them into a set of // template-like macros. // Draw a point for every set of coordinants in pyPoints, optionally @@ -1076,11 +1075,39 @@ public: #ifdef __WXMSW__ + +%{ +#include +%} + +class wxMetaFile : public wxObject { +public: + wxMetaFile(const wxString& filename = wxPyEmptyStr); + ~wxMetaFile(); + + bool Ok(); + bool SetClipboard(int width = 0, int height = 0); + + wxSize GetSize(); + int GetWidth(); + int GetHeight(); + + const wxString& GetFileName() const { return m_filename; } + +}; + +// bool wxMakeMetaFilePlaceable(const wxString& filename, +// int minX, int minY, int maxX, int maxY, float scale=1.0); + + class wxMetaFileDC : public wxDC { public: - wxMetaFileDC(const wxString& filename = wxPyEmptyStr); + wxMetaFileDC(const wxString& filename = wxPyEmptyStr, + int width = 0, int height = 0, + const wxString& description = wxPyEmptyStr); wxMetaFile* Close(); }; + #endif //--------------------------------------------------------------------------- diff --git a/wxPython/src/gtk/calendar.py b/wxPython/src/gtk/calendar.py index 2eb6ec364a..411013dc6b 100644 --- a/wxPython/src/gtk/calendar.py +++ b/wxPython/src/gtk/calendar.py @@ -215,7 +215,7 @@ class wxCalendarCtrl(wxCalendarCtrlPtr): def wxPreCalendarCtrl(*_args,**_kwargs): val = wxCalendarCtrlPtr(apply(calendarc.new_wxPreCalendarCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/clip_dnd.cpp b/wxPython/src/gtk/clip_dnd.cpp index 0ca77005a4..7a7dad4435 100644 --- a/wxPython/src/gtk/clip_dnd.cpp +++ b/wxPython/src/gtk/clip_dnd.cpp @@ -1931,6 +1931,133 @@ static PyObject *_wrap_wxCustomDataObject_GetData(PyObject *self, PyObject *args return _resultobj; } +static void *SwigwxURLDataObjectTowxDataObjectComposite(void *ptr) { + wxURLDataObject *src; + wxDataObjectComposite *dest; + src = (wxURLDataObject *) ptr; + dest = (wxDataObjectComposite *) src; + return (void *) dest; +} + +static void *SwigwxURLDataObjectTowxDataObject(void *ptr) { + wxURLDataObject *src; + wxDataObject *dest; + src = (wxURLDataObject *) ptr; + dest = (wxDataObject *) src; + return (void *) dest; +} + +#define new_wxURLDataObject() (new wxURLDataObject()) +static PyObject *_wrap_new_wxURLDataObject(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxURLDataObject * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxURLDataObject",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxURLDataObject *)new_wxURLDataObject(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxURLDataObject_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxURLDataObject_GetURL(_swigobj) (_swigobj->GetURL()) +static PyObject *_wrap_wxURLDataObject_GetURL(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxURLDataObject * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxURLDataObject_GetURL",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxURLDataObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxURLDataObject_GetURL. Expected _wxURLDataObject_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxURLDataObject_GetURL(_arg0)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + +#define wxURLDataObject_SetURL(_swigobj,_swigarg0) (_swigobj->SetURL(_swigarg0)) +static PyObject *_wrap_wxURLDataObject_SetURL(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxURLDataObject * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","url", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxURLDataObject_SetURL",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxURLDataObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxURLDataObject_SetURL. Expected _wxURLDataObject_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxURLDataObject_SetURL(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + static void *SwigwxClipboardTowxObject(void *ptr) { wxClipboard *src; wxObject *dest; @@ -3396,6 +3523,9 @@ static PyMethodDef clip_dndcMethods[] = { { "wxClipboard_Close", (PyCFunction) _wrap_wxClipboard_Close, METH_VARARGS | METH_KEYWORDS }, { "wxClipboard_Open", (PyCFunction) _wrap_wxClipboard_Open, METH_VARARGS | METH_KEYWORDS }, { "new_wxClipboard", (PyCFunction) _wrap_new_wxClipboard, METH_VARARGS | METH_KEYWORDS }, + { "wxURLDataObject_SetURL", (PyCFunction) _wrap_wxURLDataObject_SetURL, METH_VARARGS | METH_KEYWORDS }, + { "wxURLDataObject_GetURL", (PyCFunction) _wrap_wxURLDataObject_GetURL, METH_VARARGS | METH_KEYWORDS }, + { "new_wxURLDataObject", (PyCFunction) _wrap_new_wxURLDataObject, METH_VARARGS | METH_KEYWORDS }, { "wxCustomDataObject_GetData", (PyCFunction) _wrap_wxCustomDataObject_GetData, METH_VARARGS | METH_KEYWORDS }, { "wxCustomDataObject_GetSize", (PyCFunction) _wrap_wxCustomDataObject_GetSize, METH_VARARGS | METH_KEYWORDS }, { "wxCustomDataObject_SetData", (PyCFunction) _wrap_wxCustomDataObject_SetData, METH_VARARGS | METH_KEYWORDS }, @@ -3458,6 +3588,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_size_t",0}, { "_wxPrintQuality","_time_t",0}, { "_byte","_unsigned_char",0}, + { "_wxDataObject","_wxURLDataObject",SwigwxURLDataObjectTowxDataObject}, { "_wxDataObject","_wxCustomDataObject",SwigwxCustomDataObjectTowxDataObject}, { "_wxDataObject","_wxFileDataObject",SwigwxFileDataObjectTowxDataObject}, { "_wxDataObject","_wxPyBitmapDataObject",SwigwxPyBitmapDataObjectTowxDataObject}, @@ -3562,6 +3693,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCoord","_size_t",0}, { "_wxCoord","_time_t",0}, { "_wxCoord","_wxPrintQuality",0}, + { "_wxDataObjectComposite","_wxURLDataObject",SwigwxURLDataObjectTowxDataObjectComposite}, { "_wxPyDropTarget","_wxPyFileDropTarget",SwigwxPyFileDropTargetTowxPyDropTarget}, { "_wxPyDropTarget","_wxPyTextDropTarget",SwigwxPyTextDropTargetTowxPyDropTarget}, {0,0,0}}; @@ -3601,6 +3733,7 @@ SWIGEXPORT(void) initclip_dndc() { PyDict_SetItemString(d,"wxDragNone", PyInt_FromLong((long) wxDragNone)); PyDict_SetItemString(d,"wxDragCopy", PyInt_FromLong((long) wxDragCopy)); PyDict_SetItemString(d,"wxDragMove", PyInt_FromLong((long) wxDragMove)); + PyDict_SetItemString(d,"wxDragLink", PyInt_FromLong((long) wxDragLink)); PyDict_SetItemString(d,"wxDragCancel", PyInt_FromLong((long) wxDragCancel)); diff --git a/wxPython/src/gtk/clip_dnd.py b/wxPython/src/gtk/clip_dnd.py index 66d138741f..f3a8000e85 100644 --- a/wxPython/src/gtk/clip_dnd.py +++ b/wxPython/src/gtk/clip_dnd.py @@ -255,6 +255,26 @@ class wxCustomDataObject(wxCustomDataObjectPtr): +class wxURLDataObjectPtr(wxDataObjectCompositePtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetURL(self, *_args, **_kwargs): + val = apply(clip_dndc.wxURLDataObject_GetURL,(self,) + _args, _kwargs) + return val + def SetURL(self, *_args, **_kwargs): + val = apply(clip_dndc.wxURLDataObject_SetURL,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxURLDataObject(wxURLDataObjectPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(clip_dndc.new_wxURLDataObject,_args,_kwargs) + self.thisown = 1 + + + + class wxClipboardPtr(wxObjectPtr): def __init__(self,this): self.this = this @@ -503,4 +523,5 @@ wxDragError = clip_dndc.wxDragError wxDragNone = clip_dndc.wxDragNone wxDragCopy = clip_dndc.wxDragCopy wxDragMove = clip_dndc.wxDragMove +wxDragLink = clip_dndc.wxDragLink wxDragCancel = clip_dndc.wxDragCancel diff --git a/wxPython/src/gtk/cmndlgs.py b/wxPython/src/gtk/cmndlgs.py index b5ef576255..45912c3c49 100644 --- a/wxPython/src/gtk/cmndlgs.py +++ b/wxPython/src/gtk/cmndlgs.py @@ -462,7 +462,7 @@ class wxFindReplaceDialog(wxFindReplaceDialogPtr): def wxPreFindReplaceDialog(*_args,**_kwargs): val = wxFindReplaceDialogPtr(apply(cmndlgsc.new_wxPreFindReplaceDialog,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 645e86913e..9220206e99 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -40,7 +40,7 @@ class wxControl(wxControlPtr): def wxPreControl(*_args,**_kwargs): val = wxControlPtr(apply(controlsc.new_wxPreControl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -120,7 +120,7 @@ class wxButton(wxButtonPtr): def wxPreButton(*_args,**_kwargs): val = wxButtonPtr(apply(controlsc.new_wxPreButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -181,7 +181,7 @@ class wxBitmapButton(wxBitmapButtonPtr): def wxPreBitmapButton(*_args,**_kwargs): val = wxBitmapButtonPtr(apply(controlsc.new_wxPreBitmapButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -211,7 +211,7 @@ class wxCheckBox(wxCheckBoxPtr): def wxPreCheckBox(*_args,**_kwargs): val = wxCheckBoxPtr(apply(controlsc.new_wxPreCheckBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -256,7 +256,7 @@ class wxChoice(wxChoicePtr): def wxPreChoice(*_args,**_kwargs): val = wxChoicePtr(apply(controlsc.new_wxPreChoice,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -322,7 +322,7 @@ class wxComboBox(wxComboBoxPtr): def wxPreComboBox(*_args,**_kwargs): val = wxComboBoxPtr(apply(controlsc.new_wxPreComboBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -370,7 +370,7 @@ class wxGauge(wxGaugePtr): def wxPreGauge(*_args,**_kwargs): val = wxGaugePtr(apply(controlsc.new_wxPreGauge,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -394,7 +394,7 @@ class wxStaticBox(wxStaticBoxPtr): def wxPreStaticBox(*_args,**_kwargs): val = wxStaticBoxPtr(apply(controlsc.new_wxPreStaticBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -418,7 +418,7 @@ class wxStaticLine(wxStaticLinePtr): def wxPreStaticLine(*_args,**_kwargs): val = wxStaticLinePtr(apply(controlsc.new_wxPreStaticLine,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -448,7 +448,7 @@ class wxStaticText(wxStaticTextPtr): def wxPreStaticText(*_args,**_kwargs): val = wxStaticTextPtr(apply(controlsc.new_wxPreStaticText,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -508,7 +508,7 @@ class wxListBox(wxListBoxPtr): def wxPreListBox(*_args,**_kwargs): val = wxListBoxPtr(apply(controlsc.new_wxPreListBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -544,7 +544,7 @@ class wxCheckListBox(wxCheckListBoxPtr): def wxPreCheckListBox(*_args,**_kwargs): val = wxCheckListBoxPtr(apply(controlsc.new_wxPreCheckListBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -736,7 +736,7 @@ class wxTextCtrl(wxTextCtrlPtr): def wxPreTextCtrl(*_args,**_kwargs): val = wxTextCtrlPtr(apply(controlsc.new_wxPreTextCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -781,7 +781,7 @@ class wxScrollBar(wxScrollBarPtr): def wxPreScrollBar(*_args,**_kwargs): val = wxScrollBarPtr(apply(controlsc.new_wxPreScrollBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -820,7 +820,7 @@ class wxSpinButton(wxSpinButtonPtr): def wxPreSpinButton(*_args,**_kwargs): val = wxSpinButtonPtr(apply(controlsc.new_wxPreSpinButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -854,7 +854,7 @@ class wxStaticBitmap(wxStaticBitmapPtr): def wxPreStaticBitmap(*_args,**_kwargs): val = wxStaticBitmapPtr(apply(controlsc.new_wxPreStaticBitmap,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -918,7 +918,7 @@ class wxRadioBox(wxRadioBoxPtr): def wxPreRadioBox(*_args,**_kwargs): val = wxRadioBoxPtr(apply(controlsc.new_wxPreRadioBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -948,7 +948,7 @@ class wxRadioButton(wxRadioButtonPtr): def wxPreRadioButton(*_args,**_kwargs): val = wxRadioButtonPtr(apply(controlsc.new_wxPreRadioButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1029,7 +1029,7 @@ class wxSlider(wxSliderPtr): def wxPreSlider(*_args,**_kwargs): val = wxSliderPtr(apply(controlsc.new_wxPreSlider,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1068,7 +1068,7 @@ class wxSpinCtrl(wxSpinCtrlPtr): def wxPreSpinCtrl(*_args,**_kwargs): val = wxSpinCtrlPtr(apply(controlsc.new_wxPreSpinCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1101,7 +1101,7 @@ class wxToggleButton(wxToggleButtonPtr): def wxPreToggleButton(*_args,**_kwargs): val = wxToggleButtonPtr(apply(controlsc.new_wxPreToggleButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/controls2.py b/wxPython/src/gtk/controls2.py index 88862bbc05..7b8c5eae19 100644 --- a/wxPython/src/gtk/controls2.py +++ b/wxPython/src/gtk/controls2.py @@ -671,7 +671,7 @@ class wxListCtrl(wxListCtrlPtr): def wxPreListCtrl(*_args,**_kwargs): val = wxListCtrlPtr(apply(controls2c.new_wxPreListCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -719,7 +719,7 @@ class wxListView(wxListViewPtr): def wxPreListView(*_args,**_kwargs): val = wxListViewPtr(apply(controls2c.new_wxPreListView,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1104,7 +1104,7 @@ class wxTreeCtrl(wxTreeCtrlPtr): def wxPreTreeCtrl(*_args,**_kwargs): val = wxTreeCtrlPtr(apply(controls2c.new_wxPreTreeCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/frames.py b/wxPython/src/gtk/frames.py index c662bef744..f3d8317ae1 100644 --- a/wxPython/src/gtk/frames.py +++ b/wxPython/src/gtk/frames.py @@ -69,6 +69,7 @@ class wxTopLevelWindow(wxTopLevelWindowPtr): def wxPreTopLevelWindow(*_args,**_kwargs): val = wxTopLevelWindowPtr(apply(framesc.new_wxPreTopLevelWindow,_args,_kwargs)) val.thisown = 1 + val._setOORInfo(val) return val @@ -132,7 +133,7 @@ class wxFrame(wxFramePtr): def wxPreFrame(*_args,**_kwargs): val = wxFramePtr(apply(framesc.new_wxPreFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -183,7 +184,7 @@ class wxDialog(wxDialogPtr): def wxPreDialog(*_args,**_kwargs): val = wxDialogPtr(apply(framesc.new_wxPreDialog,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -207,7 +208,7 @@ class wxMiniFrame(wxMiniFramePtr): def wxPreMiniFrame(*_args,**_kwargs): val = wxMiniFramePtr(apply(framesc.new_wxPreMiniFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/gdi.cpp b/wxPython/src/gtk/gdi.cpp index 74e72d8e84..01d47f16fc 100644 --- a/wxPython/src/gtk/gdi.cpp +++ b/wxPython/src/gtk/gdi.cpp @@ -56,7 +56,6 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "gdic" #include "helpers.h" -#include #include #ifndef __WXMSW__ #include diff --git a/wxPython/src/gtk/mdi.py b/wxPython/src/gtk/mdi.py index d61ed1a618..15ae5c30fb 100644 --- a/wxPython/src/gtk/mdi.py +++ b/wxPython/src/gtk/mdi.py @@ -61,7 +61,7 @@ class wxMDIParentFrame(wxMDIParentFramePtr): def wxPreMDIParentFrame(*_args,**_kwargs): val = wxMDIParentFramePtr(apply(mdic.new_wxPreMDIParentFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -94,7 +94,7 @@ class wxMDIChildFrame(wxMDIChildFramePtr): def wxPreMDIChildFrame(*_args,**_kwargs): val = wxMDIChildFramePtr(apply(mdic.new_wxPreMDIChildFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -118,7 +118,7 @@ class wxMDIClientWindow(wxMDIClientWindowPtr): def wxPreMDIClientWindow(*_args,**_kwargs): val = wxMDIClientWindowPtr(apply(mdic.new_wxPreMDIClientWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/sizers.cpp b/wxPython/src/gtk/sizers.cpp index a28dec6250..e4826be5d8 100644 --- a/wxPython/src/gtk/sizers.cpp +++ b/wxPython/src/gtk/sizers.cpp @@ -837,6 +837,41 @@ static void *SwigwxSizerTowxObject(void *ptr) { return (void *) dest; } +static void wxSizer__setOORInfo(wxSizer *self,PyObject * _self) { + self->SetClientObject(new wxPyClientData(_self)); + } +static PyObject *_wrap_wxSizer__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSizer * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxSizer__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSizer_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSizer__setOORInfo. Expected _wxSizer_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxSizer__setOORInfo(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void wxSizer_Destroy(wxSizer *self) { delete self; } static PyObject *_wrap_wxSizer_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2912,6 +2947,7 @@ static PyMethodDef sizerscMethods[] = { { "wxSizer_AddSizer", (PyCFunction) _wrap_wxSizer_AddSizer, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_AddWindow", (PyCFunction) _wrap_wxSizer_AddWindow, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_Destroy", (PyCFunction) _wrap_wxSizer_Destroy, METH_VARARGS | METH_KEYWORDS }, + { "wxSizer__setOORInfo", (PyCFunction) _wrap_wxSizer__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "wxSizerItem_GetUserData", (PyCFunction) _wrap_wxSizerItem_GetUserData, METH_VARARGS | METH_KEYWORDS }, { "wxSizerItem_SetBorder", (PyCFunction) _wrap_wxSizerItem_SetBorder, METH_VARARGS | METH_KEYWORDS }, { "wxSizerItem_SetFlag", (PyCFunction) _wrap_wxSizerItem_SetFlag, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/sizers.py b/wxPython/src/gtk/sizers.py index e0105a3495..2eaac713ff 100644 --- a/wxPython/src/gtk/sizers.py +++ b/wxPython/src/gtk/sizers.py @@ -103,6 +103,9 @@ class wxSizerPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(sizersc.wxSizer__setOORInfo,(self,) + _args, _kwargs) + return val def Destroy(self, *_args, **_kwargs): val = apply(sizersc.wxSizer_Destroy,(self,) + _args, _kwargs) return val @@ -252,6 +255,7 @@ class wxPySizer(wxPySizerPtr): self.this = apply(sizersc.new_wxPySizer,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPySizer) + self._setOORInfo(self) @@ -276,6 +280,7 @@ class wxBoxSizer(wxBoxSizerPtr): def __init__(self,*_args,**_kwargs): self.this = apply(sizersc.new_wxBoxSizer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -300,6 +305,7 @@ class wxStaticBoxSizer(wxStaticBoxSizerPtr): def __init__(self,*_args,**_kwargs): self.this = apply(sizersc.new_wxStaticBoxSizer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -324,6 +330,7 @@ class wxNotebookSizer(wxNotebookSizerPtr): def __init__(self,*_args,**_kwargs): self.this = apply(sizersc.new_wxNotebookSizer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -369,6 +376,7 @@ class wxGridSizer(wxGridSizerPtr): def __init__(self,*_args,**_kwargs): self.this = apply(sizersc.new_wxGridSizer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -402,6 +410,7 @@ class wxFlexGridSizer(wxFlexGridSizerPtr): def __init__(self,*_args,**_kwargs): self.this = apply(sizersc.new_wxFlexGridSizer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) diff --git a/wxPython/src/gtk/stattool.py b/wxPython/src/gtk/stattool.py index b16541246c..72b3d89da0 100644 --- a/wxPython/src/gtk/stattool.py +++ b/wxPython/src/gtk/stattool.py @@ -61,7 +61,7 @@ class wxStatusBar(wxStatusBarPtr): def wxPreStatusBar(*_args,**_kwargs): val = wxStatusBarPtr(apply(stattoolc.new_wxPreStatusBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -319,7 +319,7 @@ class wxToolBar(wxToolBarPtr): def wxPreToolBar(*_args,**_kwargs): val = wxToolBarPtr(apply(stattoolc.new_wxPreToolBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -346,7 +346,7 @@ class wxToolBarSimple(wxToolBarSimplePtr): def wxPreToolBarSimple(*_args,**_kwargs): val = wxToolBarSimplePtr(apply(stattoolc.new_wxPreToolBarSimple,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py index 595ac63fe1..1193917ff2 100644 --- a/wxPython/src/gtk/windows.py +++ b/wxPython/src/gtk/windows.py @@ -573,7 +573,7 @@ class wxWindow(wxWindowPtr): def wxPreWindow(*_args,**_kwargs): val = wxWindowPtr(apply(windowsc.new_wxPreWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -684,7 +684,7 @@ class wxScrolledWindow(wxScrolledWindowPtr): def wxPreScrolledWindow(*_args,**_kwargs): val = wxScrolledWindowPtr(apply(windowsc.new_wxPreScrolledWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/windows2.py b/wxPython/src/gtk/windows2.py index 769264ac64..f296814c80 100644 --- a/wxPython/src/gtk/windows2.py +++ b/wxPython/src/gtk/windows2.py @@ -123,7 +123,7 @@ class wxNotebook(wxNotebookPtr): def wxPreNotebook(*_args,**_kwargs): val = wxNotebookPtr(apply(windows2c.new_wxPreNotebook,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -230,7 +230,7 @@ class wxSplitterWindow(wxSplitterWindowPtr): def wxPreSplitterWindow(*_args,**_kwargs): val = wxSplitterWindowPtr(apply(windows2c.new_wxPreSplitterWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/gtk/windows3.py b/wxPython/src/gtk/windows3.py index 9674a3cb2e..1c9ef110f6 100644 --- a/wxPython/src/gtk/windows3.py +++ b/wxPython/src/gtk/windows3.py @@ -125,7 +125,7 @@ class wxSashWindow(wxSashWindowPtr): def wxPreSashWindow(*_args,**_kwargs): val = wxSashWindowPtr(apply(windows3c.new_wxPreSashWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -236,7 +236,7 @@ class wxSashLayoutWindow(wxSashLayoutWindowPtr): def wxPreSashLayoutWindow(*_args,**_kwargs): val = wxSashLayoutWindowPtr(apply(windows3c.new_wxPreSashLayoutWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -289,7 +289,7 @@ class wxPopupWindow(wxPopupWindowPtr): def wxPrePopupWindow(*_args,**_kwargs): val = wxPopupWindowPtr(apply(windows3c.new_wxPrePopupWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -320,7 +320,7 @@ class wxPopupTransientWindow(wxPopupTransientWindowPtr): def wxPrePopupTransientWindow(*_args,**_kwargs): val = wxPopupTransientWindowPtr(apply(windows3c.new_wxPrePopupTransientWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/mdi.i b/wxPython/src/mdi.i index 36041b4538..5c9d7a3b31 100644 --- a/wxPython/src/mdi.i +++ b/wxPython/src/mdi.i @@ -52,7 +52,7 @@ public: const char* name = "frame"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreMDIParentFrame:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreMDIParentFrame:val._setOORInfo(val)" void ActivateNext(); void ActivatePrevious(); @@ -96,7 +96,7 @@ public: const char* name = "frame"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreMDIChildFrame:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreMDIChildFrame:val._setOORInfo(val)" void Activate(); void Maximize(bool maximize); @@ -115,7 +115,7 @@ public: bool Create(wxMDIParentFrame* parent, long style = 0); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreMDIClientWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreMDIClientWindow:val._setOORInfo(val)" }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/msw/calendar.py b/wxPython/src/msw/calendar.py index 2eb6ec364a..411013dc6b 100644 --- a/wxPython/src/msw/calendar.py +++ b/wxPython/src/msw/calendar.py @@ -215,7 +215,7 @@ class wxCalendarCtrl(wxCalendarCtrlPtr): def wxPreCalendarCtrl(*_args,**_kwargs): val = wxCalendarCtrlPtr(apply(calendarc.new_wxPreCalendarCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/cmndlgs.py b/wxPython/src/msw/cmndlgs.py index b5ef576255..45912c3c49 100644 --- a/wxPython/src/msw/cmndlgs.py +++ b/wxPython/src/msw/cmndlgs.py @@ -462,7 +462,7 @@ class wxFindReplaceDialog(wxFindReplaceDialogPtr): def wxPreFindReplaceDialog(*_args,**_kwargs): val = wxFindReplaceDialogPtr(apply(cmndlgsc.new_wxPreFindReplaceDialog,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 554f43fbc7..153ebc99a2 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -40,7 +40,7 @@ class wxControl(wxControlPtr): def wxPreControl(*_args,**_kwargs): val = wxControlPtr(apply(controlsc.new_wxPreControl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -126,7 +126,7 @@ class wxButton(wxButtonPtr): def wxPreButton(*_args,**_kwargs): val = wxButtonPtr(apply(controlsc.new_wxPreButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -187,7 +187,7 @@ class wxBitmapButton(wxBitmapButtonPtr): def wxPreBitmapButton(*_args,**_kwargs): val = wxBitmapButtonPtr(apply(controlsc.new_wxPreBitmapButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -217,7 +217,7 @@ class wxCheckBox(wxCheckBoxPtr): def wxPreCheckBox(*_args,**_kwargs): val = wxCheckBoxPtr(apply(controlsc.new_wxPreCheckBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -262,7 +262,7 @@ class wxChoice(wxChoicePtr): def wxPreChoice(*_args,**_kwargs): val = wxChoicePtr(apply(controlsc.new_wxPreChoice,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -328,7 +328,7 @@ class wxComboBox(wxComboBoxPtr): def wxPreComboBox(*_args,**_kwargs): val = wxComboBoxPtr(apply(controlsc.new_wxPreComboBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -376,7 +376,7 @@ class wxGauge(wxGaugePtr): def wxPreGauge(*_args,**_kwargs): val = wxGaugePtr(apply(controlsc.new_wxPreGauge,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -400,7 +400,7 @@ class wxStaticBox(wxStaticBoxPtr): def wxPreStaticBox(*_args,**_kwargs): val = wxStaticBoxPtr(apply(controlsc.new_wxPreStaticBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -424,7 +424,7 @@ class wxStaticLine(wxStaticLinePtr): def wxPreStaticLine(*_args,**_kwargs): val = wxStaticLinePtr(apply(controlsc.new_wxPreStaticLine,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -454,7 +454,7 @@ class wxStaticText(wxStaticTextPtr): def wxPreStaticText(*_args,**_kwargs): val = wxStaticTextPtr(apply(controlsc.new_wxPreStaticText,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -514,7 +514,7 @@ class wxListBox(wxListBoxPtr): def wxPreListBox(*_args,**_kwargs): val = wxListBoxPtr(apply(controlsc.new_wxPreListBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -550,7 +550,7 @@ class wxCheckListBox(wxCheckListBoxPtr): def wxPreCheckListBox(*_args,**_kwargs): val = wxCheckListBoxPtr(apply(controlsc.new_wxPreCheckListBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -742,7 +742,7 @@ class wxTextCtrl(wxTextCtrlPtr): def wxPreTextCtrl(*_args,**_kwargs): val = wxTextCtrlPtr(apply(controlsc.new_wxPreTextCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -787,7 +787,7 @@ class wxScrollBar(wxScrollBarPtr): def wxPreScrollBar(*_args,**_kwargs): val = wxScrollBarPtr(apply(controlsc.new_wxPreScrollBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -826,7 +826,7 @@ class wxSpinButton(wxSpinButtonPtr): def wxPreSpinButton(*_args,**_kwargs): val = wxSpinButtonPtr(apply(controlsc.new_wxPreSpinButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -860,7 +860,7 @@ class wxStaticBitmap(wxStaticBitmapPtr): def wxPreStaticBitmap(*_args,**_kwargs): val = wxStaticBitmapPtr(apply(controlsc.new_wxPreStaticBitmap,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -931,7 +931,7 @@ class wxRadioBox(wxRadioBoxPtr): def wxPreRadioBox(*_args,**_kwargs): val = wxRadioBoxPtr(apply(controlsc.new_wxPreRadioBox,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -961,7 +961,7 @@ class wxRadioButton(wxRadioButtonPtr): def wxPreRadioButton(*_args,**_kwargs): val = wxRadioButtonPtr(apply(controlsc.new_wxPreRadioButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1042,7 +1042,7 @@ class wxSlider(wxSliderPtr): def wxPreSlider(*_args,**_kwargs): val = wxSliderPtr(apply(controlsc.new_wxPreSlider,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1081,7 +1081,7 @@ class wxSpinCtrl(wxSpinCtrlPtr): def wxPreSpinCtrl(*_args,**_kwargs): val = wxSpinCtrlPtr(apply(controlsc.new_wxPreSpinCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1114,7 +1114,7 @@ class wxToggleButton(wxToggleButtonPtr): def wxPreToggleButton(*_args,**_kwargs): val = wxToggleButtonPtr(apply(controlsc.new_wxPreToggleButton,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index d60978689e..b56017fbd4 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -680,7 +680,7 @@ class wxListCtrl(wxListCtrlPtr): def wxPreListCtrl(*_args,**_kwargs): val = wxListCtrlPtr(apply(controls2c.new_wxPreListCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -728,7 +728,7 @@ class wxListView(wxListViewPtr): def wxPreListView(*_args,**_kwargs): val = wxListViewPtr(apply(controls2c.new_wxPreListView,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -1125,7 +1125,7 @@ class wxTreeCtrl(wxTreeCtrlPtr): def wxPreTreeCtrl(*_args,**_kwargs): val = wxTreeCtrlPtr(apply(controls2c.new_wxPreTreeCtrl,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/frames.py b/wxPython/src/msw/frames.py index c662bef744..f3d8317ae1 100644 --- a/wxPython/src/msw/frames.py +++ b/wxPython/src/msw/frames.py @@ -69,6 +69,7 @@ class wxTopLevelWindow(wxTopLevelWindowPtr): def wxPreTopLevelWindow(*_args,**_kwargs): val = wxTopLevelWindowPtr(apply(framesc.new_wxPreTopLevelWindow,_args,_kwargs)) val.thisown = 1 + val._setOORInfo(val) return val @@ -132,7 +133,7 @@ class wxFrame(wxFramePtr): def wxPreFrame(*_args,**_kwargs): val = wxFramePtr(apply(framesc.new_wxPreFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -183,7 +184,7 @@ class wxDialog(wxDialogPtr): def wxPreDialog(*_args,**_kwargs): val = wxDialogPtr(apply(framesc.new_wxPreDialog,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -207,7 +208,7 @@ class wxMiniFrame(wxMiniFramePtr): def wxPreMiniFrame(*_args,**_kwargs): val = wxMiniFramePtr(apply(framesc.new_wxPreMiniFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 57e36348d2..094fb2fc14 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -56,7 +56,6 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "gdic" #include "helpers.h" -#include #include #ifndef __WXMSW__ #include @@ -219,6 +218,8 @@ static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) { return new wxMemoryDC(oldDC); } +#include + #if 0 extern wxFont * wxNORMAL_FONT; extern wxFont * wxSMALL_FONT; @@ -10044,6 +10045,268 @@ static PyObject *_wrap_new_wxWindowDC(PyObject *self, PyObject *args, PyObject * return _resultobj; } +static void *SwigwxMetaFileTowxObject(void *ptr) { + wxMetaFile *src; + wxObject *dest; + src = (wxMetaFile *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxMetaFile(_swigarg0) (new wxMetaFile(_swigarg0)) +static PyObject *_wrap_new_wxMetaFile(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMetaFile * _result; + wxString * _arg0 = (wxString *) &wxPyEmptyStr; + PyObject * _obj0 = 0; + char *_kwnames[] = { "filename", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxMetaFile",_kwnames,&_obj0)) + return NULL; + if (_obj0) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxMetaFile *)new_wxMetaFile(*_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMetaFile_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + +#define delete_wxMetaFile(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxMetaFile(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxMetaFile",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxMetaFile. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + delete_wxMetaFile(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxMetaFile_Ok(_swigobj) (_swigobj->Ok()) +static PyObject *_wrap_wxMetaFile_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMetaFile_Ok",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_Ok. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxMetaFile_Ok(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMetaFile_SetClipboard(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetClipboard(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxMetaFile_SetClipboard(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxMetaFile * _arg0; + int _arg1 = (int ) 0; + int _arg2 = (int ) 0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","width","height", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:wxMetaFile_SetClipboard",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_SetClipboard. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxMetaFile_SetClipboard(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMetaFile_GetSize(_swigobj) (_swigobj->GetSize()) +static PyObject *_wrap_wxMetaFile_GetSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSize * _result; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMetaFile_GetSize",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_GetSize. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxSize (wxMetaFile_GetSize(_arg0)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxMetaFile_GetWidth(_swigobj) (_swigobj->GetWidth()) +static PyObject *_wrap_wxMetaFile_GetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMetaFile_GetWidth",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_GetWidth. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMetaFile_GetWidth(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMetaFile_GetHeight(_swigobj) (_swigobj->GetHeight()) +static PyObject *_wrap_wxMetaFile_GetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMetaFile_GetHeight",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_GetHeight. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMetaFile_GetHeight(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMetaFile_GetFileName(_swigobj) (_swigobj->GetFileName()) +static PyObject *_wrap_wxMetaFile_GetFileName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxMetaFile * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMetaFile_GetFileName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMetaFile_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMetaFile_GetFileName. Expected _wxMetaFile_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + const wxString & _result_ref = wxMetaFile_GetFileName(_arg0); + _result = (wxString *) &_result_ref; + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} + return _resultobj; +} + static void *SwigwxMetaFileDCTowxDC(void *ptr) { wxMetaFileDC *src; wxDC *dest; @@ -10060,17 +10323,21 @@ static void *SwigwxMetaFileDCTowxObject(void *ptr) { return (void *) dest; } -#define new_wxMetaFileDC(_swigarg0) (new wxMetaFileDC(_swigarg0)) +#define new_wxMetaFileDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxMetaFileDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMetaFileDC * _result; wxString * _arg0 = (wxString *) &wxPyEmptyStr; + int _arg1 = (int ) 0; + int _arg2 = (int ) 0; + wxString * _arg3 = (wxString *) &wxPyEmptyStr; PyObject * _obj0 = 0; - char *_kwnames[] = { "filename", NULL }; + PyObject * _obj3 = 0; + char *_kwnames[] = { "filename","width","height","description", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxMetaFileDC",_kwnames,&_obj0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiiO:new_wxMetaFileDC",_kwnames,&_obj0,&_arg1,&_arg2,&_obj3)) return NULL; if (_obj0) { @@ -10090,10 +10357,29 @@ static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject } _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); #endif +} + if (_obj3) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxMetaFileDC *)new_wxMetaFileDC(*_arg0); + _result = (wxMetaFileDC *)new_wxMetaFileDC(*_arg0,_arg1,_arg2,*_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -10107,6 +10393,10 @@ static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject { if (_obj0) delete _arg0; +} +{ + if (_obj3) + delete _arg3; } return _resultobj; } @@ -11914,6 +12204,14 @@ static PyMethodDef gdicMethods[] = { { "new_wxPalette", (PyCFunction) _wrap_new_wxPalette, METH_VARARGS | METH_KEYWORDS }, { "wxMetaFileDC_Close", (PyCFunction) _wrap_wxMetaFileDC_Close, METH_VARARGS | METH_KEYWORDS }, { "new_wxMetaFileDC", (PyCFunction) _wrap_new_wxMetaFileDC, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_GetFileName", (PyCFunction) _wrap_wxMetaFile_GetFileName, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_GetHeight", (PyCFunction) _wrap_wxMetaFile_GetHeight, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_GetWidth", (PyCFunction) _wrap_wxMetaFile_GetWidth, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_GetSize", (PyCFunction) _wrap_wxMetaFile_GetSize, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_SetClipboard", (PyCFunction) _wrap_wxMetaFile_SetClipboard, METH_VARARGS | METH_KEYWORDS }, + { "wxMetaFile_Ok", (PyCFunction) _wrap_wxMetaFile_Ok, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxMetaFile", (PyCFunction) _wrap_delete_wxMetaFile, METH_VARARGS | METH_KEYWORDS }, + { "new_wxMetaFile", (PyCFunction) _wrap_new_wxMetaFile, METH_VARARGS | METH_KEYWORDS }, { "new_wxWindowDC", (PyCFunction) _wrap_new_wxWindowDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxPaintDC", (PyCFunction) _wrap_new_wxPaintDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxClientDC", (PyCFunction) _wrap_new_wxClientDC, METH_VARARGS | METH_KEYWORDS }, @@ -12244,6 +12542,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxImageList",SwigwxImageListTowxObject}, { "_wxObject","_wxPalette",SwigwxPaletteTowxObject}, { "_wxObject","_wxMetaFileDC",SwigwxMetaFileDCTowxObject}, + { "_wxObject","_wxMetaFile",SwigwxMetaFileTowxObject}, { "_wxObject","_wxWindowDC",SwigwxWindowDCTowxObject}, { "_wxObject","_wxPaintDC",SwigwxPaintDCTowxObject}, { "_wxObject","_wxClientDC",SwigwxClientDCTowxObject}, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 314869001d..6d5eb1b922 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -1032,12 +1032,49 @@ class wxWindowDC(wxWindowDCPtr): +class wxMetaFilePtr(wxObjectPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,gdic=gdic): + if self.thisown == 1 : + gdic.delete_wxMetaFile(self) + def Ok(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_Ok,(self,) + _args, _kwargs) + return val + def SetClipboard(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_SetClipboard,(self,) + _args, _kwargs) + return val + def GetSize(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_GetSize,(self,) + _args, _kwargs) + if val: val = wxSizePtr(val) ; val.thisown = 1 + return val + def GetWidth(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_GetWidth,(self,) + _args, _kwargs) + return val + def GetHeight(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_GetHeight,(self,) + _args, _kwargs) + return val + def GetFileName(self, *_args, **_kwargs): + val = apply(gdic.wxMetaFile_GetFileName,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxMetaFile(wxMetaFilePtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gdic.new_wxMetaFile,_args,_kwargs) + self.thisown = 1 + + + + class wxMetaFileDCPtr(wxDCPtr): def __init__(self,this): self.this = this self.thisown = 0 def Close(self, *_args, **_kwargs): val = apply(gdic.wxMetaFileDC_Close,(self,) + _args, _kwargs) + if val: val = wxMetaFilePtr(val) return val def __repr__(self): return "" % (self.this,) diff --git a/wxPython/src/msw/mdi.py b/wxPython/src/msw/mdi.py index 39576f52db..91a9ee973a 100644 --- a/wxPython/src/msw/mdi.py +++ b/wxPython/src/msw/mdi.py @@ -70,7 +70,7 @@ class wxMDIParentFrame(wxMDIParentFramePtr): def wxPreMDIParentFrame(*_args,**_kwargs): val = wxMDIParentFramePtr(apply(mdic.new_wxPreMDIParentFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -103,7 +103,7 @@ class wxMDIChildFrame(wxMDIChildFramePtr): def wxPreMDIChildFrame(*_args,**_kwargs): val = wxMDIChildFramePtr(apply(mdic.new_wxPreMDIChildFrame,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -127,7 +127,7 @@ class wxMDIClientWindow(wxMDIClientWindowPtr): def wxPreMDIClientWindow(*_args,**_kwargs): val = wxMDIClientWindowPtr(apply(mdic.new_wxPreMDIClientWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/stattool.py b/wxPython/src/msw/stattool.py index b16541246c..72b3d89da0 100644 --- a/wxPython/src/msw/stattool.py +++ b/wxPython/src/msw/stattool.py @@ -61,7 +61,7 @@ class wxStatusBar(wxStatusBarPtr): def wxPreStatusBar(*_args,**_kwargs): val = wxStatusBarPtr(apply(stattoolc.new_wxPreStatusBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -319,7 +319,7 @@ class wxToolBar(wxToolBarPtr): def wxPreToolBar(*_args,**_kwargs): val = wxToolBarPtr(apply(stattoolc.new_wxPreToolBar,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -346,7 +346,7 @@ class wxToolBarSimple(wxToolBarSimplePtr): def wxPreToolBarSimple(*_args,**_kwargs): val = wxToolBarSimplePtr(apply(stattoolc.new_wxPreToolBarSimple,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 1011ab75ae..0a66bdd9aa 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -576,7 +576,7 @@ class wxWindow(wxWindowPtr): def wxPreWindow(*_args,**_kwargs): val = wxWindowPtr(apply(windowsc.new_wxPreWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -687,7 +687,7 @@ class wxScrolledWindow(wxScrolledWindowPtr): def wxPreScrolledWindow(*_args,**_kwargs): val = wxScrolledWindowPtr(apply(windowsc.new_wxPreScrolledWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index 11485c1682..2e2fc53fb2 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -123,7 +123,7 @@ class wxNotebook(wxNotebookPtr): def wxPreNotebook(*_args,**_kwargs): val = wxNotebookPtr(apply(windows2c.new_wxPreNotebook,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -230,7 +230,7 @@ class wxSplitterWindow(wxSplitterWindowPtr): def wxPreSplitterWindow(*_args,**_kwargs): val = wxSplitterWindowPtr(apply(windows2c.new_wxPreSplitterWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/msw/windows3.py b/wxPython/src/msw/windows3.py index 9674a3cb2e..1c9ef110f6 100644 --- a/wxPython/src/msw/windows3.py +++ b/wxPython/src/msw/windows3.py @@ -125,7 +125,7 @@ class wxSashWindow(wxSashWindowPtr): def wxPreSashWindow(*_args,**_kwargs): val = wxSashWindowPtr(apply(windows3c.new_wxPreSashWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -236,7 +236,7 @@ class wxSashLayoutWindow(wxSashLayoutWindowPtr): def wxPreSashLayoutWindow(*_args,**_kwargs): val = wxSashLayoutWindowPtr(apply(windows3c.new_wxPreSashLayoutWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -289,7 +289,7 @@ class wxPopupWindow(wxPopupWindowPtr): def wxPrePopupWindow(*_args,**_kwargs): val = wxPopupWindowPtr(apply(windows3c.new_wxPrePopupWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val @@ -320,7 +320,7 @@ class wxPopupTransientWindow(wxPopupTransientWindowPtr): def wxPrePopupTransientWindow(*_args,**_kwargs): val = wxPopupTransientWindowPtr(apply(windows3c.new_wxPrePopupTransientWindow,_args,_kwargs)) val.thisown = 1 - val._setOORInfo(self) + val._setOORInfo(val) return val diff --git a/wxPython/src/stattool.i b/wxPython/src/stattool.i index 1b294d3dba..960762c2c7 100644 --- a/wxPython/src/stattool.i +++ b/wxPython/src/stattool.i @@ -51,7 +51,7 @@ public: char* name = "statusBar"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreStatusBar:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreStatusBar:val._setOORInfo(val)" %addmethods { %new wxRect* GetFieldRect(long item) { @@ -293,7 +293,7 @@ public: const char* name = wxToolBarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreToolBar:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreToolBar:val._setOORInfo(val)" wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y); }; @@ -319,7 +319,7 @@ public: const char* name = wxToolBarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreToolBarSimple:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreToolBarSimple:val._setOORInfo(val)" wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y); }; diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 950fd65844..1e5aefca2b 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -180,7 +180,7 @@ public: char* name = "panel"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(val)" void CaptureMouse(); @@ -475,7 +475,7 @@ public: char* name = "scrolledWindow"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(val)" void EnableScrolling(bool xScrolling, bool yScrolling); int GetScrollPageSize(int orient); diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index d1be157786..c05e23d81e 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -80,7 +80,7 @@ public: char* name = "notebook"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)" int GetPageCount(); int SetSelection(int nPage); @@ -177,7 +177,7 @@ public: char* name = "splitterWindow"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)" // Gets the only or left/top pane wxWindow *GetWindow1(); diff --git a/wxPython/src/windows3.i b/wxPython/src/windows3.i index 8dbb317db0..43651aea53 100644 --- a/wxPython/src/windows3.i +++ b/wxPython/src/windows3.i @@ -90,7 +90,7 @@ public: const char* name = "sashWindow"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)" bool GetSashVisible(wxSashEdgePosition edge); int GetDefaultBorderSize(); @@ -180,7 +180,7 @@ public: const char* name = "layoutWindow"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)" wxLayoutAlignment GetAlignment(); wxLayoutOrientation GetOrientation(); @@ -212,7 +212,7 @@ public: %name(wxPrePopupWindow)wxPopupWindow(); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)" bool Create(wxWindow *parent, int flags = wxBORDER_NONE); @@ -251,7 +251,7 @@ public: %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)" %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)" // popup the window (this will show it too) and keep focus at winFocus // (or itself if it's NULL), dismiss the popup if we lose focus -- 2.47.2