}
return target;
}
+
+ // Put some wx default wxChar* values into wxStrings.
+ static const wxString wxPyEmptyString(wxT(""));
// An alternate constructor...
wxDataFormat* wxCustomDataFormat(const wxString &id) {
return new wxDataFormat(id);
// Create a new class for wxPython to use
class wxPyTextDataObject : public wxTextDataObject {
public:
- wxPyTextDataObject(const wxString& text = wxEmptyString)
+ wxPyTextDataObject(const wxString& text = wxPyEmptyString)
: wxTextDataObject(text) {}
DEC_PYCALLBACK_SIZET_(GetTextLength);
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
wxPyBeginBlockThreads();
if (m_myInst.findCallback("SetBitmap")) {
- m_myInst.callCallback(Py_BuildValue("(O)",
- wxPyConstructObject((void*)&bitmap, "wxBitmap")));
+ PyObject* bo = wxPyConstructObject((void*)&bitmap, "wxBitmap");
+ m_myInst.callCallback(Py_BuildValue("(O)", bo));
+ Py_DECREF(bo);
}
wxPyEndBlockThreads();
}
const wxArrayString& filenames) {
bool rval = FALSE;
wxPyBeginBlockThreads();
- PyObject* list = wxArrayString2PyList_helper(filenames);
- if (m_myInst.findCallback("OnDropFiles"))
+ if (m_myInst.findCallback("OnDropFiles")) {
+ PyObject* list = wxArrayString2PyList_helper(filenames);
rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
- Py_DECREF(list);
+ Py_DECREF(list);
+ }
wxPyEndBlockThreads();
return rval;
}
static PyObject *_wrap_wxDataFormat_SetId(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDataFormat * _arg0;
- wxChar * _arg1;
+ wxString * _arg1;
PyObject * _argo0 = 0;
+ PyObject * _obj1 = 0;
char *_kwnames[] = { "self","format", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDataFormat_SetId",_kwnames,&_argo0,&_arg1))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDataFormat_SetId",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
return NULL;
}
}
+{
+ _arg1 = wxString_in_helper(_obj1);
+ if (_arg1 == NULL)
+ return NULL;
+}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxDataFormat_SetId(_arg0,_arg1);
+ wxDataFormat_SetId(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
+{
+ if (_obj1)
+ delete _arg1;
+}
return _resultobj;
}
static PyObject *_wrap_new_wxTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxTextDataObject * _result;
- wxString * _arg0 = (wxString *) &wxEmptyString;
+ wxString * _arg0 = (wxString *) &wxPyEmptyString;
PyObject * _obj0 = 0;
char *_kwnames[] = { "text", NULL };
char _ptemp[128];
static PyObject *_wrap_new_wxPyTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPyTextDataObject * _result;
- wxString * _arg0 = (wxString *) &wxEmptyString;
+ wxString * _arg0 = (wxString *) &wxPyEmptyString;
PyObject * _obj0 = 0;
char *_kwnames[] = { "text", NULL };
char _ptemp[128];
PyObject * _resultobj;
wxDragResult _result;
wxPyDropSource * _arg0;
- int _arg1 = (int ) FALSE;
+ int _arg1 = (int ) (wxDrag_CopyOnly);
PyObject * _argo0 = 0;
- char *_kwnames[] = { "self","bAllowMove", NULL };
+ char *_kwnames[] = { "self","flags", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxDropSource_DoDragDrop",_kwnames,&_argo0,&_arg1))
PyDict_SetItemString(d,"wxDF_FILENAME", PyInt_FromLong((long) wxDF_FILENAME));
PyDict_SetItemString(d,"wxDF_LOCALE", PyInt_FromLong((long) wxDF_LOCALE));
PyDict_SetItemString(d,"wxDF_PRIVATE", PyInt_FromLong((long) wxDF_PRIVATE));
+ PyDict_SetItemString(d,"wxDF_HTML", PyInt_FromLong((long) wxDF_HTML));
PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX));
PyDict_SetItemString(d,"cvar", SWIG_globals);
SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set);
SWIG_addvarlink(SWIG_globals,"wxTheClipboard",_wrap_wxPyTheClipboard_get, _wrap_wxPyTheClipboard_set);
+ PyDict_SetItemString(d,"wxDrag_CopyOnly", PyInt_FromLong((long) wxDrag_CopyOnly));
+ PyDict_SetItemString(d,"wxDrag_AllowMove", PyInt_FromLong((long) wxDrag_AllowMove));
+ PyDict_SetItemString(d,"wxDrag_DefaultMove", PyInt_FromLong((long) wxDrag_DefaultMove));
PyDict_SetItemString(d,"wxDragError", PyInt_FromLong((long) wxDragError));
PyDict_SetItemString(d,"wxDragNone", PyInt_FromLong((long) wxDragNone));
PyDict_SetItemString(d,"wxDragCopy", PyInt_FromLong((long) wxDragCopy));