CMS 3D CMS Logo

CSGActionSupervisor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : CSGActionSupervisor
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Aug 2009
11 //
12 #include <sigc++/sigc++.h>
13 
17 
18 // constructors and destructor
19 //
21 
23  for (std::vector<CSGAction*>::iterator it = m_actionList.begin(), itEnd = m_actionList.end(); it != itEnd; ++it) {
24  delete *it;
25  }
26 }
27 
29  std::vector<CSGAction*>::iterator it_act;
30  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
31  if ((*it_act)->getName() == name)
32  return *it_act;
33  }
34  fwLog(fwlog::kWarning) << "No action is found with name " << name.c_str() << std::endl;
35  return nullptr;
36 }
37 
39 
40 const std::vector<CSGAction*>& CSGActionSupervisor::getListOfActions() const { return m_actionList; }
41 
42 void CSGActionSupervisor::defaultAction() { fwLog(fwlog::kInfo) << "Default action.\n"; }
43 
45  std::vector<CSGAction*>::iterator it_act;
46  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
47  if (enable)
48  (*it_act)->globalEnable();
49  else
50  (*it_act)->globalDisable();
51  }
52 }
53 
55  std::vector<CSGAction*>::iterator it_act;
56  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
57  if (entry == (*it_act)->getMenuEntry()) {
58  (*it_act)->activated.emit();
59  return kTRUE;
60  }
61  }
62  return kFALSE;
63 }
64 
66  std::vector<CSGAction*>::iterator it_act;
67  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
68  if ((*it_act)->getToolBarData() && (*it_act)->getToolBarData()->fId == entry) {
69  (*it_act)->activated.emit();
70  return kTRUE;
71  }
72  }
73  return kFALSE;
74 }
75 
77 
79  std::vector<CSGAction*>::iterator it_act;
80  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
81  if ((*it_act)->getMenu() == menu && (*it_act)->getKeycode() != 0) {
82  (*it_act)->resizeMenuEntry();
83  }
84  }
85 }
86 
virtual void enableActions(bool enable=true)
const std::vector< CSGAction * > & getListOfActions() const
Bool_t activateMenuEntry(int entry)
void resizeMenu(TGPopupMenu *menu)
void addToActionMap(CSGAction *action)
std::vector< CSGAction * > m_actionList
enable
Messages.
Definition: DiMuonV_cfg.py:92
virtual void defaultAction()
CSGAction * getAction(const std::string &name)
#define fwLog(_level_)
Definition: fwLog.h:45
Long_t getToolTipDelay() const
Bool_t activateToolBarEntry(int entry)
virtual void HandleMenu(Int_t id)