]> git.saurik.com Git - wxWidgets.git/commitdiff
A few little tweaks, reswigged code for wxMac
authorRobin Dunn <robin@alldunn.com>
Fri, 17 May 2002 05:36:40 +0000 (05:36 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 17 May 2002 05:36:40 +0000 (05:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/.cvsignore
wxPython/src/mac/gdi.cpp
wxPython/src/mac/gdi.py
wxPython/src/mac/windows.cpp
wxPython/src/mac/windows.py
wxPython/src/mac/windows2.cpp
wxPython/src/mac/windows2.py
wxPython/src/windows.i

index 29d2d156e520bf277233520645bf4db1d1376013..4cc360759b244755b36f6f267b7dcd98ddd555be 100644 (file)
@@ -3,6 +3,8 @@
 .gdb_history
 MANIFEST
 build
+build-pkg
+build-pkg-debug
 build.local
 build.unicode
 dist
index 64db70d54ec746940a34487e60d6ec285487578c..8b65db226dd82655efd2ad6d03e8f11feec480a4 100644 (file)
@@ -3573,6 +3573,45 @@ static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject
     return _resultobj;
 }
 
+static PyObject * wxPen_GetDashes(wxPen *self) {
+            wxDash* dashes;
+            int count = self->GetDashes(&dashes);
+            wxPyBeginBlockThreads();
+            PyObject* retval = PyList_New(0);
+            for (int x=0; x<count; x++)
+                PyList_Append(retval, PyInt_FromLong(dashes[x]));
+            wxPyEndBlockThreads();
+            return retval;
+        }
+static PyObject *_wrap_wxPen_GetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    PyObject * _result;
+    wxPen * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPen_GetDashes",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_GetDashes. Expected _wxPen_p.");
+        return NULL;
+        }
+    }
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (PyObject *)wxPen_GetDashes(_arg0);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}{
+  _resultobj = _result;
+}
+    return _resultobj;
+}
+
 static void *SwigwxPyPenTowxPen(void *ptr) {
     wxPyPen *src;
     wxPen *dest;
@@ -10155,6 +10194,7 @@ static PyMethodDef gdicMethods[] = {
         { "wxPyPen_SetDashes", (PyCFunction) _wrap_wxPyPen_SetDashes, METH_VARARGS | METH_KEYWORDS },
         { "delete_wxPyPen", (PyCFunction) _wrap_delete_wxPyPen, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPyPen", (PyCFunction) _wrap_new_wxPyPen, METH_VARARGS | METH_KEYWORDS },
+        { "wxPen_GetDashes", (PyCFunction) _wrap_wxPen_GetDashes, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetDashes", (PyCFunction) _wrap_wxPen_SetDashes, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetWidth", (PyCFunction) _wrap_wxPen_SetWidth, METH_VARARGS | METH_KEYWORDS },
         { "wxPen_SetStyle", (PyCFunction) _wrap_wxPen_SetStyle, METH_VARARGS | METH_KEYWORDS },
index 1d3121d918f7fe7dc9dc084a68c972f34ab8ef7b..544e64f2a74779f57ae6c640100f231a3440503c 100644 (file)
@@ -327,6 +327,9 @@ class wxPenPtr(wxGDIObjectPtr):
     def SetDashes(self, *_args, **_kwargs):
         val = apply(gdic.wxPen_SetDashes,(self,) + _args, _kwargs)
         return val
+    def GetDashes(self, *_args, **_kwargs):
+        val = apply(gdic.wxPen_GetDashes,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxPen instance at %s>" % (self.this,)
 class wxPen(wxPenPtr):
index cc0eedb6bd6aa9c2e2d6ac4029030c66413d886e..e890c28df408d15d4c2208a8315dcaea21ba60f4 100644 (file)
@@ -5444,6 +5444,78 @@ static PyObject *_wrap_wxWindow_SetValidator(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
+#define wxWindow_SetDropTarget(_swigobj,_swigarg0)  (_swigobj->SetDropTarget(_swigarg0))
+static PyObject *_wrap_wxWindow_SetDropTarget(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    wxDropTarget * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _argo1 = 0;
+    char *_kwnames[] = { "self","target", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetDropTarget",_kwnames,&_argo0,&_argo1)) 
+        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 wxWindow_SetDropTarget. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+    if (_argo1) {
+        if (_argo1 == Py_None) { _arg1 = NULL; }
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDropTarget_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetDropTarget. Expected _wxDropTarget_p.");
+        return NULL;
+        }
+    }
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxWindow_SetDropTarget(_arg0,_arg1);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+#define wxWindow_GetDropTarget(_swigobj)  (_swigobj->GetDropTarget())
+static PyObject *_wrap_wxWindow_GetDropTarget(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxDropTarget * _result;
+    wxWindow * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetDropTarget",_kwnames,&_argo0)) 
+        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 wxWindow_GetDropTarget. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxDropTarget *)wxWindow_GetDropTarget(_arg0);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxDropTarget_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
 #define wxWindow_GetBestSize(_swigobj)  (_swigobj->GetBestSize())
 static PyObject *_wrap_wxWindow_GetBestSize(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -11155,6 +11227,8 @@ static PyMethodDef windowscMethods[] = {
         { "wxWindow_SetCaret", (PyCFunction) _wrap_wxWindow_SetCaret, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetMaxSize", (PyCFunction) _wrap_wxWindow_GetMaxSize, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetBestSize", (PyCFunction) _wrap_wxWindow_GetBestSize, METH_VARARGS | METH_KEYWORDS },
+        { "wxWindow_GetDropTarget", (PyCFunction) _wrap_wxWindow_GetDropTarget, METH_VARARGS | METH_KEYWORDS },
+        { "wxWindow_SetDropTarget", (PyCFunction) _wrap_wxWindow_SetDropTarget, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_SetValidator", (PyCFunction) _wrap_wxWindow_SetValidator, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetValidator", (PyCFunction) _wrap_wxWindow_GetValidator, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetContainingSizer", (PyCFunction) _wrap_wxWindow_GetContainingSizer, METH_VARARGS | METH_KEYWORDS },
index 92b0297ea17a91fa3e5a5d832a494a4b99f53ba4..1803ef9da0f2b4cc5695cbb96ba6568fb52ca934 100644 (file)
@@ -538,6 +538,14 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def SetValidator(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_SetValidator,(self,) + _args, _kwargs)
         return val
+    def SetDropTarget(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_SetDropTarget,(self,) + _args, _kwargs)
+        _args[0].thisown = 0
+        return val
+    def GetDropTarget(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_GetDropTarget,(self,) + _args, _kwargs)
+        if val: val = wxDropTargetPtr(val) 
+        return val
     def GetBestSize(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_GetBestSize,(self,) + _args, _kwargs)
         if val: val = wxSizePtr(val) ; val.thisown = 1
index 1c074ff967b3595db32f7fbb185ec8d0aaa2594f..2d5bd8b25c3684361825442af44c6758d9c67347 100644 (file)
@@ -1177,6 +1177,14 @@ static PyObject *_wrap_wxNotebook_ResizeChildren(PyObject *self, PyObject *args,
     return _resultobj;
 }
 
+static void *SwigwxSplitterEventTowxNotifyEvent(void *ptr) {
+    wxSplitterEvent *src;
+    wxNotifyEvent *dest;
+    src = (wxSplitterEvent *) ptr;
+    dest = (wxNotifyEvent *) src;
+    return (void *) dest;
+}
+
 static void *SwigwxSplitterEventTowxCommandEvent(void *ptr) {
     wxSplitterEvent *src;
     wxCommandEvent *dest;
@@ -2318,6 +2326,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
+    { "_wxNotifyEvent","_wxSplitterEvent",SwigwxSplitterEventTowxNotifyEvent},
     { "_wxNotifyEvent","_wxNotebookEvent",SwigwxNotebookEventTowxNotifyEvent},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
index 66c94cadc6ef0fef633e021a632223cdea51b53f..539b0ab9951a4ea0296d97d7cc12bf1e8cb53438 100644 (file)
@@ -129,7 +129,7 @@ def wxPreNotebook(*_args,**_kwargs):
     return val
 
 
-class wxSplitterEventPtr(wxCommandEventPtr):
+class wxSplitterEventPtr(wxNotifyEventPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
index 23986b87fee2a56f7b0457ed7f95eba27a92dc7d..02691bed551d56ac00a350e8e73caf67d4969d67 100644 (file)
@@ -399,11 +399,9 @@ public:
     wxValidator* GetValidator();
     void SetValidator(const wxValidator& validator);
 
-#ifndef __WXMAC__
     void SetDropTarget(wxDropTarget* target);
     wxDropTarget* GetDropTarget();
     %pragma(python) addtomethod = "SetDropTarget:_args[0].thisown = 0"
-#endif
 
     wxSize GetBestSize();
     wxSize GetMaxSize();