CMS 3D CMS Logo

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