Some minor updates and fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-02-16 05:57:16 +00:00
parent 2e002aa906
commit 714d23b44b
10 changed files with 275 additions and 91 deletions
File diff suppressed because it is too large Load Diff
+25 -4
View File
@@ -233,8 +233,29 @@ public:
long GetId();
void SetPen(wxPen *pen);
void SetBrush(wxBrush *brush);
void SetClientData(wxObject *client_data);
wxObject *GetClientData() ;
// void SetClientData(wxObject *client_data);
// wxObject *GetClientData();
%addmethods {
void SetClientData(PyObject* userData) {
wxPyUserData* data = NULL;
if (userData)
data = new wxPyUserData(userData);
self->SetClientData(data);
}
PyObject* GetClientData() {
wxPyUserData* data = (wxPyUserData*)self->GetClientData();
if (data) {
Py_INCREF(data->m_obj);
return data->m_obj;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
}
void Show(bool show);
bool IsShown();
void Move(wxDC& dc, double x1, double y1, bool display = TRUE);
@@ -294,11 +315,11 @@ public:
void ReadRegions(wxExpr *clause);
#endif
bool GetAttachmentPosition(int attachment, double *x, double *y,
bool GetAttachmentPosition(int attachment, double *OUTPUT, double *OUTPUT,
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
int GetNumberOfAttachments();
bool AttachmentIsValid(int attachment);
bool GetAttachmentPositionEdge(int attachment, double *x, double *y,
bool GetAttachmentPositionEdge(int attachment, double *OUTPUT, double *OUTPUT,
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
int nth, int noArcs, wxPyLineShape* line);
+2
View File
@@ -9,6 +9,8 @@ from windows import *
from gdi import *
from clip_dnd import *
from events import *
from mdi import *
+55
View File
@@ -7577,6 +7577,60 @@ static PyObject *_wrap_wxPyCompositeShape_AddConstraint(PyObject *self, PyObject
return _resultobj;
}
static wxOGLConstraint * wxPyCompositeShape_AddConstrainedShapes(wxPyCompositeShape *self,int type,wxPyShape * constraining,PyObject * constrained) {
wxList* list = wxPy_wxListHelper(constrained, "wxPyShape");
wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
delete list;
return rv;
}
static PyObject *_wrap_wxPyCompositeShape_AddConstrainedShapes(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxOGLConstraint * _result;
wxPyCompositeShape * _arg0;
int _arg1;
wxPyShape * _arg2;
PyObject * _arg3;
PyObject * _argo0 = 0;
PyObject * _argo2 = 0;
PyObject * _obj3 = 0;
char *_kwnames[] = { "self","type","constraining","constrained", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOO:wxPyCompositeShape_AddConstrainedShapes",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyCompositeShape_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyCompositeShape_AddConstrainedShapes. Expected _wxPyCompositeShape_p.");
return NULL;
}
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPyShape_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxPyCompositeShape_AddConstrainedShapes. Expected _wxPyShape_p.");
return NULL;
}
}
{
_arg3 = _obj3;
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxOGLConstraint *)wxPyCompositeShape_AddConstrainedShapes(_arg0,_arg1,_arg2,_arg3);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxOGLConstraint_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxPyCompositeShape_AddSimpleConstraint(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->AddConstraint(_swigarg0,_swigarg1,_swigarg2))
static PyObject *_wrap_wxPyCompositeShape_AddSimpleConstraint(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -12179,6 +12233,7 @@ static PyMethodDef oglshapescMethods[] = {
{ "wxPyCompositeShape_ContainsDivision", (PyCFunction) _wrap_wxPyCompositeShape_ContainsDivision, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape_CalculateSize", (PyCFunction) _wrap_wxPyCompositeShape_CalculateSize, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape_AddSimpleConstraint", (PyCFunction) _wrap_wxPyCompositeShape_AddSimpleConstraint, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape_AddConstrainedShapes", (PyCFunction) _wrap_wxPyCompositeShape_AddConstrainedShapes, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape_AddConstraint", (PyCFunction) _wrap_wxPyCompositeShape_AddConstraint, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape_AddChild", (PyCFunction) _wrap_wxPyCompositeShape_AddChild, METH_VARARGS | METH_KEYWORDS },
{ "wxPyCompositeShape__setSelf", (PyCFunction) _wrap_wxPyCompositeShape__setSelf, METH_VARARGS | METH_KEYWORDS },
+10 -1
View File
@@ -364,10 +364,19 @@ public:
wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
// **** Needs a typemap
//wxOGLConstraint * AddConstraint(int type,
// wxPyShape *constraining,
// wxList& constrained);
%addmethods {
wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
PyObject* constrained) {
wxList* list = wxPy_wxListHelper(constrained, "wxPyShape");
wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
delete list;
return rv;
}
}
%name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type,
wxPyShape *constraining,
+4
View File
@@ -743,6 +743,10 @@ class wxPyCompositeShapePtr(wxPyRectangleShapePtr):
val = apply(oglshapesc.wxPyCompositeShape_AddConstraint,(self,) + _args, _kwargs)
if val: val = wxOGLConstraintPtr(val)
return val
def AddConstrainedShapes(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPyCompositeShape_AddConstrainedShapes,(self,) + _args, _kwargs)
if val: val = wxOGLConstraintPtr(val)
return val
def AddSimpleConstraint(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPyCompositeShape_AddSimpleConstraint,(self,) + _args, _kwargs)
if val: val = wxOGLConstraintPtr(val)