TechDraw: Enable dragging and dropping of views between pages.
This commit is contained in:
committed by
WandererFan
parent
f5a5b6646b
commit
843dd55dd4
@@ -71,6 +71,22 @@ bool ViewProviderPageExtension::extensionCanDropObject(App::DocumentObject* obj)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ViewProviderPageExtension::extensionCanDropObjectEx(App::DocumentObject* obj, App::DocumentObject* owner,
|
||||
const char* subname,
|
||||
const std::vector<std::string>& elements) const
|
||||
{
|
||||
//only DrawView objects can live on pages (except special case Template)
|
||||
if (obj->isDerivedFrom(TechDraw::DrawView::getClassTypeId())) {
|
||||
return true;
|
||||
}
|
||||
if (obj->isDerivedFrom(TechDraw::DrawTemplate::getClassTypeId())) {
|
||||
//don't let another extension try to drop templates
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ViewProviderPageExtension::extensionDropObject(App::DocumentObject* obj)
|
||||
{
|
||||
if (obj->isDerivedFrom(TechDraw::DrawView::getClassTypeId())) {
|
||||
|
||||
@@ -46,6 +46,9 @@ public:
|
||||
void extensionDragObject(App::DocumentObject*) override;
|
||||
bool extensionCanDropObjects() const override;
|
||||
bool extensionCanDropObject(App::DocumentObject*) const override;
|
||||
bool extensionCanDropObjectEx(App::DocumentObject* obj, App::DocumentObject* owner,
|
||||
const char* subname,
|
||||
const std::vector<std::string>& elements) const override;
|
||||
void extensionDropObject(App::DocumentObject*) override;
|
||||
|
||||
void dropObject(App::DocumentObject* docObj);
|
||||
|
||||
Reference in New Issue
Block a user