X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fgenericgui%2FGenericGui.cxx;h=16d08646d96d66c6e6430e8d03481e9cdbd2f323;hb=884c24e399ddcf623cee5d6d7136a06255b6f3f0;hp=31d51b7829fc966fbd946d939a9fc95e6610ec93;hpb=1ca8b39624a40ef86ebe33b1a32158126fa51e95;p=modules%2Fyacs.git diff --git a/src/genericgui/GenericGui.cxx b/src/genericgui/GenericGui.cxx index 31d51b782..16d08646d 100644 --- a/src/genericgui/GenericGui.cxx +++ b/src/genericgui/GenericGui.cxx @@ -153,18 +153,18 @@ GenericGui::GenericGui(YACS::HMI::SuitWrapper* wrapper, QMainWindow *parent) _dwTree = new QDockWidget(_parent); _dwTree->setVisible(false); _dwTree->setWindowTitle("Tree View: edition mode"); - _dwTree->setObjectName("Tree View"); + _dwTree->setObjectName("yacsTreeViewDock"); _parent->addDockWidget(Qt::LeftDockWidgetArea, _dwTree); _dwStacked = new QDockWidget(_parent); _dwStacked->setVisible(false); _dwStacked->setWindowTitle("Input Panel"); - _dwStacked->setObjectName("Input Panel"); + _dwStacked->setObjectName("yacsInputPanelDock"); _dwStacked->setMinimumWidth(270); // --- force a minimum until display _parent->addDockWidget(Qt::RightDockWidgetArea, _dwStacked); _dwCatalogs = new QDockWidget(_parent); _dwCatalogs->setVisible(false); _dwCatalogs->setWindowTitle("Catalogs"); - _dwCatalogs->setObjectName("Catalogs"); + _dwCatalogs->setObjectName("yacsCatalogsDock"); _parent->addDockWidget(Qt::RightDockWidgetArea, _dwCatalogs); _catalogsWidget = new CatalogWidget(_dwCatalogs, _builtinCatalog, @@ -460,6 +460,14 @@ void GenericGui::createActions() tr("shrink/expand"), tr("shrink or expand the selected node"), 0, _parent, false, this, SLOT(onShrinkExpand())); + _shrinkExpandChildren = _wrapper->createAction(getMenuId(), tr("shrink or expand direct children of the selected node"), QIcon("icons:shrinkExpand.png"), + tr("shrink/expand children"), tr("shrink or expand direct children of the selected node"), + 0, _parent, false, this, SLOT(onShrinkExpandChildren())); + + _shrinkExpandElementaryRecursively = _wrapper->createAction(getMenuId(), tr("shrink or expand elementary nodes of the selected node recursively"), QIcon("icons:shrinkExpand.png"), + tr("shrink/expand elementary"), tr("shrink or expand elementary nodes of the selected node recursively"), + 0, _parent, false, this, SLOT(onShrinkExpandElementaryRecursively())); + _toggleStraightLinksAct = _wrapper->createAction(getMenuId(), tr("draw straight or orthogonal links"), QIcon("icons:straightLink.png"), tr("straight/orthogonal"), tr("draw straight or orthogonal links"), 0, _parent, true, this, SLOT(onToggleStraightLinks(bool))); @@ -670,7 +678,7 @@ void GenericGui::createMenus() void GenericGui::createTools() { - int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ) ); + int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ), QString( "YACSToolbar" ) ); _wrapper->createTool( _newSchemaAct, aToolId ); _wrapper->createTool( _importSchemaAct, aToolId ); _wrapper->createTool( _wrapper->separator(), aToolId ); @@ -1231,13 +1239,24 @@ void GenericGui::setLoadedPresentation(YACS::ENGINE::Proc* proc) inode->setWidth(pres._width); inode->setHeight(pres._height); inode->setExpanded(pres._expanded); - inode->setExpandedPos(QPointF(pres._expx, pres._expy)); + QPointF anExpandedPos = QPointF(pres._expx, pres._expy); + if (anExpandedPos.isNull()) + anExpandedPos = inode->pos(); + inode->setExpandedPos(anExpandedPos); inode->setExpandedWH(pres._expWidth, pres._expHeight); inode->setShownState(shownState(pres._shownState)); // collect nodes to correct it's Y-position if this collides with parent's header - if (inode->getParent() && inode->y() < inode->getParent()->getHeaderBottom()) - nodesToMove[inode] = QPointF(inode->x(), inode->getParent()->getHeaderBottom()+1); + if (inode->getParent() ) { + qreal anX = inode->x(); + qreal anY = inode->y(); + if (inode->getShownState() == shrinkHidden) { + anX = inode->getExpandedX(); + anY = inode->getExpandedY(); + } + if (anY < inode->getParent()->getHeaderBottom()) + nodesToMove[inode] = QPointF(anX, inode->getParent()->getHeaderBottom()+1); + } } } QtGuiContext::getQtCurrent()->setLoadingPresentation(false); @@ -2171,6 +2190,16 @@ void GenericGui::onShrinkExpand() { _guiEditor->shrinkExpand(); } +void GenericGui::onShrinkExpandChildren() { + DEBTRACE("GenericGui::onShrinkExpandChildren"); + _guiEditor->shrinkExpand(Qt::ControlModifier|Qt::ShiftModifier); +} + +void GenericGui::onShrinkExpandElementaryRecursively() { + DEBTRACE("GenericGui::onShrinkExpandElementaryRecursively"); + _guiEditor->shrinkExpand(Qt::ControlModifier); +} + void GenericGui::onToggleStraightLinks(bool checked) { Scene::_straightLinks = checked;