Allow manual repositioning of ProjGroup views
This commit is contained in:
committed by
Yorik van Havre
parent
70b5c241d1
commit
cd87af3746
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user