From: Robin Dunn Date: Wed, 10 Apr 2002 18:39:58 +0000 (+0000) Subject: Changes to match cvs update X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7cdaed0ba00e01b31fe236b270b8a209f3ac8921 Changes to match cvs update git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/setup.py b/wxPython/setup.py index 3a22dfe186..1b820fc713 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree # flags and values that affect this script #---------------------------------------------------------------------- -VERSION = "2.3.3pre2" +VERSION = "2.3.3pre3" DESCRIPTION = "Cross platform GUI toolkit for Python" AUTHOR = "Robin Dunn" AUTHOR_EMAIL = "Robin Dunn " diff --git a/wxPython/src/__version__.py b/wxPython/src/__version__.py index e4ca44172f..c4e95756e0 100644 --- a/wxPython/src/__version__.py +++ b/wxPython/src/__version__.py @@ -1 +1 @@ -ver = '2.3.3pre2' +ver = '2.3.3pre3' diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 35b274bf3a..ab05f012bd 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -451,6 +451,8 @@ enum { wxPD_ESTIMATED_TIME, wxPD_REMAINING_TIME, + wxDD_NEW_DIR_BUTTON, + wxMENU_TEAROFF, wxMB_DOCKABLE, wxNO_FULL_REPAINT_ON_RESIZE, diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 866ab98cf7..d90b2a39f9 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -649,6 +649,8 @@ def wxPyTypeCast(obj, typeStr): #---------------------------------------------------------------------------- +class wxPyDeadObjectError(AttributeError): + pass class _wxPyDeadObject: """ @@ -656,15 +658,21 @@ class _wxPyDeadObject: changed to this class when the C++ object is deleted. This should help prevent crashes due to referencing a bogus C++ pointer. """ + reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" + attrStr = "The C++ %s object has been deleted, attribute access no longer allowed." + def __repr__( self ): if not hasattr(self, "_name"): self._name = "[unknown]" - return 'wxPython wrapper for deleted %s object!!! Programming logic error' % self._name + return self.reprStr % self._name def __getattr__( self, *args ): if not hasattr(self, "_name"): self._name = "[unknown]" - raise ValueError, 'Attempt to access attribute of a deleted %s object' % self._name + raise wxPyDeadObjectError( self.attrStr % self._name ) + + def __nonzero__(self): + return 0 #---------------------------------------------------------------------- diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 36512cc58b..6b8b0c031d 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -1325,7 +1325,7 @@ enum { wxDIRCTRL_SELECT_FIRST, wxDIRCTRL_SHOW_FILTERS, wxDIRCTRL_3D_INTERNAL, - wxDIRCTRL_EDITABLE, + wxDIRCTRL_EDIT_LABELS, wxID_TREECTRL, wxID_FILTERLISTCTRL, diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index f6bbdd5a4b..92f95b87da 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -71,9 +71,11 @@ public: %addmethods { PyObject* asTuple() { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } @@ -112,9 +114,11 @@ public: self->y = y; } PyObject* asTuple() { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); + wxPyEndBlockThreads(); return tup; } @@ -160,9 +164,11 @@ public: self->y = y; } PyObject* asTuple() { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } @@ -232,11 +238,13 @@ public: %addmethods { PyObject* asTuple() { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(4); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); + wxPyEndBlockThreads(); return tup; } diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index b55b4f6bed..5747f5774b 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -55,7 +55,7 @@ // Put some wx default wxChar* values into wxStrings. DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); - + DECLARE_DEF_STRING(DirSelectorPromptStr); static const wxString wxPyEmptyString(wxT("")); %} @@ -83,6 +83,13 @@ wxString wxSaveFileSelector(const wxString& what, const wxString& default_name = wxPyEmptyString, wxWindow *parent = NULL); + +wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr, + const wxString& defaultPath = wxPyEmptyString, + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON, + const wxPoint& pos = wxDefaultPosition, + wxWindow *parent = NULL); + wxString wxGetTextFromUser(const wxString& message, const wxString& caption = wxPyEmptyString, const wxString& default_value = wxPyEmptyString, diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index 8e514a4f4f..1a3105755e 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -11381,7 +11381,7 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxDIRCTRL_SELECT_FIRST", PyInt_FromLong((long) wxDIRCTRL_SELECT_FIRST)); PyDict_SetItemString(d,"wxDIRCTRL_SHOW_FILTERS", PyInt_FromLong((long) wxDIRCTRL_SHOW_FILTERS)); PyDict_SetItemString(d,"wxDIRCTRL_3D_INTERNAL", PyInt_FromLong((long) wxDIRCTRL_3D_INTERNAL)); - PyDict_SetItemString(d,"wxDIRCTRL_EDITABLE", PyInt_FromLong((long) wxDIRCTRL_EDITABLE)); + PyDict_SetItemString(d,"wxDIRCTRL_EDIT_LABELS", PyInt_FromLong((long) wxDIRCTRL_EDIT_LABELS)); PyDict_SetItemString(d,"wxID_TREECTRL", PyInt_FromLong((long) wxID_TREECTRL)); PyDict_SetItemString(d,"wxID_FILTERLISTCTRL", PyInt_FromLong((long) wxID_FILTERLISTCTRL)); diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index f5dc4bd723..7f39893d1b 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -1433,6 +1433,6 @@ wxDIRCTRL_DIR_ONLY = controls2c.wxDIRCTRL_DIR_ONLY wxDIRCTRL_SELECT_FIRST = controls2c.wxDIRCTRL_SELECT_FIRST wxDIRCTRL_SHOW_FILTERS = controls2c.wxDIRCTRL_SHOW_FILTERS wxDIRCTRL_3D_INTERNAL = controls2c.wxDIRCTRL_3D_INTERNAL -wxDIRCTRL_EDITABLE = controls2c.wxDIRCTRL_EDITABLE +wxDIRCTRL_EDIT_LABELS = controls2c.wxDIRCTRL_EDIT_LABELS wxID_TREECTRL = controls2c.wxID_TREECTRL wxID_FILTERLISTCTRL = controls2c.wxID_FILTERLISTCTRL diff --git a/wxPython/src/msw/misc.cpp b/wxPython/src/msw/misc.cpp index 89171c959a..759a027a96 100644 --- a/wxPython/src/msw/misc.cpp +++ b/wxPython/src/msw/misc.cpp @@ -1401,9 +1401,11 @@ static PyObject *_wrap_wxSize_SetHeight(PyObject *self, PyObject *args, PyObject } static PyObject * wxSize_asTuple(wxSize *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxSize_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -1671,9 +1673,11 @@ static PyObject *_wrap_wxRealPoint_Set(PyObject *self, PyObject *args, PyObject } static PyObject * wxRealPoint_asTuple(wxRealPoint *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxRealPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -2021,9 +2025,11 @@ static PyObject *_wrap_wxPoint_Set(PyObject *self, PyObject *args, PyObject *kwa } static PyObject * wxPoint_asTuple(wxPoint *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -3007,11 +3013,13 @@ static PyObject *_wrap_wxRect_height_get(PyObject *self, PyObject *args, PyObjec } static PyObject * wxRect_asTuple(wxRect *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(4); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxRect_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 637a467910..dd7589bd7d 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -103,7 +103,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { // Put some wx default wxChar* values into wxStrings. DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); - + DECLARE_DEF_STRING(DirSelectorPromptStr); static const wxString wxPyEmptyString(wxT("")); int wxCaret_GetBlinkTime() { @@ -515,6 +515,76 @@ static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObje return _resultobj; } +static PyObject *_wrap_wxDirSelector(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxString * _arg0 = (wxString *) &wxPyDirSelectorPromptStr; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + long _arg2 = (long ) wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxDD_NEW_DIR_BUTTON; + wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; + wxWindow * _arg4 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + wxPoint temp; + PyObject * _obj3 = 0; + PyObject * _argo4 = 0; + char *_kwnames[] = { "message","defaultPath","style","pos","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOlOO:wxDirSelector",_kwnames,&_obj0,&_obj1,&_arg2,&_obj3,&_argo4)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = &temp; + if (! wxPoint_helper(_obj3, &_arg3)) + return NULL; +} + if (_argo4) { + if (_argo4 == Py_None) { _arg4 = NULL; } + else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxDirSelector. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDirSelector(*_arg0,*_arg1,_arg2,*_arg3,_arg4)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} + return _resultobj; +} + static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; @@ -10056,6 +10126,7 @@ static PyMethodDef misc2cMethods[] = { { "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS }, { "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS }, + { "wxDirSelector", (PyCFunction) _wrap_wxDirSelector, METH_VARARGS | METH_KEYWORDS }, { "wxSaveFileSelector", (PyCFunction) _wrap_wxSaveFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxLoadFileSelector", (PyCFunction) _wrap_wxLoadFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index eb62a3da29..0895ab25a5 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -963,6 +963,8 @@ wxLoadFileSelector = misc2c.wxLoadFileSelector wxSaveFileSelector = misc2c.wxSaveFileSelector +wxDirSelector = misc2c.wxDirSelector + wxGetTextFromUser = misc2c.wxGetTextFromUser wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 7d73f40df8..07996bab6b 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -2129,6 +2129,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxPD_ELAPSED_TIME", PyInt_FromLong((long) wxPD_ELAPSED_TIME)); PyDict_SetItemString(d,"wxPD_ESTIMATED_TIME", PyInt_FromLong((long) wxPD_ESTIMATED_TIME)); PyDict_SetItemString(d,"wxPD_REMAINING_TIME", PyInt_FromLong((long) wxPD_REMAINING_TIME)); + PyDict_SetItemString(d,"wxDD_NEW_DIR_BUTTON", PyInt_FromLong((long) wxDD_NEW_DIR_BUTTON)); PyDict_SetItemString(d,"wxMENU_TEAROFF", PyInt_FromLong((long) wxMENU_TEAROFF)); PyDict_SetItemString(d,"wxMB_DOCKABLE", PyInt_FromLong((long) wxMB_DOCKABLE)); PyDict_SetItemString(d,"wxNO_FULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxNO_FULL_REPAINT_ON_RESIZE)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 35e1ba43d2..98c8598aee 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -415,6 +415,7 @@ wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT wxPD_ELAPSED_TIME = wxc.wxPD_ELAPSED_TIME wxPD_ESTIMATED_TIME = wxc.wxPD_ESTIMATED_TIME wxPD_REMAINING_TIME = wxc.wxPD_REMAINING_TIME +wxDD_NEW_DIR_BUTTON = wxc.wxDD_NEW_DIR_BUTTON wxMENU_TEAROFF = wxc.wxMENU_TEAROFF wxMB_DOCKABLE = wxc.wxMB_DOCKABLE wxNO_FULL_REPAINT_ON_RESIZE = wxc.wxNO_FULL_REPAINT_ON_RESIZE @@ -1556,6 +1557,8 @@ def wxPyTypeCast(obj, typeStr): #---------------------------------------------------------------------------- +class wxPyDeadObjectError(AttributeError): + pass class _wxPyDeadObject: """ @@ -1563,15 +1566,21 @@ class _wxPyDeadObject: changed to this class when the C++ object is deleted. This should help prevent crashes due to referencing a bogus C++ pointer. """ + reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" + attrStr = "The C++ %s object has been deleted, attribute access no longer allowed." + def __repr__( self ): if not hasattr(self, "_name"): self._name = "[unknown]" - return 'wxPython wrapper for deleted %s object!!! Programming logic error' % self._name + return self.reprStr % self._name def __getattr__( self, *args ): if not hasattr(self, "_name"): self._name = "[unknown]" - raise ValueError, 'Attempt to access attribute of a deleted %s object' % self._name + raise wxPyDeadObjectError( self.attrStr % self._name ) + + def __nonzero__(self): + return 0 #---------------------------------------------------------------------- diff --git a/wxPython/src/wx.i b/wxPython/src/wx.i index 351c6e4bb1..27d5a3d51a 100644 --- a/wxPython/src/wx.i +++ b/wxPython/src/wx.i @@ -12,6 +12,7 @@ %module wx + %{ #include "helpers.h" %}