]> git.saurik.com Git - wxWidgets.git/commitdiff
Changes to match cvs update
authorRobin Dunn <robin@alldunn.com>
Wed, 10 Apr 2002 18:39:58 +0000 (18:39 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 10 Apr 2002 18:39:58 +0000 (18:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
wxPython/setup.py
wxPython/src/__version__.py
wxPython/src/_defs.i
wxPython/src/_extras.py
wxPython/src/controls2.i
wxPython/src/misc.i
wxPython/src/misc2.i
wxPython/src/msw/controls2.cpp
wxPython/src/msw/controls2.py
wxPython/src/msw/misc.cpp
wxPython/src/msw/misc2.cpp
wxPython/src/msw/misc2.py
wxPython/src/msw/wx.cpp
wxPython/src/msw/wx.py
wxPython/src/wx.i

index 3a22dfe18638293b1ec2d74c5274871fc1ae0bf9..1b820fc7132b20b3a5a6bc5aba08272d46e06525 100755 (executable)
@@ -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 <robin@alldunn.com>"
index e4ca44172f7a20ddb4d07226942a0ca13fc3cc53..c4e95756e02b99111f2c08be0c3053ea14ab653c 100644 (file)
@@ -1 +1 @@
-ver = '2.3.3pre2'
+ver = '2.3.3pre3'
index 35b274bf3a6c3b5ccc0b13a11912bb6392557769..ab05f012bd2c291c4f44f9e244185a4dabbd3400 100644 (file)
@@ -451,6 +451,8 @@ enum {
     wxPD_ESTIMATED_TIME,
     wxPD_REMAINING_TIME,
 
+    wxDD_NEW_DIR_BUTTON,
+
     wxMENU_TEAROFF,
     wxMB_DOCKABLE,
     wxNO_FULL_REPAINT_ON_RESIZE,
index 866ab98cf77522bdcbc559111cd06925fa73e42f..d90b2a39f94d3e0667b40c14fda9409b8f67b740 100644 (file)
@@ -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
 
 
 #----------------------------------------------------------------------
index 36512cc58bcefb6edb0c492ee4903f52adef4f4b..6b8b0c031dafbb498bba906c8efa197019e323da 100644 (file)
@@ -1325,7 +1325,7 @@ enum {
     wxDIRCTRL_SELECT_FIRST,
     wxDIRCTRL_SHOW_FILTERS,
     wxDIRCTRL_3D_INTERNAL,
-    wxDIRCTRL_EDITABLE,
+    wxDIRCTRL_EDIT_LABELS,
 
     wxID_TREECTRL,
     wxID_FILTERLISTCTRL,
index f6bbdd5a4b1a73f419ac2cd0e50a8b92ec5157cf..92f95b87da5c0080f28f925d04f5d422664a434c 100644 (file)
@@ -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;
         }
 
index b55b4f6bed9835cd6fdb220d60674300bd59a3a0..5747f5774b1630d3aa630aa60d43563e5e9bfbb5 100644 (file)
@@ -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,
index 8e514a4f4f3ed4b475b662538c48900c0c506da4..1a3105755e5ea8a1ea064d3cc05bbbc1362cd68d 100644 (file)
@@ -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));
 
index f5dc4bd723805e691ee034ad8b5849119ec29d89..7f39893d1b6e21f0c2b7a02a5b17d8489d48fa29 100644 (file)
@@ -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
index 89171c959a6102bd83d114ae0dd8ace6deeea9c1..759a027a96eeea79265364ee9b8cd124cf3c1da6 100644 (file)
@@ -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) {
index 637a46791009ffdfcc5596ac187ebb0de19689f4..dd7589bd7dbdb7835732e87e0cb178c21851d20b 100644 (file)
@@ -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 },
index eb62a3da295de6452afaf2bbf08739f64df0c8ea..0895ab25a5b1361a860c532bda376578be39bf5c 100644 (file)
@@ -963,6 +963,8 @@ wxLoadFileSelector = misc2c.wxLoadFileSelector
 
 wxSaveFileSelector = misc2c.wxSaveFileSelector
 
+wxDirSelector = misc2c.wxDirSelector
+
 wxGetTextFromUser = misc2c.wxGetTextFromUser
 
 wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser
index 7d73f40df89169b60477104fd8d138fab984ddf3..07996bab6bfb37bac98d4b1d02f144de5646a192 100644 (file)
@@ -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));
index 35e1ba43d29fddaed3d77539f1162cbc8cd11c82..98c8598aeedaccee9fcaf0b82bdddaf42a52613c 100644 (file)
@@ -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
 
 
 #----------------------------------------------------------------------
index 351c6e4bb1812c8c4f46d592f4e92c35f1b70029..27d5a3d51a43db186df05acb31f49daacbef2a4e 100644 (file)
@@ -12,6 +12,7 @@
 
 %module wx
 
+
 %{
 #include "helpers.h"
 %}