]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed a typemap.
authorRobin Dunn <robin@alldunn.com>
Mon, 21 Jan 2002 21:33:07 +0000 (21:33 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 21 Jan 2002 21:33:07 +0000 (21:33 +0000)
Added a Python list --> wxArrayInt typemap and wxArrayInt --> Python
list helper.

Added wxMultiChoiceDialog.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
wxPython/b.bat
wxPython/contrib/gizmos/gizmos.cpp
wxPython/src/_extras.py
wxPython/src/cmndlgs.i
wxPython/src/export.h
wxPython/src/helpers.cpp
wxPython/src/helpers.h
wxPython/src/msw/cmndlgs.cpp
wxPython/src/msw/cmndlgs.py
wxPython/src/msw/grid.cpp
wxPython/src/msw/misc2.cpp
wxPython/src/msw/wx.cpp
wxPython/src/msw/wx.py
wxPython/src/my_typemaps.i
wxPython/src/wx.i

index 78502de7dee92f29f33f3cec2cd2c9a15e4eef5b..bac157005999b3e7088500ac0c0bc39bbeca7d18 100755 (executable)
@@ -72,6 +72,9 @@ elseiff "%1" == "a" then
 
        call b.bat 15 c
        call b.bat 15 f
 
        call b.bat 15 c
        call b.bat 15 f
+       cd demo
+       p15 encode_bitmaps.py
+       cd -
        call b.bat 15 r
        call b.bat 15 c
        call b.bat 15 h
        call b.bat 15 r
        call b.bat 15 c
        call b.bat 15 h
index 6ba1762d0d1cd7106c5fcc08652ede528ac22add..e19231426e02c36a97d60180a4595e7cf5395b86 100644 (file)
@@ -638,7 +638,7 @@ static PyObject *_wrap_wxEditableListBox_SetStrings(PyObject *self, PyObject *ar
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj1, i);
         PyObject* str  = PyObject_Str(item);
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj1, i);
         PyObject* str  = PyObject_Str(item);
-        _arg1->Add(PyString_AsString(item));
+        _arg1->Add(PyString_AsString(str));
         Py_DECREF(item);
         Py_DECREF(str);
     }
         Py_DECREF(item);
         Py_DECREF(str);
     }
index c8da773691f203f42174936a6308e3397d0537f9..a3aa03097702352a6ebbe68a664ee845b0d20130 100644 (file)
@@ -576,6 +576,8 @@ class wxTimer(wxPyTimer):
 wxColor      = wxColour
 wxNamedColor = wxNamedColour
 wxPen        = wxPyPen
 wxColor      = wxColour
 wxNamedColor = wxNamedColour
 wxPen        = wxPyPen
+wxScrollbar  = wxScrollBar
+
 
 # backwards compatibility
 wxNoRefBitmap       = wxBitmap
 
 # backwards compatibility
 wxNoRefBitmap       = wxBitmap
@@ -589,11 +591,12 @@ wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric
 #----------------------------------------------------------------------
 # wxGTK sets the locale when initialized.  Doing this at the Python
 # level should set it up to match what GTK is doing at the C level.
 #----------------------------------------------------------------------
 # wxGTK sets the locale when initialized.  Doing this at the Python
 # level should set it up to match what GTK is doing at the C level.
-try:
-    import locale
-    locale.setlocale(locale.LC_ALL, "")
-except:
-    pass
+if wxPlatform == "__WXGTK__":
+    try:
+        import locale
+        locale.setlocale(locale.LC_ALL, "")
+    except:
+        pass
 
 
 
 
 
 
index 02ebd4eff9ac2bcd080799339e73772da31e3a69..8cef7b42bc501060d342dbc943601c4d47e46f9d 100644 (file)
@@ -132,7 +132,30 @@ public:
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
 
-//TODO: wxMultipleChoiceDialog
+enum { wxCHOICEDLG_STYLE };
+
+class wxMultiChoiceDialog : public wxDialog
+{
+public:
+    wxMultiChoiceDialog(wxWindow *parent,
+                        const wxString& message,
+                        const wxString& caption,
+                        int LCOUNT, wxString *choices,
+                        long style = wxCHOICEDLG_STYLE,
+                        const wxPoint& pos = wxDefaultPosition);
+
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+
+    void SetSelections(const wxArrayInt& selections);
+
+    // wxArrayInt GetSelections() const;
+    %addmethods {
+        PyObject* GetSelections() {
+            return wxArrayInt2PyList_helper(self->GetSelections());
+        }
+    }
+};
+
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
 
