CMS 3D CMS Logo

FWCollectionSummaryWidget.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWCollectionSummaryWidget
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Sat Feb 14 10:02:32 CST 2009
11 //
12 
13 // system include files
14 #include <iostream>
15 #include <vector>
16 #include <boost/bind.hpp>
17 #include "TGButton.h"
18 #include "TGResourcePool.h"
23 
24 // user include files
28 
31 
35 
36 //
37 // constants, enums and typedefs
38 //
40  std::vector<sigc::connection> m_connections;
41 
43  for_each(m_connections.begin(), m_connections.end(), boost::bind(&sigc::connection::disconnect, _1));
44  }
45  void push_back(const sigc::connection& iC) { m_connections.push_back(iC); }
46  void reserve(size_t iSize) { m_connections.reserve(iSize); }
47 };
48 
49 //
50 // static data member definitions
51 //
52 namespace {
53  class BorderlessTextButton : public TGTextButton {
54  public:
55  BorderlessTextButton(const TGWindow* p = nullptr,
56  const char* s = nullptr,
57  Int_t id = -1,
58  GContext_t norm = GetDefaultGC()(),
59  FontStruct_t font = GetDefaultFontStruct())
60  : TGTextButton(p, s, id, norm, font, 0) {
61  //by default, it uses too much padding
62  fMTop = -3;
63  fMBottom = -3;
64  }
65 
66  void DoRedraw() override;
67  };
68 
69  void BorderlessTextButton::DoRedraw() {
70  gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth, fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
71  //TGFrame::DoRedraw();
72 
73  int x, y;
74  if (fTMode & kTextLeft) {
75  x = fMLeft + 4;
76  } else if (fTMode & kTextRight) {
77  x = fWidth - fTWidth - fMRight - 4;
78  } else {
79  x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
80  }
81 
82  if (fTMode & kTextTop) {
83  y = fMTop + 3;
84  } else if (fTMode & kTextBottom) {
85  y = fHeight - fTHeight - fMBottom - 3;
86  } else {
87  y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
88  }
89 
90  Int_t hotpos = fLabel->GetHotPos();
91 
92  fTLayout->DrawText(fId, fNormGC, x, y, 0, -1);
93  if (hotpos)
94  fTLayout->UnderlineChar(fId, fNormGC, x, y, hotpos - 1);
95  }
96 } // namespace
97 
98 static const TGPicture* filtered(bool iBackgroundIsBlack) {
99  if (iBackgroundIsBlack) {
100  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "filtered-blackbg.png");
101  return s;
102  }
103  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "filtered-whitebg.png");
104  return s;
105 }
106 
107 static const TGPicture* filtered_over(bool iBackgroundIsBlack) {
108  if (iBackgroundIsBlack) {
109  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "filtered-whitebg-over.png");
110  return s;
111  }
112  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "filtered-whitebg-over.png");
113  return s;
114 }
115 
116 static const TGPicture* alert_over(bool iBackgroundIsBlack) {
117  if (iBackgroundIsBlack) {
118  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "icon-alert-blackbg-over.png");
119  return s;
120  }
121  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "icon-alert-whitebg-over.png");
122  return s;
123 }
124 
125 static const TGPicture* alert(bool iBackgroundIsBlack) {
126  if (iBackgroundIsBlack) {
127  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "icon-alert-blackbg.png");
128  return s;
129  }
130  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "icon-alert-whitebg.png");
131  return s;
132 }
133 
134 static const TGPicture* unfiltered(bool iBackgroundIsBlack) {
135  if (iBackgroundIsBlack) {
136  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "unfiltered-blackbg.png");
137  return s;
138  }
139  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "unfiltered-whitebg.png");
140  return s;
141 }
142 static const TGPicture* unfiltered_over(bool iBackgroundIsBlack) {
143  if (iBackgroundIsBlack) {
144  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "unfiltered-blackbg-over.png");
145  return s;
146  }
147  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "unfiltered-whitebg-over.png");
148  return s;
149 }
150 
151 static const TGPicture* info(bool iBackgroundIsBlack) {
152  if (iBackgroundIsBlack) {
153  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-blackbg.png");
154  return s;
155  }
156  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-whitebg.png");
157  return s;
158 }
159 
160 static const TGPicture* info_over(bool iBackgroundIsBlack) {
161  if (iBackgroundIsBlack) {
162  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-blackbg-over.png");
163  return s;
164  }
165  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-whitebg-over.png");
166  return s;
167 }
168 
169 static const TGPicture* info_disabled(bool iBackgroundIsBlack) {
170  if (iBackgroundIsBlack) {
171  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-blackbg-disabled.png");
172  return s;
173  }
174  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "info2-whitebg-disabled.png");
175  return s;
176 }
177 
178 static const TGPicture* arrow_right(bool iBackgroundIsBlack) {
179  if (iBackgroundIsBlack) {
180  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-white-right-blackbg.png");
181  return s;
182  }
183  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-black-right-whitebg.png");
184  return s;
185 }
186 
187 static const TGPicture* arrow_right_disabled(bool iBackgroundIsBlack) {
188  if (iBackgroundIsBlack) {
189  static const TGPicture* s =
190  gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-white-right-disabled-blackbg.png");
191  return s;
192  }
193  static const TGPicture* s =
194  gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-black-right-disabled-whitebg.png");
195  return s;
196 }
197 
198 static const TGPicture* arrow_down(bool iBackgroundIsBlack) {
199  if (iBackgroundIsBlack) {
200  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-white-down-blackbg.png");
201  return s;
202  }
203  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-black-down-whitebg.png");
204  return s;
205 }
206 
207 static const TGPicture* arrow_down_disabled(bool iBackgroundIsBlack) {
208  if (iBackgroundIsBlack) {
209  static const TGPicture* s =
210  gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-white-down-disabled-blackbg.png");
211  return s;
212  }
213  static const TGPicture* s =
214  gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "arrow-black-down-disabled-whitebg.png");
215  return s;
216 }
217 
218 static const unsigned long kWidgetColor = 0x2f2f2f;
219 static const unsigned long kWidgetColorLight = 0xdfdfdf;
220 //
221 // constructors and destructor
222 //
223 FWCollectionSummaryWidget::FWCollectionSummaryWidget(TGFrame* iParent, FWEventItem& iItem, TGLayoutHints* iHints)
224  : TGCompositeFrame(iParent),
225  m_collection(&iItem),
226  m_hints(iHints),
227  m_parent(iParent),
228  m_collectionShown(false),
229  m_tableContext(nullptr),
230  m_indexForColor(-1),
231  m_colorPopup(nullptr),
232  m_tableManager(nullptr),
233  m_tableWidget(nullptr),
234  m_backgroundIsWhite(false),
235  m_connectionHolder(new FWCollectionSummaryWidgetConnectionHolder) {
236  SetBackgroundColor(kWidgetColor);
237  const unsigned int backgroundColor = kBlack;
238 
239  TGCompositeFrame* hFrame = new TGHorizontalFrame(this, 10, 10, 0, backgroundColor);
240  m_holder = hFrame;
241  this->AddFrame(hFrame, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
242 
247  m_showHideButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleShowHide()");
248  m_showHideButton->SetToolTipText("show/hide individual collection items");
249  m_collectionShown = false;
250  hFrame->AddFrame(m_showHideButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 6, 10));
251 
252  //m_isVisibleButton = new TGCheckButton(this,"");
253  //m_isVisibleButton->SetState(kButtonDown, kFALSE);
255  m_isVisibleButton = new FWBoxIconButton(this, m_isVisibleCheckBox, -1, GetWhiteGC()());
256  m_isVisibleButton->SetBackgroundColor(backgroundColor);
257  m_isVisibleButton->SetToolTipText("make all items in collection visible/invisible");
258  hFrame->AddFrame(m_isVisibleButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 1));
259  m_isVisibleButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleItemVisible()");
260 
262  m_colorSelectWidget = new FWBoxIconButton(this, m_colorSelectBox, -1, GetWhiteGC()());
263  hFrame->AddFrame(m_colorSelectWidget, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 1));
264  //m_colorSelectWidget->Connect("ColorSelected(Pixel_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Pixel_t)");
265  m_colorSelectWidget->Connect("Clicked()", "FWCollectionSummaryWidget", this, "colorClicked()");
266  m_colorSelectWidget->SetBackgroundColor(backgroundColor);
267  m_colorSelectWidget->SetToolTipText("set default color of items in collection");
268  GCValues_t t = *(GetWhiteGC().GetAttributes());
269  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
271 
272  m_label = new BorderlessTextButton(this, m_collection->name().c_str());
273  m_label->SetBackgroundColor(backgroundColor);
274  m_label->SetTextJustify(kTextLeft | kTextCenterY);
275  m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
276  hFrame->AddFrame(m_label, new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX, 5, 5));
277  m_label->Connect("Clicked()", "FWCollectionSummaryWidget", this, "labelClicked()");
278  m_label->SetToolTipText("select collection and show controller");
279 
284  hFrame->AddFrame(m_stateButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft));
285  itemChanged();
286  displayChanged();
287  m_stateButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "stateClicked()");
288  m_stateButton->SetToolTipText("select collection and show filter");
289 
292  hFrame->AddFrame(m_infoButton, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2));
293  m_infoButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "infoClicked()");
294  m_infoButton->SetToolTipText("select collection and show data info");
295 
298  boost::bind(&FWCollectionSummaryWidget::displayChanged, this)));
303 
304  MapSubwindows();
305  Layout();
306  MapWindow();
307 }
308 
309 // FWCollectionSummaryWidget::FWCollectionSummaryWidget(const FWCollectionSummaryWidget& rhs)
310 // {
311 // // do actual copying here;
312 // }
313 
315  delete m_colorPopup;
316  /* the following deletes lead to an infinite loop at the end of the job
317  delete m_hints;
318  delete m_showHideButton;
319  delete m_isVisibleButton;
320  delete m_colorSelectWidget;
321  delete m_stateButton;
322  delete m_infoButton;
323  */
324  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_graphicsContext->GetGC());
325  delete m_connectionHolder;
326 }
327 
328 //
329 // assignment operators
330 //
331 // const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator=(const FWCollectionSummaryWidget& rhs)
332 // {
333 // //An exception safe implementation is
334 // FWCollectionSummaryWidget temp(rhs);
335 // swap(rhs);
336 //
337 // return *this;
338 // }
339 
340 //
341 // member functions
342 //
343 static void setLabelBackgroundColor(TGTextButton* iLabel, bool iIsSelected, bool iBackgroundIsWhite) {
344  if (iIsSelected) {
345  if (iBackgroundIsWhite) {
346  iLabel->SetBackgroundColor(0x7777FF);
347  } else {
348  iLabel->SetBackgroundColor(0x0000FF);
349  }
350  } else {
351  if (iBackgroundIsWhite) {
352  iLabel->SetBackgroundColor(0xFFFFFF);
353  } else {
354  iLabel->SetBackgroundColor(0x000000);
355  }
356  }
357 }
358 
360  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
361  fClient->NeedRedraw(m_colorSelectWidget);
363  fClient->NeedRedraw(m_isVisibleButton);
365  fClient->NeedRedraw(m_label);
366 }
367 
369  const TGPicture* picture = nullptr;
370  const TGPicture* down = nullptr;
371  const TGPicture* disabled = nullptr;
372  if (m_collection->hasError()) {
373  picture = alert(!m_backgroundIsWhite);
375  disabled = alert_over(!m_backgroundIsWhite);
376  m_stateButton->SetToolTipText(m_collection->errorMessage().c_str());
377  } else {
378  if (!m_collection->filterExpression().empty()) {
379  picture = filtered(!m_backgroundIsWhite);
381  disabled = filtered_over(!m_backgroundIsWhite);
382  } else {
383  picture = unfiltered(!m_backgroundIsWhite);
386  }
387  m_stateButton->SetToolTipText("select collection and show filter");
388  }
389  m_stateButton->swapIcons(picture, down, disabled);
390 }
391 
393  if (-1 == m_indexForColor) {
395  changeProperties.setColor(color);
396  m_collection->setDefaultDisplayProperties(changeProperties);
397  return;
398  }
399 
401  changeProperties.setColor(color);
403 }
404 
408  changeProperties.setIsVisible(m_isVisibleCheckBox->isChecked());
409  m_collection->setDefaultDisplayProperties(changeProperties);
410  fClient->NeedRedraw(m_isVisibleButton);
411 }
412 
413 static TGGC* selectContext() {
414  static TGGC* s_context = nullptr;
415  if (nullptr == s_context) {
416  GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
417  s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT, kTRUE);
418  s_context->SetForeground(s_context->GetBackground());
419  //s_context->SetForeground(gVirtualX->GetPixel(kBlue+2));
420  }
421  return s_context;
422 }
423 
425  const TGPicture* picture = nullptr;
426  const TGPicture* down = nullptr;
427  const TGPicture* disabled = nullptr;
428 
429  if (m_collectionShown) {
430  picture = arrow_right(!m_backgroundIsWhite);
433  m_collectionShown = false;
434  HideFrame(m_tableWidget);
435  m_hints->SetLayoutHints(kLHintsExpandX);
436  } else {
437  picture = arrow_down(!m_backgroundIsWhite);
440  m_collectionShown = true;
441 
442  if (nullptr == m_tableManager) {
443  GCValues_t t = *(GetWhiteGC().GetAttributes());
444  t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
445  m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
446 
447  TGGC* hilightContext = selectContext();
450  m_tableWidget->SetHeaderBackgroundColor(fClient->GetResourcePool()->GetFrameGC()->GetBackground());
451  colorTable();
452  AddFrame(m_tableWidget, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
453  m_tableWidget->Connect("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
454  "FWCollectionSummaryWidget",
455  this,
456  "modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
457 
458  MapSubwindows();
459  Layout();
460  }
461  ShowFrame(m_tableWidget);
462  m_hints->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
463  //NOTE: if I don't do the resize then the vertical scrollbars for the table are
464  // messed up when the number of entries in the table can be fully scene but
465  // a scrollbar is still added which thinks only a tiny area of the list can be seen
466  m_tableWidget->Resize(m_tableWidget->GetWidth(), m_tableWidget->GetHeight());
467  }
468 
469  if (nullptr != m_parent) {
470  m_parent->Layout();
471  }
472  m_showHideButton->swapIcons(picture, down, disabled);
473 }
474 
476  if (nullptr == m_colorPopup) {
477  std::vector<Color_t> colors;
479 
480  m_colorPopup = new FWColorPopup(gClient->GetDefaultRoot(), m_collection->defaultDisplayProperties().color());
482  m_colorPopup->Connect("ColorSelected(Color_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Color_t)");
483  }
484 }
485 
488  m_indexForColor = -1;
489 
491  Window_t wdummy;
492  Int_t ax, ay;
493  gVirtualX->TranslateCoordinates(m_colorSelectWidget->GetId(),
494  gClient->GetDefaultRoot()->GetId(),
495  0,
496  m_colorSelectWidget->GetHeight(),
497  ax,
498  ay,
499  wdummy);
500  m_colorPopup->SetName(m_collection->name().c_str());
501  std::vector<Color_t> colors;
502  cm->fillLimitedColors(colors);
505  m_colorPopup->PlacePopup(ax, ay, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
506 }
507 
508 void FWCollectionSummaryWidget::itemColorClicked(int iIndex, Int_t iRootX, Int_t iRootY) {
510  m_indexForColor = iIndex;
511 
513  std::vector<Color_t> colors;
514  cm->fillLimitedColors(colors);
516  m_colorPopup->SetName(m_collection->modelName(iIndex).c_str());
518  m_colorPopup->PlacePopup(iRootX, iRootY, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
519 }
520 
521 void FWCollectionSummaryWidget::modelSelected(Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY) {
522  if (iKeyMod & kKeyControlMask) {
523  m_collection->toggleSelect(iRow);
524  } else {
527  m_collection->select(iRow);
528  }
529  if (iButton == kButton3) {
530  requestForModelContextMenu(iGlobalX, iGlobalY);
531  }
532 }
533 
535  Emit("requestForInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
536 }
537 
539  Emit("requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
540 }
541 
543  Emit("requestForErrorInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
544 }
545 
547  Emit("requestForController(FWEventItem*)", reinterpret_cast<long>(iItem));
548 }
549 
550 void FWCollectionSummaryWidget::requestForModelContextMenu(Int_t iGlobalX, Int_t iGlobalY) {
551  Long_t args[2];
552  args[0] = static_cast<Long_t>(iGlobalX);
553  args[1] = static_cast<Long_t>(iGlobalY);
554  Emit("requestForModelContextMenu(Int_t,Int_t)", args);
555 }
556 
558  if (!m_collection->itemIsSelected()) {
559  //NOTE: Want to be sure if models are selected then their collection is also selected
562  }
564 }
565 
567  if (!m_collection->itemIsSelected()) {
568  //NOTE: Want to be sure if models are selected then their collection is also selected
571  }
573 }
574 
576  if (!m_collection->itemIsSelected()) {
577  //NOTE: Want to be sure if models are selected then their collection is also selected
580  }
582 }
583 
585  if (iToWhite == m_backgroundIsWhite) {
586  return;
587  }
588  Pixel_t bc = 0x000000;
589  Pixel_t fg = 0xffffff;
590  if (iToWhite) {
591  bc = 0xffffff;
592  fg = 0x000000;
593  m_backgroundIsWhite = true;
594  SetBackgroundColor(kWidgetColorLight);
595  m_isVisibleButton->setNormCG(GetBlackGC()());
596  m_colorSelectWidget->setNormCG(GetBlackGC()());
597  selectContext()->SetForeground(0xafafFF);
598  } else {
599  m_backgroundIsWhite = false;
600  SetBackgroundColor(kWidgetColor);
601  m_isVisibleButton->setNormCG(GetWhiteGC()());
602  m_colorSelectWidget->setNormCG(GetWhiteGC()());
603  selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
604  }
605  //this forces the icons to be changed to the correct background
606  itemChanged();
607  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
608  {
609  const TGPicture* picture = info(!m_backgroundIsWhite);
610  const TGPicture* over = info_over(!m_backgroundIsWhite);
611  const TGPicture* disabled = info_disabled(!m_backgroundIsWhite);
612  m_infoButton->swapIcons(picture, over, disabled);
613  }
614  if (m_collectionShown) {
615  const TGPicture* picture = arrow_down(!m_backgroundIsWhite);
616  const TGPicture* down = arrow_down_disabled(!m_backgroundIsWhite);
617  const TGPicture* disabled = arrow_down_disabled(!m_backgroundIsWhite);
618  m_showHideButton->swapIcons(picture, down, disabled);
619  } else {
620  const TGPicture* picture = arrow_right(!m_backgroundIsWhite);
621  const TGPicture* down = arrow_right_disabled(!m_backgroundIsWhite);
623  m_showHideButton->swapIcons(picture, down, disabled);
624  }
625  colorTable();
626  m_holder->SetBackgroundColor(bc);
628  m_label->SetTextColor(fg);
629  m_isVisibleButton->SetBackgroundColor(bc);
630  m_colorSelectWidget->SetBackgroundColor(bc);
631  fClient->NeedRedraw(m_isVisibleButton);
632  fClient->NeedRedraw(m_colorSelectWidget);
633  fClient->NeedRedraw(m_holder);
634  fClient->NeedRedraw(this);
635 }
636 
638  if (nullptr == m_tableWidget) {
639  return;
640  }
641  if (m_backgroundIsWhite) {
644  m_tableContext->SetForeground(0x000000);
645  } else {
648  m_tableContext->SetForeground(0xffffff);
649  }
650 }
651 //
652 // const member functions
653 //
654 
655 //
656 // static member functions
657 //
658 
static const TString & coreIcondir()
void Resize(UInt_t w, UInt_t h) override
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void setColor(Color_t iColor)
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:123
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
void InitContent(const char *name, const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
FWCollectionSummaryWidget(TGFrame *iParent, FWEventItem &iItem, TGLayoutHints *)
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
string disabled
Definition: mps_check.py:68
const std::string & name() const
Definition: FWEventItem.cc:435
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:247
#define nullptr
const std::string & filterExpression() const
Definition: FWEventItem.cc:491
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:190
void fillLimitedColors(std::vector< Color_t > &cv) const
void SetHeaderBackgroundColor(Pixel_t)
static TGGC * selectContext()
void SetName(const char *iName) override
bool itemIsSelected() const
Definition: FWEventItem.cc:537
static const TGPicture * alert(bool iBackgroundIsBlack)
void SetLineSeparatorColor(Pixel_t)
static const TGPicture * alert_over(bool iBackgroundIsBlack)
Color_t color() const
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:138
vector< Color_t > colors
ClassImp(FWCollectionSummaryWidget)
static const TGPicture * filtered(bool iBackgroundIsBlack)
BackgroundColorIndex backgroundColorIndex() const
static const TGPicture * unfiltered_over(bool iBackgroundIsBlack)
void itemColorClicked(int iIndex, Int_t iRootX, Int_t iRootY)
FWCustomIconsButton * m_showHideButton
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
static const TGPicture * info_disabled(bool iBackgroundIsBlack)
bool isChecked() const
FWCollectionSummaryWidgetConnectionHolder * m_connectionHolder
void ResetColors(const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
void SetSelection(Color_t)
void setChecked(bool iChecked)
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:539
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void SetBackgroundColor(Pixel_t) override
static const TGPicture * filtered_over(bool iBackgroundIsBlack)
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:236
void selectItem()
Definition: FWEventItem.cc:514
static void setLabelBackgroundColor(TGTextButton *iLabel, bool iIsSelected, bool iBackgroundIsWhite)
void setNormCG(GContext_t)
static const TGPicture * info_over(bool iBackgroundIsBlack)
static const unsigned long kWidgetColor
static const TGPicture * arrow_down_disabled(bool iBackgroundIsBlack)
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:541
static const unsigned long kWidgetColorLight
void select(int iIndex) const
Definition: FWEventItem.cc:224
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
static const TGPicture * arrow_right_disabled(bool iBackgroundIsBlack)
void setIsVisible(bool iSet)
void modelSelected(Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
void colorChangeRequested(Color_t iColorIndex)
FWCollectionSummaryTableManager * m_tableManager
void requestForModelContextMenu(Int_t, Int_t)
static const TGPicture * unfiltered(bool iBackgroundIsBlack)
void setColor(GContext_t iColorContext)
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:193