Allow manual repositioning of ProjGroup views

This commit is contained in:
WandererFan
2016-10-27 13:53:57 -04:00
committed by Yorik van Havre
parent 70b5c241d1
commit cd87af3746
8 changed files with 109 additions and 59 deletions

View File

@@ -29,6 +29,7 @@
#include <Base/Console.h>
#include <Base/Writer.h>
#include "DrawProjGroup.h"
#include "DrawProjGroupItem.h"
#include <Mod/TechDraw/App/DrawProjGroupItemPy.h> // generated from DrawProjGroupItemPy.xml
@@ -87,13 +88,25 @@ DrawProjGroupItem::~DrawProjGroupItem()
void DrawProjGroupItem::onDocumentRestored()
{
setAutoPos(false); //if restoring from file, use X,Y from file, not auto!
// setAutoPos(false); //if restoring from file, use X,Y from file, not auto!
App::DocumentObjectExecReturn* rc = DrawProjGroupItem::execute();
if (rc) {
delete rc;
}
}
DrawProjGroup* DrawProjGroupItem::getGroup()
{
DrawProjGroup* result = nullptr;
std::vector<App::DocumentObject*> parent = getInList();
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawProjGroup::getClassTypeId())) {
result = dynamic_cast<TechDraw::DrawProjGroup *>(*it);
break;
}
}
return result;
}
PyObject *DrawProjGroupItem::getPyObject(void)
{