@@ -146,7 +169,7 @@ public:
                              wxString* caption,
                              int LCOUNT, wxString* choices,
                              //char** clientData = NULL,
                              wxString* caption,
                              int LCOUNT, wxString* choices,
                              //char** clientData = NULL,
-                             long style = wxOK | wxCANCEL | wxCENTRE,
+                             long style = wxCHOICEDLG_STYLE,
                              wxPoint* pos = &wxDefaultPosition) {
             return new wxSingleChoiceDialog(parent, *message, *caption,
                                             LCOUNT, choices, NULL, style, *pos);
                              wxPoint* pos = &wxDefaultPosition) {
             return new wxSingleChoiceDialog(parent, *message, *caption,
                                             LCOUNT, choices, NULL, style, *pos);
index 74932166e3807cd064d3938f6564bec7118377f7..eb944800c9ce0821f809236f3f6c2390a744e321 100644 (file)
@@ -67,7 +67,7 @@ static void wxPyCoreAPI_IMPORT() {
 #define wxPyMake_wxSizer(a)             (wxPyCoreAPIPtr->p_wxPyMake_wxSizer(a))
 #define wxPyPtrTypeMap_Add(a, b)        (wxPyCoreAPIPtr->p_wxPyPtrTypeMap_Add(a, b))
 #define wxArrayString2PyList_helper(a)  (wxPyCoreAPIPtr->p_wxArrayString2PyList_helper(a))
 #define wxPyMake_wxSizer(a)             (wxPyCoreAPIPtr->p_wxPyMake_wxSizer(a))
 #define wxPyPtrTypeMap_Add(a, b)        (wxPyCoreAPIPtr->p_wxPyPtrTypeMap_Add(a, b))
 #define wxArrayString2PyList_helper(a)  (wxPyCoreAPIPtr->p_wxArrayString2PyList_helper(a))
-
+#define wxArrayInt2PyList_helper(a)     (wxPyCoreAPIPtr->p_wxArrayInt2PyList_helper(a))
 
 
 // This one is special.  It's the first function called in SWIG generated
 
 
 // This one is special.  It's the first function called in SWIG generated
index 0943cabc006302e47d3ab25c8cdaf1d71fb32b84..6a196331a39b8e4aa7aee0973f53e43971c24259 100644 (file)
@@ -1490,6 +1490,18 @@ PyObject* wxArrayString2PyList_helper(const wxArrayString& arr) {
 }
 
 
 }
 
 
+PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr) {
+
+    PyObject* list = PyList_New(0);
+    for (size_t i=0; i < arr.GetCount(); i++) {
+        PyObject* number = PyInt_FromLong(arr[i]);
+        PyList_Append(list, number);
+        Py_DECREF(number);
+    }
+    return list;
+}
+
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
 
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
 
index a4117ce021a1af5ba34c0097ad495d9deadc6134..ffab121edf6bf5916f58942230c4094b89db6003 100644 (file)
@@ -143,6 +143,7 @@ bool _4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4);
 
 
 PyObject* wxArrayString2PyList_helper(const wxArrayString& arr);
 
 
 PyObject* wxArrayString2PyList_helper(const wxArrayString& arr);
+PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr);
 
 
 #define RETURN_NONE()   { Py_INCREF(Py_None); return Py_None; }
 
 
 #define RETURN_NONE()   { Py_INCREF(Py_None); return Py_None; }
@@ -281,6 +282,7 @@ struct wxPyCoreAPI {
     PyObject*   (*p_wxPyMake_wxSizer)(wxSizer* source);
     void        (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName);
     PyObject*   (*p_wxArrayString2PyList_helper)(const wxArrayString& arr);
     PyObject*   (*p_wxPyMake_wxSizer)(wxSizer* source);
     void        (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName);
     PyObject*   (*p_wxArrayString2PyList_helper)(const wxArrayString& arr);
+    PyObject*   (*p_wxArrayInt2PyList_helper)(const wxArrayInt& arr);
 };
 
 #ifdef wxPyUSE_EXPORT
 };
 
 #ifdef wxPyUSE_EXPORT
