CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWSummaryManager.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWSummaryManager
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Tue Mar 4 09:35:32 EST 2008
11 // $Id: FWSummaryManager.cc,v 1.22 2010/06/18 10:17:16 yana Exp $
12 //
13 
14 // system include files
15 #include <boost/bind.hpp>
16 
17 #include "TGFrame.h"
18 
19 // user include files
27 
30 
32 
33 //
34 // constants, enums and typedefs
35 //
36 
37 //
38 // static data member definitions
39 //
40 
41 //
42 // constructors and destructor
43 //
47  FWGUIManager* gm,
49  FWColorManager* colorm
50 ) :
51  m_guiManager(gm),
52  m_colorManager(colorm),
53 m_itemChanged(false)
54 {
55  colorm->colorsHaveChanged_.connect(boost::bind(&FWSummaryManager::colorsChanged,this));
56  sm->selectionChanged_.connect(boost::bind(&FWSummaryManager::selectionChanged,this,_1));
57  eim->newItem_.connect(boost::bind(&FWSummaryManager::newItem,
58  this, _1) );
59  eim->goingToClearItems_.connect(boost::bind(&FWSummaryManager::removeAllItems, this));
61 
62  m_pack = new TGVerticalFrame(iParent);
63  m_pack->SetLayoutManager( new FWCompactVerticalLayout(m_pack));
64  const unsigned int backgroundColor=0x2f2f2f;
65  m_pack->SetBackgroundColor(backgroundColor);
66  cm->changeSignalsAreDone_.connect(boost::bind(&FWSummaryManager::changesDone,this));
67 }
68 
69 // FWSummaryManager::FWSummaryManager(const FWSummaryManager& rhs)
70 // {
71 // // do actual copying here;
72 // }
73 
75 {
76 }
77 
78 //
79 // assignment operators
80 //
81 // const FWSummaryManager& FWSummaryManager::operator=(const FWSummaryManager& rhs)
82 // {
83 // //An exception safe implementation is
84 // FWSummaryManager temp(rhs);
85 // swap(rhs);
86 //
87 // return *this;
88 // }
89 
90 //
91 // member functions
92 //
93 void
95 {
96  TGLayoutHints* hints = new TGLayoutHints(kLHintsExpandX);
98  m_pack->AddFrame(lst, hints);
99  m_collectionWidgets.push_back(lst);
101  lst->setBackgroundToWhite(backgroundIsWhite);
102  iItem->goingToBeDestroyed_.connect(boost::bind(&FWSummaryManager::itemDestroyed,this,_1));
103  iItem->itemChanged_.connect(boost::bind(&FWSummaryManager::itemChanged,this,_1));
104  lst->Connect("requestForInfo(FWEventItem*)","FWSummaryManager",this,"requestForInfo(FWEventItem*)");
105  lst->Connect("requestForFilter(FWEventItem*)","FWSummaryManager",this,"requestForFilter(FWEventItem*)");
106  lst->Connect("requestForErrorInfo(FWEventItem*)","FWSummaryManager",this,"requestForError(FWEventItem*)");
107  lst->Connect("requestForController(FWEventItem*)","FWSummaryManager",this,"requestForController(FWEventItem*)");
108  lst->Connect("requestForModelContextMenu(Int_t,Int_t)","FWSummaryManager",this,"requestForSelectedModelContextMenu(Int_t,Int_t)");
109 }
110 
111 void
113 {
114  m_pack->HideFrame(m_collectionWidgets[iItem->id()]);
115  m_pack->RemoveFrame(m_collectionWidgets[iItem->id()]);
116  delete m_collectionWidgets[iItem->id()];
117  m_collectionWidgets[iItem->id()]=0;
118  m_pack->Layout();
119  gClient->NeedRedraw(m_pack);
120 }
121 
122 void
124 {
125  m_itemChanged = true;
126 }
127 
128 void
130 {
131  for(std::vector<FWCollectionSummaryWidget*>::iterator it = m_collectionWidgets.begin(),
132  itEnd = m_collectionWidgets.end();
133  it != itEnd;
134  ++it) {
135  if(0!=*it) {
136  m_pack->HideFrame(*it);
137  m_pack->RemoveFrame(*it);
138  delete *it;
139  *it=0;
140  }
141  }
142  m_collectionWidgets.clear();
143  m_pack->Layout();
144  gClient->NeedRedraw(m_pack);
145 }
146 
147 void
149 {
150 }
151 
152 void
154 {
155  if(m_itemChanged) {
156  m_pack->Layout();
157  m_itemChanged=false;
158  }
159 }
160 
161 void
163 {
165 
167  m_pack->SetBackgroundColor(TGFrame::GetDefaultFrameBackground());
168  } else {
169  const unsigned int backgroundColor=0x2f2f2f;
170  m_pack->SetBackgroundColor(backgroundColor);
171  }
172  gClient->NeedRedraw(m_pack);
173  for(std::vector<FWCollectionSummaryWidget*>::iterator it = m_collectionWidgets.begin(),
174  itEnd = m_collectionWidgets.end();
175  it != itEnd;
176  ++it) {
177  if(0!=*it) {
178  (*it)->setBackgroundToWhite(backgroundIsWhite);
179  }
180  }
181 }
182 
183 void
185 {
187 }
188 void
190 {
192 }
193 void
195 {
197 }
198 
199 void
201 {
203 }
204 
205 void
207 {
208  m_guiManager->showSelectedModelContextMenu(iGlobalX,iGlobalY,0);
209 }
210 
211 //
212 // const member functions
213 //
214 TGCompositeFrame*
216 {
217  return m_pack;
218 }
219 
220 //
221 // static member functions
222 //
Bool_t isColorSetLight() const
TGCompositeFrame * widget() const
std::vector< FWCollectionSummaryWidget * > m_collectionWidgets
void requestForInfo(FWEventItem *)
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:215
FWColorManager * m_colorManager
int lst[30]
void showEDIFrame(int iInfoToShow=-1)
Allowed values are -1 or ones from FWDataCategories enum.
TGCompositeFrame * m_pack
void itemChanged(const FWEventItem *)
BackgroundColorIndex backgroundColorIndex() const
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:199
sigc::signal< void, FWEventItem * > newItem_
unsigned int id() const
Definition: FWEventItem.cc:494
FWSummaryManager(TGFrame *iParent, FWSelectionManager *, FWEventItemsManager *, FWGUIManager *, FWModelChangeManager *, FWColorManager *)
void requestForFilter(FWEventItem *)
sigc::signal< void > changeSignalsAreDone_
void requestForSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY)
virtual ~FWSummaryManager()
void requestForError(FWEventItem *)
void selectionChanged(const FWSelectionManager &)
sigc::signal< void, const FWSelectionManager & > selectionChanged_
void newItem(FWEventItem *iItem)
void requestForController(FWEventItem *)
void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
sigc::signal< void > colorsHaveChanged_
void itemDestroyed(const FWEventItem *)
sigc::signal< void > goingToClearItems_
FWGUIManager * m_guiManager