A few little tweaks, reswigged code for wxMac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2002-05-17 05:36:40 +00:00
parent 8721cada6f
commit 70b76c7ccd
8 changed files with 137 additions and 3 deletions

View File

@ -3,6 +3,8 @@
.gdb_history
MANIFEST
build
build-pkg
build-pkg-debug
build.local
build.unicode
dist

View 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 },

View 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):

View 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 },

View 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

View 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},

View 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

View 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();