Version: 8.3.0
YACS::HMI::MenusBase Class Reference

#include <Menus.hxx>

Inheritance diagram for YACS::HMI::MenusBase:
Collaboration diagram for YACS::HMI::MenusBase:

Public Member Functions

 MenusBase ()
 
virtual ~MenusBase ()
 
virtual void popupMenu (QWidget *caller, const QPoint &globalPos, const QString &m="MenuBase")
 
virtual void addForEachMenu (QMenu *m, QActionGroup *actgroup)
 
virtual void addForEachMenuToPutGraph (QMenu *m, QActionGroup *actgroup)
 

Protected Slots

void dummyAction ()
 
void foreachAction (QAction *)
 
void putGraphInForeachAction (QAction *)
 

Protected Member Functions

virtual void buildForEachMenu (QMenu *m, QActionGroup *actgroup)
 
virtual void addHeader (QMenu &m, const QString &h)
 

Protected Attributes

QAction * _dummyAct
 

Detailed Description

Definition at line 32 of file Menus.hxx.

Constructor & Destructor Documentation

MenusBase::MenusBase ( )

Definition at line 40 of file Menus.cxx.

41 {
42  _dummyAct = new QAction(tr("Elapse Time Statistics"), this);
43 // _dummyAct->setShortcut(tr("Ctrl+y"));
44  _dummyAct->setStatusTip(tr("Elapse Time Statistics"));
45  _dummyAct->setToolTip(tr("Elapse Time Statistics"));
46  connect(_dummyAct, SIGNAL(triggered()), this, SLOT(dummyAction()));
47 }
MenusBase::~MenusBase ( )
virtual

Definition at line 49 of file Menus.cxx.

50 {
51 }

Member Function Documentation

void MenusBase::addForEachMenu ( QMenu *  m,
QActionGroup *  actgroup 
)
virtual

Definition at line 107 of file Menus.cxx.

Referenced by YACS::HMI::ComposedNodeMenu::popupMenu(), and YACS::HMI::ProcMenu::popupMenu().

108 {
109  buildForEachMenu(m, actgroup);
110  connect(actgroup, SIGNAL(triggered(QAction*)), this, SLOT(foreachAction(QAction*)));
111 }
void MenusBase::addForEachMenuToPutGraph ( QMenu *  m,
QActionGroup *  actgroup 
)
virtual

Definition at line 113 of file Menus.cxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

114 {
115  buildForEachMenu(m, actgroup);
116  connect(actgroup, SIGNAL(triggered(QAction*)), this, SLOT(putGraphInForeachAction(QAction*)));
117 }
void MenusBase::buildForEachMenu ( QMenu *  m,
QActionGroup *  actgroup 
)
protectedvirtual

Definition at line 90 of file Menus.cxx.

References YACS::ENGINE::Proc::getProc(), and YACS::ENGINE::Proc::typeMap.

91 {
92  QPixmap pixmap;
93  pixmap.load("icons:new_foreach_loop_node.png");
94 
95  QMenu *ForEachMenu=m->addMenu(QIcon(pixmap),"ForEach Loop");
96 
97  Proc* proc = GuiContext::getCurrent()->getProc();
98  std::map<std::string, TypeCode*>::const_iterator it = proc->typeMap.begin();
99  QAction* act;
100  for (; it != proc->typeMap.end(); ++it)
101  {
102  act=actgroup->addAction((*it).first.c_str());
103  ForEachMenu->addAction(act);
104  }
105 }
void MenusBase::dummyAction ( )
protectedslot

Definition at line 60 of file Menus.cxx.

References DEBTRACE.

61 {
62  DEBTRACE("MenusBase::dummyAction");
64 }
void MenusBase::foreachAction ( QAction *  act)
protectedslot

Definition at line 66 of file Menus.cxx.

References YACS::HMI::GenericGui::createForEachLoop(), and DEBTRACE.

67 {
68  DEBTRACE(act->text().toStdString());
70  gmain->createForEachLoop(act->text().toStdString());
71 }
void MenusBase::popupMenu ( QWidget caller,
const QPoint &  globalPos,
const QString &  m = "MenuBase" 
)
virtual
void MenusBase::putGraphInForeachAction ( QAction *  act)
protectedslot

Definition at line 73 of file Menus.cxx.

References DEBTRACE, and YACS::HMI::GenericGui::putGraphInForeachLoop().

74 {
75  DEBTRACE(act->text().toStdString());
77  gmain->putGraphInForeachLoop(act->text().toStdString());
78 }

Member Data Documentation

QAction* YACS::HMI::MenusBase::_dummyAct
protected

Definition at line 50 of file Menus.hxx.


The documentation for this class was generated from the following files: