X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fgenericgui%2FGuiEditor.cxx;h=c50a41dda7e654fa9519e829a813650acd5e2086;hb=884c24e399ddcf623cee5d6d7136a06255b6f3f0;hp=38912b874d6d4f16af3a37098cd7b55d9e9ae707;hpb=fcda1e43b882f71152979245e3671b4688337568;p=modules%2Fyacs.git diff --git a/src/genericgui/GuiEditor.cxx b/src/genericgui/GuiEditor.cxx index 38912b874..c50a41dda 100644 --- a/src/genericgui/GuiEditor.cxx +++ b/src/genericgui/GuiEditor.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2006-2013 CEA/DEN, EDF R&D +// Copyright (C) 2006-2014 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -372,7 +372,7 @@ SubjectDataPort* GuiEditor::CreateOutputPort(SubjectElementaryNode* seNode, /*! * Subject shrink or expand, command from popup menu: needs a valid selection */ -void GuiEditor::shrinkExpand() { +void GuiEditor::shrinkExpand(Qt::KeyboardModifiers kbModifiers) { DEBTRACE("GuiEditor::shrinkExpand"); Subject* sub = QtGuiContext::getQtCurrent()->getSelectedSubject(); @@ -393,12 +393,14 @@ void GuiEditor::shrinkExpand() { return; }; - if (sni->isExpanded()) { - sni->setExpanded(false); - } else { - sni->setExpanded(true); - }; - sni->reorganizeShrinkExpand(); + ShrinkMode aShrinkMode = CurrentNode; + if (kbModifiers == Qt::ControlModifier) { + aShrinkMode = ElementaryNodes; + } else if (kbModifiers == (Qt::ShiftModifier|Qt::ControlModifier)) { + aShrinkMode = ChildrenNodes; + } + + sni->reorganizeShrinkExpand(aShrinkMode); sni->showOutScopeLinks(); sni->updateLinks(); } @@ -580,7 +582,7 @@ std::string GuiEditor::PutGraphInBloc() std::string blocname = tryname.str(); //put one by one the child nodes of Proc node into a new Bloc node - std::map> aMapOfNodePosition; + std::map< std::string, std::pair > aMapOfNodePosition; SceneItem *item = 0; SceneNodeItem *inode = 0; SubjectNode * snode = 0;