index 0ade57fab8cb84cdea85e3fccb4f600aaf65c9ca..a3e20f8a60011966a98da7c71c348557b4be54c0 100644 (file)
@@ -1535,6 +1535,241 @@ static PyObject *_wrap_wxFileDialog_GetPaths(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
     return _resultobj;
 }
 
+static void *SwigwxMultiChoiceDialogTowxDialog(void *ptr) {
+    wxMultiChoiceDialog *src;
+    wxDialog *dest;
+    src = (wxMultiChoiceDialog *) ptr;
+    dest = (wxDialog *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxMultiChoiceDialogTowxTopLevelWindow(void *ptr) {
+    wxMultiChoiceDialog *src;
+    wxTopLevelWindow *dest;
+    src = (wxMultiChoiceDialog *) ptr;
+    dest = (wxTopLevelWindow *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxMultiChoiceDialogTowxWindow(void *ptr) {
+    wxMultiChoiceDialog *src;
+    wxWindow *dest;
+    src = (wxMultiChoiceDialog *) ptr;
+    dest = (wxWindow *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxMultiChoiceDialogTowxEvtHandler(void *ptr) {
+    wxMultiChoiceDialog *src;
+    wxEvtHandler *dest;
+    src = (wxMultiChoiceDialog *) ptr;
+    dest = (wxEvtHandler *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxMultiChoiceDialogTowxObject(void *ptr) {
+    wxMultiChoiceDialog *src;
+    wxObject *dest;
+    src = (wxMultiChoiceDialog *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
+#define new_wxMultiChoiceDialog(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxMultiChoiceDialog(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6))
+static PyObject *_wrap_new_wxMultiChoiceDialog(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxMultiChoiceDialog * _result;
+    wxWindow * _arg0;
+    wxString * _arg1;
+    wxString * _arg2;
+    int  _arg3;
+    wxString * _arg4;
+    long  _arg5 = (long ) (wxCHOICEDLG_STYLE);
+    wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    PyObject * _obj2 = 0;
+    PyObject * _obj4 = 0;
+    wxPoint  temp;
+    PyObject * _obj6 = 0;
+    char *_kwnames[] = { "parent","message","caption","choices","style","pos", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO|lO:new_wxMultiChoiceDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_obj4,&_arg5,&_obj6)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxMultiChoiceDialog. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+#if PYTHON_API_VERSION >= 1009
+    char* tmpPtr; int tmpSize;
+    if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+        return NULL;
+    }
+    if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
+        return NULL;
+    _arg1 = new wxString(tmpPtr, tmpSize);
+#else
+    if (!PyString_Check(_obj1)) {
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+        return NULL;
+    }
+    _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
+#endif
+}
+{
+#if PYTHON_API_VERSION >= 1009
+    char* tmpPtr; int tmpSize;
+    if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+        return NULL;
+    }
+    if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
+        return NULL;
+    _arg2 = new wxString(tmpPtr, tmpSize);
+#else
+    if (!PyString_Check(_obj2)) {
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+        return NULL;
+    }
+    _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
+#endif
+}
+    if (_obj4)
+{
+    _arg4 = wxString_LIST_helper(_obj4);
+    if (_arg4 == NULL) {
+        return NULL;
+    }
+}
+    if (_obj6)
+{
+    _arg6 = &temp;
+    if (! wxPoint_helper(_obj6, &_arg6))
+        return NULL;
+}
+{
+    if (_obj4) {
+        _arg3 = PyList_Size(_obj4);
+    }
+    else {
+        _arg3 = 0;
+    }
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+        _result = (wxMultiChoiceDialog *)new_wxMultiChoiceDialog(_arg0,*_arg1,*_arg2,_arg3,_arg4,_arg5,*_arg6);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxMultiChoiceDialog_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+{
+    if (_obj1)
+        delete _arg1;
+}
+{
+    if (_obj2)
+        delete _arg2;
+}
+{
+    delete [] _arg4;
+}
+    return _resultobj;
+}
+
+#define wxMultiChoiceDialog_SetSelections(_swigobj,_swigarg0)  (_swigobj->SetSelections(_swigarg0))
+static PyObject *_wrap_wxMultiChoiceDialog_SetSelections(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxMultiChoiceDialog * _arg0;
+    wxArrayInt * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    char *_kwnames[] = { "self","selections", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMultiChoiceDialog_SetSelections",_kwnames,&_argo0,&_obj1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMultiChoiceDialog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMultiChoiceDialog_SetSelections. Expected _wxMultiChoiceDialog_p.");
+        return NULL;
+        }
+    }
+{
+    if (! PySequence_Check(_obj1)) {
+        PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
+        return NULL;
+    }
+    _arg1 = new wxArrayInt;
+    int i, len=PySequence_Length(_obj1);
+    for (i=0; i<len; i++) {
+        PyObject* item = PySequence_GetItem(_obj1, i);
+        PyObject* number  = PyNumber_Int(item);
+        _arg1->Add(PyInt_AS_LONG(number));
+        Py_DECREF(item);
+        Py_DECREF(number);
+    }
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+        wxMultiChoiceDialog_SetSelections(_arg0,*_arg1);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+{
+    if (_obj1)
+        delete _arg1;
+}
+    return _resultobj;
+}
+
+static PyObject * wxMultiChoiceDialog_GetSelections(wxMultiChoiceDialog *self) {
+            return wxArrayInt2PyList_helper(self->GetSelections());
+        }
+static PyObject *_wrap_wxMultiChoiceDialog_GetSelections(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    PyObject * _result;
+    wxMultiChoiceDialog * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMultiChoiceDialog_GetSelections",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMultiChoiceDialog_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMultiChoiceDialog_GetSelections. Expected _wxMultiChoiceDialog_p.");
+        return NULL;
+        }
+    }
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+        _result = (PyObject *)wxMultiChoiceDialog_GetSelections(_arg0);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}{
+  _resultobj = _result;
+}
+    return _resultobj;
+}
+
 static void *SwigwxSingleChoiceDialogTowxDialog(void *ptr) {
     wxSingleChoiceDialog *src;
     wxDialog *dest;
 static void *SwigwxSingleChoiceDialogTowxDialog(void *ptr) {
     wxSingleChoiceDialog *src;
     wxDialog *dest;
@@ -1588,7 +1823,7 @@ static PyObject *_wrap_new_wxSingleChoiceDialog(PyObject *self, PyObject *args,
     wxString * _arg2;
     int  _arg3;
     wxString * _arg4;
     wxString * _arg2;
     int  _arg3;
     wxString * _arg4;
-    long  _arg5 = (long ) wxOK|wxCANCEL|wxCENTRE;
+    long  _arg5 = (long ) (wxCHOICEDLG_STYLE);
     wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition;
     PyObject * _argo0 = 0;
     PyObject * _obj1 = 0;
     wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition;
     PyObject * _argo0 = 0;
     PyObject * _obj1 = 0;
@@ -3857,6 +4092,9 @@ static PyMethodDef cmndlgscMethods[] = {
         { "wxSingleChoiceDialog_GetStringSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetStringSelection, METH_VARARGS | METH_KEYWORDS },
         { "wxSingleChoiceDialog_GetSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetSelection, METH_VARARGS | METH_KEYWORDS },
         { "new_wxSingleChoiceDialog", (PyCFunction) _wrap_new_wxSingleChoiceDialog, METH_VARARGS | METH_KEYWORDS },
         { "wxSingleChoiceDialog_GetStringSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetStringSelection, METH_VARARGS | METH_KEYWORDS },
         { "wxSingleChoiceDialog_GetSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetSelection, METH_VARARGS | METH_KEYWORDS },
         { "new_wxSingleChoiceDialog", (PyCFunction) _wrap_new_wxSingleChoiceDialog, METH_VARARGS | METH_KEYWORDS },
+        { "wxMultiChoiceDialog_GetSelections", (PyCFunction) _wrap_wxMultiChoiceDialog_GetSelections, METH_VARARGS | METH_KEYWORDS },
+        { "wxMultiChoiceDialog_SetSelections", (PyCFunction) _wrap_wxMultiChoiceDialog_SetSelections, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxMultiChoiceDialog", (PyCFunction) _wrap_new_wxMultiChoiceDialog, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_GetPaths", (PyCFunction) _wrap_wxFileDialog_GetPaths, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_GetFilenames", (PyCFunction) _wrap_wxFileDialog_GetFilenames, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_ShowModal", (PyCFunction) _wrap_wxFileDialog_ShowModal, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_GetPaths", (PyCFunction) _wrap_wxFileDialog_GetPaths, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_GetFilenames", (PyCFunction) _wrap_wxFileDialog_GetFilenames, METH_VARARGS | METH_KEYWORDS },
         { "wxFileDialog_ShowModal", (PyCFunction) _wrap_wxFileDialog_ShowModal, METH_VARARGS | METH_KEYWORDS },
@@ -3929,6 +4167,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxTopLevelWindow","_wxFontDialog",SwigwxFontDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxFontDialog",SwigwxFontDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxTopLevelWindow},
+    { "_wxTopLevelWindow","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxFileDialog",SwigwxFileDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxDirDialog",SwigwxDirDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxColourDialog",SwigwxColourDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxFileDialog",SwigwxFileDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxDirDialog",SwigwxDirDialogTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxColourDialog",SwigwxColourDialogTowxTopLevelWindow},
@@ -3969,6 +4208,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxObject","_wxFontData",SwigwxFontDataTowxObject},
     { "_wxObject","_wxTextEntryDialog",SwigwxTextEntryDialogTowxObject},
     { "_wxObject","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxObject},
     { "_wxObject","_wxFontData",SwigwxFontDataTowxObject},
     { "_wxObject","_wxTextEntryDialog",SwigwxTextEntryDialogTowxObject},
     { "_wxObject","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxObject},
+    { "_wxObject","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxObject},
     { "_wxObject","_wxFileDialog",SwigwxFileDialogTowxObject},
     { "_wxObject","_wxDirDialog",SwigwxDirDialogTowxObject},
     { "_wxObject","_wxColourDialog",SwigwxColourDialogTowxObject},
     { "_wxObject","_wxFileDialog",SwigwxFileDialogTowxObject},
     { "_wxObject","_wxDirDialog",SwigwxDirDialogTowxObject},
     { "_wxObject","_wxColourDialog",SwigwxColourDialogTowxObject},
@@ -3988,6 +4228,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxDialog","_wxFontDialog",SwigwxFontDialogTowxDialog},
     { "_wxDialog","_wxTextEntryDialog",SwigwxTextEntryDialogTowxDialog},
     { "_wxDialog","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxDialog},
     { "_wxDialog","_wxFontDialog",SwigwxFontDialogTowxDialog},
     { "_wxDialog","_wxTextEntryDialog",SwigwxTextEntryDialogTowxDialog},
     { "_wxDialog","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxDialog},
+    { "_wxDialog","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxDialog},
     { "_wxDialog","_wxFileDialog",SwigwxFileDialogTowxDialog},
     { "_wxDialog","_wxDirDialog",SwigwxDirDialogTowxDialog},
     { "_wxDialog","_wxColourDialog",SwigwxColourDialogTowxDialog},
     { "_wxDialog","_wxFileDialog",SwigwxFileDialogTowxDialog},
     { "_wxDialog","_wxDirDialog",SwigwxDirDialogTowxDialog},
     { "_wxDialog","_wxColourDialog",SwigwxColourDialogTowxDialog},
@@ -4035,6 +4276,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxEvtHandler","_wxFontDialog",SwigwxFontDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxTextEntryDialog",SwigwxTextEntryDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxFontDialog",SwigwxFontDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxTextEntryDialog",SwigwxTextEntryDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxEvtHandler},
+    { "_wxEvtHandler","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxFileDialog",SwigwxFileDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxDirDialog",SwigwxDirDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxColourDialog",SwigwxColourDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxFileDialog",SwigwxFileDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxDirDialog",SwigwxDirDialogTowxEvtHandler},
     { "_wxEvtHandler","_wxColourDialog",SwigwxColourDialogTowxEvtHandler},
@@ -4044,6 +4286,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxWindow","_wxFontDialog",SwigwxFontDialogTowxWindow},
     { "_wxWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxWindow},
     { "_wxWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxWindow},
     { "_wxWindow","_wxFontDialog",SwigwxFontDialogTowxWindow},
     { "_wxWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxWindow},
     { "_wxWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxWindow},
+    { "_wxWindow","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxWindow},
     { "_wxWindow","_wxFileDialog",SwigwxFileDialogTowxWindow},
     { "_wxWindow","_wxDirDialog",SwigwxDirDialogTowxWindow},
     { "_wxWindow","_wxColourDialog",SwigwxColourDialogTowxWindow},
     { "_wxWindow","_wxFileDialog",SwigwxFileDialogTowxWindow},
     { "_wxWindow","_wxDirDialog",SwigwxDirDialogTowxWindow},
     { "_wxWindow","_wxColourDialog",SwigwxColourDialogTowxWindow},
@@ -4058,6 +4301,7 @@ SWIGEXPORT(void) initcmndlgsc() {
         SWIG_globals = SWIG_newvarlink();
         m = Py_InitModule("cmndlgsc", cmndlgscMethods);
         d = PyModule_GetDict(m);
         SWIG_globals = SWIG_newvarlink();
         m = Py_InitModule("cmndlgsc", cmndlgscMethods);
         d = PyModule_GetDict(m);
+        PyDict_SetItemString(d,"wxCHOICEDLG_STYLE", PyInt_FromLong((long) wxCHOICEDLG_STYLE));
         PyDict_SetItemString(d,"wxFR_DOWN", PyInt_FromLong((long) wxFR_DOWN));
         PyDict_SetItemString(d,"wxFR_WHOLEWORD", PyInt_FromLong((long) wxFR_WHOLEWORD));
         PyDict_SetItemString(d,"wxFR_MATCHCASE", PyInt_FromLong((long) wxFR_MATCHCASE));
         PyDict_SetItemString(d,"wxFR_DOWN", PyInt_FromLong((long) wxFR_DOWN));
         PyDict_SetItemString(d,"wxFR_WHOLEWORD", PyInt_FromLong((long) wxFR_WHOLEWORD));
         PyDict_SetItemString(d,"wxFR_MATCHCASE", PyInt_FromLong((long) wxFR_MATCHCASE));
index 45912c3c49e685e524eaf6a101fbf04629f6089d..d9d51fdd0f81a8f6b445b12c38f8d0f29e2e6704 100644 (file)
@@ -193,6 +193,27 @@ class wxFileDialog(wxFileDialogPtr):
 
 
 
 
 
 
+class wxMultiChoiceDialogPtr(wxDialogPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def SetSelections(self, *_args, **_kwargs):
+        val = apply(cmndlgsc.wxMultiChoiceDialog_SetSelections,(self,) + _args, _kwargs)
+        return val
+    def GetSelections(self, *_args, **_kwargs):
+        val = apply(cmndlgsc.wxMultiChoiceDialog_GetSelections,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxMultiChoiceDialog instance at %s>" % (self.this,)
+class wxMultiChoiceDialog(wxMultiChoiceDialogPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(cmndlgsc.new_wxMultiChoiceDialog,_args,_kwargs)
+        self.thisown = 1
+        self._setOORInfo(self)
+
+
+
+
 class wxSingleChoiceDialogPtr(wxDialogPtr):
     def __init__(self,this):
         self.this = this
 class wxSingleChoiceDialogPtr(wxDialogPtr):
     def __init__(self,this):
         self.this = this
@@ -474,6 +495,7 @@ def wxPreFindReplaceDialog(*_args,**_kwargs):
 
 #-------------- VARIABLE WRAPPERS ------------------
 
 
 #-------------- VARIABLE WRAPPERS ------------------
 
+wxCHOICEDLG_STYLE = cmndlgsc.wxCHOICEDLG_STYLE
 wxFR_DOWN = cmndlgsc.wxFR_DOWN
 wxFR_WHOLEWORD = cmndlgsc.wxFR_WHOLEWORD
 wxFR_MATCHCASE = cmndlgsc.wxFR_MATCHCASE
 wxFR_DOWN = cmndlgsc.wxFR_DOWN
 wxFR_WHOLEWORD = cmndlgsc.wxFR_WHOLEWORD
 wxFR_MATCHCASE = cmndlgsc.wxFR_MATCHCASE
index 70a00f3874e16b85bfb74335aa5e87e478314b60..656cddc085a5ae8f7931e66b9032e1f675ddeb0e 100644 (file)
@@ -7861,7 +7861,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj2, i);
         PyObject* str  = PyObject_Str(item);
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj2, i);
         PyObject* str  = PyObject_Str(item);
-        _arg2->Add(PyString_AsString(item));
+        _arg2->Add(PyString_AsString(str));
         Py_DECREF(item);
         Py_DECREF(str);
     }
         Py_DECREF(item);
         Py_DECREF(str);
     }
index 354610463c9a08aef4985d739999312da3f08249..b42cd9923f2ecca0e9df9d62f313ba68c837d969 100644 (file)
@@ -7896,7 +7896,7 @@ static PyObject *_wrap_new_wxFileTypeInfoSequence(PyObject *self, PyObject *args
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj0, i);
         PyObject* str  = PyObject_Str(item);
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem(_obj0, i);
         PyObject* str  = PyObject_Str(item);
-        _arg0->Add(PyString_AsString(item));
+        _arg0->Add(PyString_AsString(str));
         Py_DECREF(item);
         Py_DECREF(str);
     }
         Py_DECREF(item);
         Py_DECREF(str);
     }
index 736a71d761648b918d240f6d85578a3005519d74..30e02ea50c7b15c7421297b33edccecccb56456e 100644 (file)
@@ -676,7 +676,8 @@ static wxPyCoreAPI API = {
     wxPyMake_wxObject,
     wxPyMake_wxSizer,
     wxPyPtrTypeMap_Add,
     wxPyMake_wxObject,
     wxPyMake_wxSizer,
     wxPyPtrTypeMap_Add,
-    wxArrayString2PyList_helper
+    wxArrayString2PyList_helper,
+    wxArrayInt2PyList_helper
 };
 
 
 };
 
 
index e48bb7f1bbcf9a44981298804fcc0438997894c6..5dee6b2830debe1e89d50bf71e3c90566bfd1485 100644 (file)
@@ -1453,6 +1453,8 @@ class wxTimer(wxPyTimer):
 wxColor      = wxColour
 wxNamedColor = wxNamedColour
 wxPen        = wxPyPen
 wxColor      = wxColour
 wxNamedColor = wxNamedColour
 wxPen        = wxPyPen
+wxScrollbar  = wxScrollBar
+
 
 # backwards compatibility
 wxNoRefBitmap       = wxBitmap
 
 # backwards compatibility
 wxNoRefBitmap       = wxBitmap
@@ -1466,11 +1468,12 @@ wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric
 #----------------------------------------------------------------------
 # wxGTK sets the locale when initialized.  Doing this at the Python
 # level should set it up to match what GTK is doing at the C level.
 #----------------------------------------------------------------------
 # wxGTK sets the locale when initialized.  Doing this at the Python
 # level should set it up to match what GTK is doing at the C level.
-try:
-    import locale
-    locale.setlocale(locale.LC_ALL, "")
-except:
-    pass
+if wxPlatform == "__WXGTK__":
+    try:
+        import locale
+        locale.setlocale(locale.LC_ALL, "")
+    except:
+        pass
 
 
 
 
 
 
index d25e6e5077e8d84346915d83f92000cc2194baff..0fcf295e4a909cba68717f938d7eeb104966dfc1 100644 (file)
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem($source, i);
         PyObject* str  = PyObject_Str(item);
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem($source, i);
         PyObject* str  = PyObject_Str(item);
-        $target->Add(PyString_AsString(item));
+        $target->Add(PyString_AsString(str));
         Py_DECREF(item);
         Py_DECREF(str);
     }
         Py_DECREF(item);
         Py_DECREF(str);
     }
         delete $source;
 }
 
         delete $source;
 }
 
+//---------------------------------------------------------------------------
+// Typemap for wxArrayInt from Python sequence objects
+
+%typemap(python,in) wxArrayInt& {
+    if (! PySequence_Check($source)) {
+        PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
+        return NULL;
+    }
+    $target = new wxArrayInt;
+    int i, len=PySequence_Length($source);
+    for (i=0; i<len; i++) {
+        PyObject* item = PySequence_GetItem($source, i);
+        PyObject* number  = PyNumber_Int(item);
+        $target->Add(PyInt_AS_LONG(number));
+        Py_DECREF(item);
+        Py_DECREF(number);
+    }
+}
+
+%typemap(python, freearg) wxArrayInt& {
+    if ($target)
+        delete $source;
+}
+
+
 //---------------------------------------------------------------------------
 // Map T_OUTPUTs for floats to return ints.
 
 //---------------------------------------------------------------------------
 // Map T_OUTPUTs for floats to return ints.
 
index fc29566e564bb6122b135405145e2b70af825cf7..6d11d437801103ab05e08846a955d743bf1d8b56 100644 (file)
@@ -199,7 +199,8 @@ static wxPyCoreAPI API = {
     wxPyMake_wxObject,
     wxPyMake_wxSizer,
     wxPyPtrTypeMap_Add,
     wxPyMake_wxObject,
     wxPyMake_wxSizer,
     wxPyPtrTypeMap_Add,
-    wxArrayString2PyList_helper
+    wxArrayString2PyList_helper,
+    wxArrayInt2PyList_helper
 };
 
 
 };