X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f7f284d555df50912037296c5d74a2911975bce..5541976c17c0550eb2a5ea010c701d9119780193:/wxPython/src/mac/_controls_wrap.cpp diff --git a/wxPython/src/mac/_controls_wrap.cpp b/wxPython/src/mac/_controls_wrap.cpp index 0c8b046666..7a58693669 100644 --- a/wxPython/src/mac/_controls_wrap.cpp +++ b/wxPython/src/mac/_controls_wrap.cpp @@ -3377,10 +3377,50 @@ SWIGINTERN wxDateTime wxDatePickerCtrl_GetUpperLimit(wxDatePickerCtrl *self){ static const wxString wxPyFileSelectorDefaultWildcardStr(wxFileSelectorDefaultWildcardStr); static const wxString wxPyFontPickerCtrlNameStr(wxFontPickerCtrlNameStr); static const wxString wxPyCollapsiblePaneNameStr(wxCollapsiblePaneNameStr); + static const wxString wxPySearchCtrlNameStr(wxSearchCtrlNameStr); -#include +#if !defined(wxUSE_SEARCHCTRL) || !wxUSE_SEARCHCTRL +// define a dummy class for builds that don't have wxSearchCtrl + +enum { + wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, + wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN +}; + +class wxSearchCtrl : public wxTextCtrl +{ +public: + wxSearchCtrl() { wxPyRaiseNotImplemented(); } + wxSearchCtrl(wxWindow*, wxWindowID, + const wxString&, + const wxPoint&, + const wxSize&, + long style, + const wxValidator&, + const wxString& name) + { wxPyRaiseNotImplemented(); } + + bool Create( wxWindow*, wxWindowID, + const wxString&, + const wxPoint&, + const wxSize&, + long style, + const wxValidator&, + const wxString& name) {} + + virtual void SetMenu( wxMenu* ) {} + virtual wxMenu* GetMenu() { return NULL; } + + // get/set search options + // ---------------------- + virtual void ShowSearchButton( bool ) {} + virtual bool IsSearchButtonVisible() const { return false; } + + virtual void ShowCancelButton( bool ) {} + virtual bool IsCancelButtonVisible() const { return false; } +}; +#endif - static const wxString wxPySearchCtrlNameStr(wxSearchCtrlNameStr); SWIGINTERN void wxSearchCtrl_SetSearchBitmap(wxSearchCtrl *self,wxBitmap const &){} SWIGINTERN void wxSearchCtrl_SetSearchMenuBitmap(wxSearchCtrl *self,wxBitmap const &){} SWIGINTERN void wxSearchCtrl_SetCancelBitmap(wxSearchCtrl *self,wxBitmap const &){} @@ -35462,6 +35502,36 @@ fail: } +SWIGINTERN PyObject *_wrap_TreeCtrl_IsEmpty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxPyTreeCtrl *arg1 = (wxPyTreeCtrl *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxPyTreeCtrl, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TreeCtrl_IsEmpty" "', expected argument " "1"" of type '" "wxPyTreeCtrl const *""'"); + } + arg1 = reinterpret_cast< wxPyTreeCtrl * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxPyTreeCtrl const *)arg1)->IsEmpty(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_TreeCtrl_GetChildrenCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxPyTreeCtrl *arg1 = (wxPyTreeCtrl *) 0 ; @@ -36683,6 +36753,74 @@ fail: } +SWIGINTERN PyObject *_wrap_TreeCtrl_CollapseAllChildren(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxPyTreeCtrl *arg1 = (wxPyTreeCtrl *) 0 ; + wxTreeItemId *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "item", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TreeCtrl_CollapseAllChildren",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxPyTreeCtrl, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TreeCtrl_CollapseAllChildren" "', expected argument " "1"" of type '" "wxPyTreeCtrl *""'"); + } + arg1 = reinterpret_cast< wxPyTreeCtrl * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_wxTreeItemId, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TreeCtrl_CollapseAllChildren" "', expected argument " "2"" of type '" "wxTreeItemId const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TreeCtrl_CollapseAllChildren" "', expected argument " "2"" of type '" "wxTreeItemId const &""'"); + } + arg2 = reinterpret_cast< wxTreeItemId * >(argp2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->CollapseAllChildren((wxTreeItemId const &)*arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_TreeCtrl_CollapseAll(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxPyTreeCtrl *arg1 = (wxPyTreeCtrl *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxPyTreeCtrl, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TreeCtrl_CollapseAll" "', expected argument " "1"" of type '" "wxPyTreeCtrl *""'"); + } + arg1 = reinterpret_cast< wxPyTreeCtrl * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->CollapseAll(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_TreeCtrl_CollapseAndReset(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxPyTreeCtrl *arg1 = (wxPyTreeCtrl *) 0 ; @@ -46312,7 +46450,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SearchCtrl_SetSearchButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { +SWIGINTERN PyObject *_wrap_SearchCtrl_ShowSearchButton(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxSearchCtrl *arg1 = (wxSearchCtrl *) 0 ; bool arg2 ; @@ -46326,20 +46464,20 @@ SWIGINTERN PyObject *_wrap_SearchCtrl_SetSearchButtonVisible(PyObject *SWIGUNUSE (char *) "self",(char *) "show", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SearchCtrl_SetSearchButtonVisible",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SearchCtrl_ShowSearchButton",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSearchCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_SetSearchButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_ShowSearchButton" "', expected argument " "1"" of type '" "wxSearchCtrl *""'"); } arg1 = reinterpret_cast< wxSearchCtrl * >(argp1); ecode2 = SWIG_AsVal_bool(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SearchCtrl_SetSearchButtonVisible" "', expected argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SearchCtrl_ShowSearchButton" "', expected argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetSearchButtonVisible(arg2); + (arg1)->ShowSearchButton(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -46350,7 +46488,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SearchCtrl_GetSearchButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SearchCtrl_IsSearchButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxSearchCtrl *arg1 = (wxSearchCtrl *) 0 ; bool result; @@ -46362,12 +46500,12 @@ SWIGINTERN PyObject *_wrap_SearchCtrl_GetSearchButtonVisible(PyObject *SWIGUNUSE swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxSearchCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_GetSearchButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_IsSearchButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl const *""'"); } arg1 = reinterpret_cast< wxSearchCtrl * >(argp1); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxSearchCtrl const *)arg1)->GetSearchButtonVisible(); + result = (bool)((wxSearchCtrl const *)arg1)->IsSearchButtonVisible(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -46380,7 +46518,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SearchCtrl_SetCancelButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { +SWIGINTERN PyObject *_wrap_SearchCtrl_ShowCancelButton(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxSearchCtrl *arg1 = (wxSearchCtrl *) 0 ; bool arg2 ; @@ -46394,20 +46532,20 @@ SWIGINTERN PyObject *_wrap_SearchCtrl_SetCancelButtonVisible(PyObject *SWIGUNUSE (char *) "self",(char *) "show", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SearchCtrl_SetCancelButtonVisible",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SearchCtrl_ShowCancelButton",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSearchCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_SetCancelButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_ShowCancelButton" "', expected argument " "1"" of type '" "wxSearchCtrl *""'"); } arg1 = reinterpret_cast< wxSearchCtrl * >(argp1); ecode2 = SWIG_AsVal_bool(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SearchCtrl_SetCancelButtonVisible" "', expected argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SearchCtrl_ShowCancelButton" "', expected argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetCancelButtonVisible(arg2); + (arg1)->ShowCancelButton(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -46418,7 +46556,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SearchCtrl_GetCancelButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SearchCtrl_IsCancelButtonVisible(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxSearchCtrl *arg1 = (wxSearchCtrl *) 0 ; bool result; @@ -46430,12 +46568,12 @@ SWIGINTERN PyObject *_wrap_SearchCtrl_GetCancelButtonVisible(PyObject *SWIGUNUSE swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxSearchCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_GetCancelButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SearchCtrl_IsCancelButtonVisible" "', expected argument " "1"" of type '" "wxSearchCtrl const *""'"); } arg1 = reinterpret_cast< wxSearchCtrl * >(argp1); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxSearchCtrl const *)arg1)->GetCancelButtonVisible(); + result = (bool)((wxSearchCtrl const *)arg1)->IsCancelButtonVisible(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -47385,6 +47523,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"TreeCtrl_IsExpanded", (PyCFunction) _wrap_TreeCtrl_IsExpanded, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_IsSelected", (PyCFunction) _wrap_TreeCtrl_IsSelected, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_IsBold", (PyCFunction) _wrap_TreeCtrl_IsBold, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"TreeCtrl_IsEmpty", (PyCFunction)_wrap_TreeCtrl_IsEmpty, METH_O, NULL}, { (char *)"TreeCtrl_GetChildrenCount", (PyCFunction) _wrap_TreeCtrl_GetChildrenCount, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_GetRootItem", (PyCFunction)_wrap_TreeCtrl_GetRootItem, METH_O, NULL}, { (char *)"TreeCtrl_GetSelection", (PyCFunction)_wrap_TreeCtrl_GetSelection, METH_O, NULL}, @@ -47410,6 +47549,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"TreeCtrl_ExpandAllChildren", (PyCFunction) _wrap_TreeCtrl_ExpandAllChildren, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_ExpandAll", (PyCFunction)_wrap_TreeCtrl_ExpandAll, METH_O, NULL}, { (char *)"TreeCtrl_Collapse", (PyCFunction) _wrap_TreeCtrl_Collapse, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"TreeCtrl_CollapseAllChildren", (PyCFunction) _wrap_TreeCtrl_CollapseAllChildren, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"TreeCtrl_CollapseAll", (PyCFunction)_wrap_TreeCtrl_CollapseAll, METH_O, NULL}, { (char *)"TreeCtrl_CollapseAndReset", (PyCFunction) _wrap_TreeCtrl_CollapseAndReset, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_Toggle", (PyCFunction) _wrap_TreeCtrl_Toggle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"TreeCtrl_Unselect", (PyCFunction)_wrap_TreeCtrl_Unselect, METH_O, NULL}, @@ -47643,10 +47784,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"SearchCtrl_Create", (PyCFunction) _wrap_SearchCtrl_Create, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"SearchCtrl_SetMenu", (PyCFunction) _wrap_SearchCtrl_SetMenu, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"SearchCtrl_GetMenu", (PyCFunction)_wrap_SearchCtrl_GetMenu, METH_O, NULL}, - { (char *)"SearchCtrl_SetSearchButtonVisible", (PyCFunction) _wrap_SearchCtrl_SetSearchButtonVisible, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SearchCtrl_GetSearchButtonVisible", (PyCFunction)_wrap_SearchCtrl_GetSearchButtonVisible, METH_O, NULL}, - { (char *)"SearchCtrl_SetCancelButtonVisible", (PyCFunction) _wrap_SearchCtrl_SetCancelButtonVisible, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SearchCtrl_GetCancelButtonVisible", (PyCFunction)_wrap_SearchCtrl_GetCancelButtonVisible, METH_O, NULL}, + { (char *)"SearchCtrl_ShowSearchButton", (PyCFunction) _wrap_SearchCtrl_ShowSearchButton, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SearchCtrl_IsSearchButtonVisible", (PyCFunction)_wrap_SearchCtrl_IsSearchButtonVisible, METH_O, NULL}, + { (char *)"SearchCtrl_ShowCancelButton", (PyCFunction) _wrap_SearchCtrl_ShowCancelButton, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SearchCtrl_IsCancelButtonVisible", (PyCFunction)_wrap_SearchCtrl_IsCancelButtonVisible, METH_O, NULL}, { (char *)"SearchCtrl_SetSearchBitmap", (PyCFunction) _wrap_SearchCtrl_SetSearchBitmap, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"SearchCtrl_SetSearchMenuBitmap", (PyCFunction) _wrap_SearchCtrl_SetSearchMenuBitmap, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"SearchCtrl_SetCancelBitmap", (PyCFunction) _wrap_SearchCtrl_SetCancelBitmap, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -50501,7 +50642,7 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "CP_NO_TLW_RESIZE",SWIG_From_int(static_cast< int >(wxCP_NO_TLW_RESIZE))); PyDict_SetItemString(d, "wxEVT_COMMAND_COLLPANE_CHANGED", PyInt_FromLong(wxEVT_COMMAND_COLLPANE_CHANGED)); SWIG_addvarlink(SWIG_globals(),(char*)"SearchCtrlNameStr",SearchCtrlNameStr_get, SearchCtrlNameStr_set); - PyDict_SetItemString(d, "wxEVT_COMMAND_SEARCHCTRL_CANCEL", PyInt_FromLong(wxEVT_COMMAND_SEARCHCTRL_CANCEL)); - PyDict_SetItemString(d, "wxEVT_COMMAND_SEARCHCTRL_SEARCH", PyInt_FromLong(wxEVT_COMMAND_SEARCHCTRL_SEARCH)); + PyDict_SetItemString(d, "wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN", PyInt_FromLong(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN)); + PyDict_SetItemString(d, "wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN", PyInt_FromLong(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN)); }