Windows and non-unicode builds
================ =====================================
-Aside the standard formats, the application may also use custom
+Besies the standard formats, the application may also use custom
formats which are identified by their names (strings) and not numeric
identifiers. Although internally custom format must be created (or
registered) first, you shouldn\'t care about it because it is done
PyObject* list = PyList_New(count);
for (size_t i=0; i<count; i++) {
wxDataFormat* format = new wxDataFormat(formats[i]);
- PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), True);
+ PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
PyList_Append(list, obj);
Py_DECREF(obj);
}
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
- rval = False;
+ rval = false;
}
wxPyEndBlockThreads(blocked);
return rval;
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
- rval = False;
+ rval = false;
}
wxPyEndBlockThreads(blocked);
return rval;
// return either a string or None and then act appropriately with the
// C++ version.
- bool rval = False;
+ bool rval = false;
bool blocked = wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "GetDataHere")) {
PyObject* ro;
bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) const{
// For this one we simply need to make a string from buf and len
// and send it to the Python method.
- bool rval = False;
+ bool rval = false;
bool blocked = wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetData")) {
PyObject* data = PyString_FromStringAndSize((char*)buf, len);
%apply SWIGTYPE *DISOWN { wxDataObjectSimple *dataObject };
DocDeclStr(
- void , Add(wxDataObjectSimple *dataObject, bool preferred = False),
+ void , Add(wxDataObjectSimple *dataObject, bool preferred = false),
"Adds the dataObject to the list of supported objects and it becomes
the preferred object if preferred is True.", "");
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
bool blocked = wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetBitmap")) {
- PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), False);
+ PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), false);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", bo));
Py_DECREF(bo);
}
absolute file names, but internally it uses the same format as
Explorer and other compatible programs under Windows or GNOME/KDE
filemanager under Unix which makes it possible to receive files from
-them using this class.
-
-:Warning: Under all non-Windows platforms this class is currently
- \"input-only\", i.e. you can receive the files from another
- application, but copying (or dragging) file(s) from a wxWidgets
- application is not currently supported.
-", "");
+them using this class.", "");
class wxFileDataObject : public wxDataObjectSimple
{
class wxCustomDataObject : public wxDataObjectSimple {
public:
- wxCustomDataObject(const wxDataFormat& format = wxFormatInvalid);
-
+ %nokwargs wxCustomDataObject;
+ wxCustomDataObject(const wxDataFormat& format);
+ %extend {
+ wxCustomDataObject(const wxString& formatName) {
+ return new wxCustomDataObject(wxDataFormat(formatName));
+ }
+ }
+ wxCustomDataObject();
+
DocAStr(SetData,
"SetData(self, String data) -> bool",
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
- rval = False;
+ rval = false;
}
wxPyEndBlockThreads(blocked);
return rval;