35 using namespace YACS::HMI;
36 using namespace YACS::ENGINE;
40 MenusBase::MenusBase()
42 _dummyAct =
new QAction(tr(
"Elapse Time Statistics"),
this);
44 _dummyAct->setStatusTip(tr(
"Elapse Time Statistics"));
45 _dummyAct->setToolTip(tr(
"Elapse Time Statistics"));
46 connect(_dummyAct, SIGNAL(triggered()),
this, SLOT(dummyAction()));
49 MenusBase::~MenusBase()
53 void MenusBase::popupMenu(
QWidget *caller,
const QPoint &globalPos,
const QString&
m)
55 QMenu menu(m, caller);
56 menu.addAction(_dummyAct);
60 void MenusBase::dummyAction()
63 QtGuiContext::_counters->stats();
66 void MenusBase::foreachAction(QAction* act)
69 GenericGui *gmain = QtGuiContext::getQtCurrent()->getGMain();
73 void MenusBase::putGraphInForeachAction(QAction* act)
76 GenericGui *gmain = QtGuiContext::getQtCurrent()->getGMain();
80 void MenusBase::addHeader(QMenu &
m,
const QString &
h)
82 m.addAction(_dummyAct);
83 _dummyAct->setText(h);
84 QFont
f = _dummyAct->font();
86 _dummyAct->setFont(f);
90 void MenusBase::buildForEachMenu(QMenu *
m, QActionGroup* actgroup)
93 pixmap.load(
"icons:new_foreach_loop_node.png");
95 QMenu *ForEachMenu=m->addMenu(QIcon(pixmap),
"ForEach Loop");
98 std::map<std::string, TypeCode*>::const_iterator it = proc->
typeMap.begin();
100 for (; it != proc->
typeMap.end(); ++it)
102 act=actgroup->addAction((*it).first.c_str());
103 ForEachMenu->addAction(act);
107 void MenusBase::addForEachMenu(QMenu *
m, QActionGroup* actgroup)
109 buildForEachMenu(m, actgroup);
110 connect(actgroup, SIGNAL(triggered(QAction*)),
this, SLOT(foreachAction(QAction*)));
113 void MenusBase::addForEachMenuToPutGraph(QMenu *
m, QActionGroup* actgroup)
115 buildForEachMenu(m, actgroup);
116 connect(actgroup, SIGNAL(triggered(QAction*)),
this, SLOT(putGraphInForeachAction(QAction*)));
133 QMenu menu(m, caller);
134 QActionGroup actgroup(
this);
138 QMenu *CNmenu = menu.addMenu(tr(
"Create Node"));
143 CNmenu->addSeparator();
146 CNmenu->addSeparator();
151 CNmenu->addSeparator();
153 CNmenu->addSeparator();
204 menu.exec(globalPos);
221 QMenu menu(m, caller);
223 QActionGroup actgroup(
this);
224 QActionGroup actgroup2(
this);
232 QMenu *CNmenu = menu.addMenu(tr(
"Create Node"));
237 CNmenu->addSeparator();
240 CNmenu->addSeparator();
245 CNmenu->addSeparator();
247 CNmenu->addSeparator();
256 QMenu *PINmenu = menu.addMenu(tr(
"Put Graph Content in Node"));
258 PINmenu->addSeparator();
292 menu.exec(globalPos);
309 QMenu menu(m, caller);
327 menu.exec(globalPos);
344 QMenu menu(m, caller);
350 menu.exec(globalPos);
367 QMenu menu(m, caller);
379 menu.exec(globalPos);
396 QMenu menu(m, caller);
438 menu.exec(globalPos);
455 QMenu menu(m, caller);
469 if (dynamic_cast<DataNode*>(parent) || dynamic_cast<InlineNode*>(parent))
475 menu.exec(globalPos);
492 QMenu menu(m, caller);
506 if (dynamic_cast<DataNode*>(parent) || dynamic_cast<InlineNode*>(parent))
512 menu.exec(globalPos);
529 QMenu menu(m, caller);
541 menu.exec(globalPos);
558 QMenu menu(m, caller);
570 menu.exec(globalPos);
587 QMenu menu(m, caller);
590 menu.exec(globalPos);
607 QMenu menu(m, caller);
614 menu.exec(globalPos);
631 QMenu menu(m, caller);
638 menu.exec(globalPos);
655 QMenu menu(m, caller);
661 menu.exec(globalPos);