Fix #2692 TaskProjectGroup cancel button

This commit is contained in:
WandererFan
2016-09-09 12:52:57 -04:00
parent 81472a5fd8
commit 254b28ea77
15 changed files with 284 additions and 101 deletions

View File

@@ -14,6 +14,41 @@ std::string DrawViewCollectionPy::representation(void) const
{
return std::string("<DrawViewCollection object>");
}
PyObject* DrawViewCollectionPy::addView(PyObject* args)
{
PyObject *pcDocObj;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &pcDocObj)) {
Base::Console().Error("Error: DrawViewClipPy::addView - Bad Arg - not DocumentObject\n");
return NULL;
}
DrawViewCollection* collect = getDrawViewCollectionPtr();
DrawViewPy* pyView = static_cast<TechDraw::DrawViewPy*>(pcDocObj);
DrawView* view = pyView->getDrawViewPtr(); //get DrawView for pyView
int i = collect->addView(view);
return PyInt_FromLong((long) i);
}
PyObject* DrawViewCollectionPy::removeView(PyObject* args)
{
PyObject *pcDocObj;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &pcDocObj)) {
Base::Console().Error("Error: DrawViewClipPy::addView - Bad Arg - not DocumentObject\n");
return NULL;
}
DrawViewCollection* collect = getDrawViewCollectionPtr();
DrawViewPy* pyView = static_cast<TechDraw::DrawViewPy*>(pcDocObj);
DrawView* view = pyView->getDrawViewPtr(); //get DrawView for pyView
int i = collect->removeView(view);
return PyInt_FromLong((long) i);
}
PyObject *DrawViewCollectionPy::getCustomAttributes(const char* /*attr*/) const