Lots more additions for propgrid:

* Update wxWidgets docs for propgrid/props.h and propgrid/advprops.h
* Add etg scripts for propgrid/props.h and propgrid/advprops.h
* Add wxUniChar
* Add wxTextValidator
* Add wxULongLong
This commit is contained in:
Robin Dunn
2016-08-25 21:26:11 -07:00
parent 85db11e72c
commit c9b878a676
14 changed files with 418 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ typedef unsigned long long wxULongLong_t;
#if wxUSE_LONGLONG_NATIVE
return PyLong_FromLongLong(sipCpp->GetValue());
#else
#error This is untested
// Convert a wxLongLong to a Python Long by getting the hi/lo
// dwords, then shifting and or-ing them together
PyObject *hi, *lo, *shifter, *shifted, *result;
@@ -58,3 +59,49 @@ typedef unsigned long long wxULongLong_t;
};
%MappedType wxULongLong {
%TypeHeaderCode
#include <wx/longlong.h>
%End
%ConvertToTypeCode
// Code to test a PyObject for compatibility
if (!sipIsErr) {
if (PyNumber_Check(sipPy))
return TRUE;
return FALSE;
}
// Code to convert from a compatible PyObject
#if wxUSE_LONGLONG_NATIVE
*sipCppPtr = new wxULongLong(PyLong_AsUnsignedLongLong(sipPy));
#else
#error TODO. Get the hi/lo 32-bit dwords to construct the wxLongLong
#endif
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
#if wxUSE_LONGLONG_NATIVE
return PyLong_FromUnsignedLongLong(sipCpp->GetValue());
#else
#error This needs testing and fixing for unsigned
// Convert a wxLongLong to a Python Long by getting the hi/lo
// dwords, then shifting and or-ing them together
PyObject *hi, *lo, *shifter, *shifted, *result;
hi = PyLong_FromLong( sipCpp->GetHi() );
lo = PyLong_FromLong( sipCpp->GetLo() );
shifter = PyLong_FromLong(32);
shifted = PyNumber_Lshift(hi, shifter);
result = PyNumber_Or(shifted, lo);
Py_DECREF(hi);
Py_DECREF(lo);
Py_DECREF(shifter);
Py_DECREF(shifted);
return result;
#endif
%End
};