better active part and document tip handling

This commit is contained in:
Stefan Tröger
2015-06-05 11:09:09 +02:00
parent d435e15a97
commit 7f80e711f6
5 changed files with 32 additions and 5 deletions

View File

@@ -170,17 +170,21 @@ void ViewProviderPart::onObjectChanged(const App::DocumentObject& obj, const App
bool ViewProviderPart::doubleClicked(void)
{
if(Workbench.getValue() != "")
// assure the PartDesign workbench
// assure the given workbench
Gui::Command::assureWorkbench( Workbench.getValue() );
//make the part the active one
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('%s', App.activeDocument().%s)", PARTKEY, this->getObject()->getNameInDocument());
return true;
}
bool ViewProviderPart::onDelete(const std::vector<std::string> &)
{
//Gui::Command::doCommand(Gui::Command::Doc,"App.getDocument(\"%s\").getObject(\"%s\").removeObjectsFromDocument()"
// ,getObject()->getDocument()->getName(), getObject()->getNameInDocument());
if(getActiveView()->getActiveObject<App::Part*>(PARTKEY) == getObject())
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('%s', None)", PARTKEY);
return true;
}