mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 19:40:12 +01:00
Add autoconvert code from wxArrayString to wxPGChoices
This commit is contained in:
@@ -86,6 +86,25 @@ def run():
|
||||
body="return self.GetCount()",
|
||||
)
|
||||
|
||||
# Enable auto conversion from wxArrayString
|
||||
c.convertFromPyObject = """\
|
||||
// Code to test a PyObject for compatibility
|
||||
if (!sipIsErr) {
|
||||
if (sipCanConvertToType(sipPy, sipType_wxArrayString, 0))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Code to convert a compatible PyObject
|
||||
int state = 0;
|
||||
wxArrayString* arr = reinterpret_cast<wxArrayString*>(
|
||||
sipConvertToType(sipPy, sipType_wxArrayString, sipTransferObj, 0, &state, sipIsErr));
|
||||
*sipCppPtr = new wxPGChoices(arr);
|
||||
sipReleaseType(arr, sipType_wxArrayString, state);
|
||||
return sipGetState(sipTransferObj);
|
||||
"""
|
||||
|
||||
|
||||
# Ignore some string constants (#defines) coming from dox, and add them
|
||||
# back in Python code. They are wchar_t* values and this seemed the
|
||||
# simplest way to deal with them.
|
||||
|
||||
Reference in New Issue
Block a user