mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 13:00:07 +01:00
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:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user