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) {
46  m_connections.push_back(iC);
47  }
48  void reserve(size_t iSize) {
49  m_connections.reserve(iSize);
50  }
51 };
52 
53 
54 //
55 // static data member definitions
56 //
57 namespace {
58  class BorderlessTextButton : public TGTextButton {
59  public:
60  BorderlessTextButton(const TGWindow *p = nullptr, const char *s = nullptr, Int_t id = -1,
61  GContext_t norm = GetDefaultGC()(),
62  FontStruct_t font = GetDefaultFontStruct()):
63  TGTextButton(p,s,id,norm,font,0){
64  //by default, it uses too much padding
65  fMTop = -3;
66  fMBottom = -3;
67  }
68 
69  void DoRedraw() override;
70  };
71 
72  void BorderlessTextButton::DoRedraw() {
73  gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth,
74  fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
75  //TGFrame::DoRedraw();
76 
77  int x, y;
78  if (fTMode & kTextLeft) {
79  x = fMLeft + 4;
80  } else if (fTMode & kTextRight) {
81  x = fWidth - fTWidth - fMRight - 4;
82  } else {
83  x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
84  }
85 
86  if (fTMode & kTextTop) {
87  y = fMTop + 3;
88  } else if (fTMode & kTextBottom) {
89  y = fHeight - fTHeight - fMBottom - 3;
90  } else {
91  y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
92  }
93 
94  Int_t hotpos = fLabel->GetHotPos();
95 
96  fTLayout->DrawText(fId, fNormGC, x, y, 0, -1);
97  if (hotpos) fTLayout->UnderlineChar(fId, fNormGC, x, y, hotpos - 1);
98  }
99 }
100 
101 
102 static
103 const TGPicture* filtered(bool iBackgroundIsBlack)
104 {
105  if(iBackgroundIsBlack) {
106  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"filtered-blackbg.png");
107  return s;
108  }
109  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"filtered-whitebg.png");
110  return s;
111 
112 }
113 
114 static
115 const TGPicture* filtered_over(bool iBackgroundIsBlack)
116 {
117  if(iBackgroundIsBlack) {
118  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"filtered-whitebg-over.png");
119  return s;
120  }
121  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"filtered-whitebg-over.png");
122  return s;
123 }
124 
125 static
126 const TGPicture* alert_over(bool iBackgroundIsBlack)
127 {
128  if(iBackgroundIsBlack) {
129  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"icon-alert-blackbg-over.png");
130  return s;
131  }
132  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"icon-alert-whitebg-over.png");
133  return s;
134 }
135 
136 static
137 const TGPicture* alert(bool iBackgroundIsBlack)
138 {
139 
140  if(iBackgroundIsBlack) {
141  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"icon-alert-blackbg.png");
142  return s;
143  }
144  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"icon-alert-whitebg.png");
145  return s;
146 }
147 
148 static
149 const TGPicture* unfiltered(bool iBackgroundIsBlack)
150 {
151  if(iBackgroundIsBlack) {
152  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"unfiltered-blackbg.png");
153  return s;
154  }
155  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"unfiltered-whitebg.png");
156  return s;
157 }
158 static
159 const TGPicture* unfiltered_over(bool iBackgroundIsBlack)
160 {
161  if(iBackgroundIsBlack) {
162  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"unfiltered-blackbg-over.png");
163  return s;
164  }
165  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"unfiltered-whitebg-over.png");
166  return s;
167 }
168 
169 static
170 const TGPicture* info(bool iBackgroundIsBlack)
171 {
172  if(iBackgroundIsBlack) {
173  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-blackbg.png");
174  return s;
175  }
176  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-whitebg.png");
177  return s;
178 }
179 
180 static
181 const TGPicture* info_over(bool iBackgroundIsBlack)
182 {
183  if(iBackgroundIsBlack) {
184  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-blackbg-over.png");
185  return s;
186  }
187  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-whitebg-over.png");
188  return s;
189 }
190 
191 static
192 const TGPicture* info_disabled(bool iBackgroundIsBlack)
193 {
194  if(iBackgroundIsBlack) {
195  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-blackbg-disabled.png");
196  return s;
197  }
198  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"info2-whitebg-disabled.png");
199  return s;
200 }
201 
202 static
203 const TGPicture* arrow_right(bool iBackgroundIsBlack)
204 {
205  if(iBackgroundIsBlack) {
206  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-white-right-blackbg.png");
207  return s;
208  }
209  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-black-right-whitebg.png");
210  return s;
211 }
212 
213 static
214 const TGPicture* arrow_right_disabled(bool iBackgroundIsBlack)
215 {
216  if(iBackgroundIsBlack) {
217  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-white-right-disabled-blackbg.png");
218  return s;
219  }
220  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-black-right-disabled-whitebg.png");
221  return s;
222 }
223 
224 static
225 const TGPicture* arrow_down(bool iBackgroundIsBlack)
226 {
227  if(iBackgroundIsBlack) {
228  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-white-down-blackbg.png");
229  return s;
230  }
231  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-black-down-whitebg.png");
232  return s;
233 }
234 
235 static
236 const TGPicture* arrow_down_disabled(bool iBackgroundIsBlack)
237 {
238  if(iBackgroundIsBlack) {
239  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-white-down-disabled-blackbg.png");
240  return s;
241  }
242  static const TGPicture* s = gClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"arrow-black-down-disabled-whitebg.png");
243  return s;
244 }
245 
246 
247 static const unsigned long kWidgetColor = 0x2f2f2f;
248 static const unsigned long kWidgetColorLight = 0xdfdfdf;
249 //
250 // constructors and destructor
251 //
252 FWCollectionSummaryWidget::FWCollectionSummaryWidget(TGFrame* iParent, FWEventItem& iItem, TGLayoutHints* iHints):
253 TGCompositeFrame(iParent),
254 m_collection(&iItem),
255 m_hints(iHints),
256 m_parent(iParent),
257 m_collectionShown(false),
258 m_tableContext(nullptr),
259 m_indexForColor(-1),
260 m_colorPopup(nullptr),
261 m_tableManager(nullptr),
262 m_tableWidget(nullptr),
263 m_backgroundIsWhite(false),
264 m_connectionHolder( new FWCollectionSummaryWidgetConnectionHolder)
265 {
266  SetBackgroundColor(kWidgetColor);
267  const unsigned int backgroundColor=kBlack;
268 
269  TGCompositeFrame* hFrame = new TGHorizontalFrame(this, 10, 10, 0, backgroundColor);
270  m_holder = hFrame;
271  this->AddFrame(hFrame, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
272 
277  m_showHideButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"toggleShowHide()");
278  m_showHideButton->SetToolTipText("show/hide individual collection items");
279  m_collectionShown = false;
280  hFrame->AddFrame(m_showHideButton,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,6,10));
281 
282  //m_isVisibleButton = new TGCheckButton(this,"");
283  //m_isVisibleButton->SetState(kButtonDown, kFALSE);
285  m_isVisibleButton = new FWBoxIconButton(this, m_isVisibleCheckBox,-1,GetWhiteGC()());
286  m_isVisibleButton->SetBackgroundColor(backgroundColor);
287  m_isVisibleButton->SetToolTipText("make all items in collection visible/invisible");
288  hFrame->AddFrame(m_isVisibleButton,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,0,1));
289  m_isVisibleButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleItemVisible()");
290 
292  m_colorSelectWidget = new FWBoxIconButton(this,m_colorSelectBox,-1,GetWhiteGC()());
293  hFrame->AddFrame(m_colorSelectWidget,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,1));
294  //m_colorSelectWidget->Connect("ColorSelected(Pixel_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Pixel_t)");
295  m_colorSelectWidget->Connect("Clicked()", "FWCollectionSummaryWidget",this,"colorClicked()");
296  m_colorSelectWidget->SetBackgroundColor(backgroundColor);
297  m_colorSelectWidget->SetToolTipText("set default color of items in collection");
298  GCValues_t t = *( GetWhiteGC().GetAttributes());
299  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
301 
302 
303  m_label = new BorderlessTextButton(this,
304  m_collection->name().c_str());
305  m_label->SetBackgroundColor(backgroundColor);
306  m_label->SetTextJustify(kTextLeft|kTextCenterY);
307  m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
308  hFrame->AddFrame(m_label, new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX,5,5));
309  m_label->Connect("Clicked()","FWCollectionSummaryWidget",this,"labelClicked()");
310  m_label->SetToolTipText("select collection and show controller");
311 
315  hFrame->AddFrame(m_stateButton, new TGLayoutHints(kLHintsCenterY| kLHintsLeft));
316  itemChanged();
317  displayChanged();
318  m_stateButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"stateClicked()");
319  m_stateButton->SetToolTipText("select collection and show filter");
320 
325  );
326  hFrame->AddFrame(m_infoButton, new TGLayoutHints(kLHintsCenterY| kLHintsRight,2,2));
327  m_infoButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"infoClicked()");
328  m_infoButton->SetToolTipText("select collection and show data info");
329 
334 
335  MapSubwindows();
336  Layout();
337  MapWindow();
338 }
339 
340 // FWCollectionSummaryWidget::FWCollectionSummaryWidget(const FWCollectionSummaryWidget& rhs)
341 // {
342 // // do actual copying here;
343 // }
344 
346 {
347  delete m_colorPopup;
348  /* the following deletes lead to an infinite loop at the end of the job
349  delete m_hints;
350  delete m_showHideButton;
351  delete m_isVisibleButton;
352  delete m_colorSelectWidget;
353  delete m_stateButton;
354  delete m_infoButton;
355  */
356  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_graphicsContext->GetGC());
357  delete m_connectionHolder;
358 }
359 
360 //
361 // assignment operators
362 //
363 // const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator=(const FWCollectionSummaryWidget& rhs)
364 // {
365 // //An exception safe implementation is
366 // FWCollectionSummaryWidget temp(rhs);
367 // swap(rhs);
368 //
369 // return *this;
370 // }
371 
372 //
373 // member functions
374 //
375 static
376 void
377 setLabelBackgroundColor(TGTextButton* iLabel, bool iIsSelected, bool iBackgroundIsWhite)
378 {
379  if(iIsSelected) {
380  if(iBackgroundIsWhite) {
381  iLabel->SetBackgroundColor(0x7777FF);
382  } else {
383  iLabel->SetBackgroundColor(0x0000FF);
384  }
385  } else {
386  if(iBackgroundIsWhite) {
387  iLabel->SetBackgroundColor(0xFFFFFF);
388  } else {
389  iLabel->SetBackgroundColor(0x000000);
390  }
391  }
392 }
393 
394 void
396 {
397  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
398  fClient->NeedRedraw(m_colorSelectWidget);
400  fClient->NeedRedraw(m_isVisibleButton);
402  fClient->NeedRedraw(m_label);
403 }
404 
405 void
407 {
408  const TGPicture* picture = nullptr;
409  const TGPicture* down = nullptr;
410  const TGPicture* disabled=nullptr;
411  if(m_collection->hasError()) {
412  picture = alert(!m_backgroundIsWhite);
414  disabled = alert_over(!m_backgroundIsWhite);
415  m_stateButton->SetToolTipText(m_collection->errorMessage().c_str());
416  } else {
417  if(!m_collection->filterExpression().empty()) {
418  picture = filtered(!m_backgroundIsWhite);
420  disabled = filtered_over(!m_backgroundIsWhite);
421  } else {
422  picture = unfiltered(!m_backgroundIsWhite);
425  }
426  m_stateButton->SetToolTipText("select collection and show filter");
427  }
428  m_stateButton->swapIcons(picture,down,disabled);
429 }
430 
431 void
433 {
434  if(-1 == m_indexForColor) {
436  changeProperties.setColor(color);
437  m_collection->setDefaultDisplayProperties(changeProperties);
438  return;
439  }
440 
442  changeProperties.setColor(color);
444 }
445 
446 void
448 {
451  changeProperties.setIsVisible(m_isVisibleCheckBox->isChecked());
452  m_collection->setDefaultDisplayProperties(changeProperties);
453  fClient->NeedRedraw(m_isVisibleButton);
454 }
455 
456 static
458 {
459  static TGGC* s_context = nullptr;
460  if(nullptr==s_context) {
461  GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
462  s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT,kTRUE);
463  s_context->SetForeground(s_context->GetBackground());
464  //s_context->SetForeground(gVirtualX->GetPixel(kBlue+2));
465  }
466  return s_context;
467 }
468 
469 void
471 {
472  const TGPicture* picture = nullptr;
473  const TGPicture* down = nullptr;
474  const TGPicture* disabled=nullptr;
475 
476  if(m_collectionShown) {
477  picture = arrow_right(!m_backgroundIsWhite);
480  m_collectionShown = false;
481  HideFrame(m_tableWidget);
482  m_hints->SetLayoutHints(kLHintsExpandX);
483  } else {
484  picture = arrow_down(!m_backgroundIsWhite);
487  m_collectionShown = true;
488 
489  if(nullptr == m_tableManager) {
490  GCValues_t t = *(GetWhiteGC().GetAttributes());
491  t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
492  m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
493 
494  TGGC* hilightContext=selectContext();
497  m_tableWidget->SetHeaderBackgroundColor(fClient->GetResourcePool()->GetFrameGC()->GetBackground());
498  colorTable();
499  AddFrame(m_tableWidget, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
500  m_tableWidget->Connect("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)","FWCollectionSummaryWidget",this,"modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
501 
502  MapSubwindows();
503  Layout();
504  }
505  ShowFrame(m_tableWidget);
506  m_hints->SetLayoutHints(kLHintsExpandX|kLHintsExpandY);
507  //NOTE: if I don't do the resize then the vertical scrollbars for the table are
508  // messed up when the number of entries in the table can be fully scene but
509  // a scrollbar is still added which thinks only a tiny area of the list can be seen
510  m_tableWidget->Resize(m_tableWidget->GetWidth(),m_tableWidget->GetHeight());
511  }
512 
513  if(nullptr!=m_parent) {
514  m_parent->Layout();
515  }
516  m_showHideButton->swapIcons(picture,down,disabled);
517 }
518 
519 
520 
521 void
523 {
524  if (nullptr==m_colorPopup)
525  {
526  std::vector<Color_t> colors;
528 
529  m_colorPopup = new FWColorPopup(gClient->GetDefaultRoot(), m_collection->defaultDisplayProperties().color());
531  m_colorPopup->Connect("ColorSelected(Color_t)","FWCollectionSummaryWidget", this, "colorChangeRequested(Color_t)");
532  }
533 }
534 
535 void
537 {
539  m_indexForColor=-1;
540 
542  Window_t wdummy;
543  Int_t ax, ay;
544  gVirtualX->TranslateCoordinates(m_colorSelectWidget->GetId(), gClient->GetDefaultRoot()->GetId(), 0,
545  m_colorSelectWidget->GetHeight(), ax, ay, wdummy);
546  m_colorPopup->SetName(m_collection->name().c_str());
547  std::vector<Color_t> colors;
548  cm->fillLimitedColors(colors);
551  m_colorPopup->PlacePopup(ax, ay, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
552 }
553 
554 void
555 FWCollectionSummaryWidget::itemColorClicked(int iIndex, Int_t iRootX, Int_t iRootY)
556 {
558  m_indexForColor=iIndex;
559 
561  std::vector<Color_t> colors;
562  cm->fillLimitedColors(colors);
564  m_colorPopup->SetName(m_collection->modelName(iIndex).c_str());
566  m_colorPopup->PlacePopup(iRootX, iRootY, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
567 }
568 
569 void
570 FWCollectionSummaryWidget::modelSelected(Int_t iRow,Int_t iButton,Int_t iKeyMod,Int_t iGlobalX, Int_t iGlobalY)
571 {
572  if(iKeyMod & kKeyControlMask) {
573  m_collection->toggleSelect(iRow);
574  } else {
577  m_collection->select(iRow);
578  }
579  if(iButton==kButton3) {
580  requestForModelContextMenu(iGlobalX,iGlobalY);
581  }
582 }
583 
584 
585 void
587 {
588  Emit("requestForInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
589 }
590 
591 void
593 {
594  Emit("requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
595 }
596 
597 void
599 {
600  Emit("requestForErrorInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
601 }
602 
603 void
605 {
606  Emit("requestForController(FWEventItem*)",reinterpret_cast<long>(iItem));
607 }
608 
609 void
611 {
612  Long_t args[2];
613  args[0]=static_cast<Long_t>(iGlobalX);
614  args[1]=static_cast<Long_t> (iGlobalY);
615  Emit("requestForModelContextMenu(Int_t,Int_t)",args);
616 }
617 
618 void
620 {
621  if(!m_collection->itemIsSelected()) {
622  //NOTE: Want to be sure if models are selected then their collection is also selected
625  }
627 }
628 
629 void
631 {
632  if(!m_collection->itemIsSelected()) {
633  //NOTE: Want to be sure if models are selected then their collection is also selected
636  }
638 }
639 
640 void
642 {
643  if(!m_collection->itemIsSelected()) {
644  //NOTE: Want to be sure if models are selected then their collection is also selected
647  }
649 }
650 
651 void
653 {
654  if(iToWhite == m_backgroundIsWhite) {
655  return;
656  }
657  Pixel_t bc = 0x000000;
658  Pixel_t fg = 0xffffff;
659  if(iToWhite) {
660  bc = 0xffffff;
661  fg = 0x000000;
662  m_backgroundIsWhite=true;
663  SetBackgroundColor(kWidgetColorLight);
664  m_isVisibleButton->setNormCG(GetBlackGC()());
665  m_colorSelectWidget->setNormCG(GetBlackGC()());
666  selectContext()->SetForeground(0xafafFF);
667  } else {
668  m_backgroundIsWhite=false;
669  SetBackgroundColor(kWidgetColor);
670  m_isVisibleButton->setNormCG(GetWhiteGC()());
671  m_colorSelectWidget->setNormCG(GetWhiteGC()());
672  selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
673  }
674  //this forces the icons to be changed to the correct background
675  itemChanged();
676  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
677  {
678  const TGPicture* picture = info(!m_backgroundIsWhite);
679  const TGPicture* over = info_over(!m_backgroundIsWhite);
680  const TGPicture* disabled = info_disabled(!m_backgroundIsWhite);
681  m_infoButton->swapIcons(picture,
682  over,
683  disabled);
684  }
685  if(m_collectionShown) {
686  const TGPicture* picture = arrow_down(!m_backgroundIsWhite);
687  const TGPicture* down = arrow_down_disabled(!m_backgroundIsWhite);
688  const TGPicture* disabled = arrow_down_disabled(!m_backgroundIsWhite);
689  m_showHideButton->swapIcons(picture,down,disabled);
690  } else {
691  const TGPicture* picture = arrow_right(!m_backgroundIsWhite);
692  const TGPicture* down = arrow_right_disabled(!m_backgroundIsWhite);
694  m_showHideButton->swapIcons(picture,down,disabled);
695  }
696  colorTable();
697  m_holder->SetBackgroundColor(bc);
699  m_label->SetTextColor(fg);
700  m_isVisibleButton->SetBackgroundColor(bc);
701  m_colorSelectWidget->SetBackgroundColor(bc);
702  fClient->NeedRedraw(m_isVisibleButton);
703  fClient->NeedRedraw(m_colorSelectWidget);
704  fClient->NeedRedraw(m_holder);
705  fClient->NeedRedraw(this);
706 }
707 
708 void
710 {
711  if(nullptr==m_tableWidget) {
712  return;
713  }
714  if(m_backgroundIsWhite) {
717  m_tableContext->SetForeground(0x000000);
718  } else {
721  m_tableContext->SetForeground(0xffffff);
722  }
723 }
724 //
725 // const member functions
726 //
727 
728 //
729 // static member functions
730 //
731 
733 
static const TString & coreIcondir()
void Resize(UInt_t w, UInt_t h) override
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void setColor(Color_t iColor)
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:132
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
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:576
string disabled
Definition: mps_check.py:64
const std::string & name() const
Definition: FWEventItem.cc:502
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:278
const std::string & filterExpression() const
Definition: FWEventItem.cc:604
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:211
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:663
#define nullptr
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:157
ClassImp(AliDaqEventHeader) ClassImp(AliDaqPosition2D) ClassImp(AliDaqPositionCOPS) ClassImp(AliDaqTilt) ClassImp(AliDaqDistance) ClassImp(AliDaqTemperature) ClassImp(CocoaDaqRootEvent) CocoaDaqRootEvent
vector< Color_t > colors
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:202
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:669
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
void SetBackgroundColor(Pixel_t) override
static const TGPicture * filtered_over(bool iBackgroundIsBlack)
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:266
void selectItem()
Definition: FWEventItem.cc:634
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:674
static const unsigned long kWidgetColorLight
void select(int iIndex) const
Definition: FWEventItem.cc:252
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
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:214