CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWCollectionSummaryWidget Class Reference

#include <Fireworks/Core/interface/FWCollectionSummaryWidget.h>

Inheritance diagram for FWCollectionSummaryWidget:

Public Member Functions

 ClassDef (FWCollectionSummaryWidget, 0)
 
void colorChangeRequested (Color_t iColorIndex)
 
void colorClicked ()
 
void displayChanged ()
 
 FWCollectionSummaryWidget (TGFrame *iParent, FWEventItem &iItem, TGLayoutHints *)
 
void infoClicked ()
 
void itemChanged ()
 
void itemColorClicked (int iIndex, Int_t iRootX, Int_t iRootY)
 
void labelClicked ()
 
void modelSelected (Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
 
void requestForController (FWEventItem *)
 
void requestForErrorInfo (FWEventItem *)
 
void requestForFilter (FWEventItem *)
 
void requestForInfo (FWEventItem *)
 
void requestForModelContextMenu (Int_t, Int_t)
 
void setBackgroundToWhite (bool)
 
void stateClicked ()
 
void toggleItemVisible ()
 
void toggleShowHide ()
 
virtual ~FWCollectionSummaryWidget ()
 

Private Member Functions

void colorTable ()
 
void createColorPopup ()
 
 FWCollectionSummaryWidget (const FWCollectionSummaryWidget &)
 
const FWCollectionSummaryWidgetoperator= (const FWCollectionSummaryWidget &)
 

Private Attributes

bool m_backgroundIsWhite
 
FWEventItemm_collection
 
bool m_collectionShown
 
FWColorPopupm_colorPopup
 
FWColorBoxIconm_colorSelectBox
 
FWBoxIconButtonm_colorSelectWidget
 
FWCollectionSummaryWidgetConnectionHolderm_connectionHolder
 
TGGC * m_graphicsContext
 
TGLayoutHints * m_hints
 
TGFrame * m_holder
 
int m_indexForColor
 
FWCustomIconsButtonm_infoButton
 
FWBoxIconButtonm_isVisibleButton
 
FWCheckBoxIconm_isVisibleCheckBox
 
TGTextButton * m_label
 
TGFrame * m_parent
 
FWCustomIconsButtonm_showHideButton
 
FWCustomIconsButtonm_stateButton
 
TGGC * m_tableContext
 
FWCollectionSummaryTableManagerm_tableManager
 
FWTableWidgetm_tableWidget
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 49 of file FWCollectionSummaryWidget.h.

Constructor & Destructor Documentation

FWCollectionSummaryWidget::FWCollectionSummaryWidget ( TGFrame *  iParent,
FWEventItem iItem,
TGLayoutHints *  iHints 
)

Definition at line 252 of file FWCollectionSummaryWidget.cc.

References arrow_right(), arrow_right_disabled(), FWEventItem::defaultDisplayPropertiesChanged_, displayChanged(), FWEventItem::filterChanged_, info(), info_disabled(), info_over(), itemChanged(), FWEventItem::itemChanged_, kWidgetColor, m_backgroundIsWhite, m_collection, m_collectionShown, m_colorSelectBox, m_colorSelectWidget, m_connectionHolder, m_graphicsContext, m_holder, m_infoButton, m_isVisibleButton, m_isVisibleCheckBox, m_label, m_showHideButton, m_stateButton, FWEventItem::name(), FWCollectionSummaryWidgetConnectionHolder::push_back(), FWCollectionSummaryWidgetConnectionHolder::reserve(), FWColorBoxIcon::setColor(), lumiQTWidget::t, unfiltered(), and unfiltered_over().

252  :
253 TGCompositeFrame(iParent),
254 m_collection(&iItem),
255 m_hints(iHints),
256 m_parent(iParent),
257 m_collectionShown(false),
258 m_tableContext(0),
259 m_indexForColor(-1),
260 m_colorPopup(0),
261 m_tableManager(0),
262 m_tableWidget(0),
263 m_backgroundIsWhite(false),
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 }
static const TGPicture * info(bool iBackgroundIsBlack)
const std::string & name() const
Definition: FWEventItem.cc:502
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:212
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
static const TGPicture * unfiltered_over(bool iBackgroundIsBlack)
FWCustomIconsButton * m_showHideButton
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:203
static const TGPicture * info_disabled(bool iBackgroundIsBlack)
FWCollectionSummaryWidgetConnectionHolder * m_connectionHolder
static const TGPicture * info_over(bool iBackgroundIsBlack)
static const unsigned long kWidgetColor
static const TGPicture * arrow_right_disabled(bool iBackgroundIsBlack)
FWCollectionSummaryTableManager * m_tableManager
static const TGPicture * unfiltered(bool iBackgroundIsBlack)
void setColor(GContext_t iColorContext)
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:215
FWCollectionSummaryWidget::~FWCollectionSummaryWidget ( )
virtual

Definition at line 345 of file FWCollectionSummaryWidget.cc.

References m_colorPopup, m_connectionHolder, and m_graphicsContext.

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 }
FWCollectionSummaryWidgetConnectionHolder * m_connectionHolder
FWCollectionSummaryWidget::FWCollectionSummaryWidget ( const FWCollectionSummaryWidget )
private

Member Function Documentation

FWCollectionSummaryWidget::ClassDef ( FWCollectionSummaryWidget  ,
 
)
void FWCollectionSummaryWidget::colorChangeRequested ( Color_t  iColorIndex)

Definition at line 432 of file FWCollectionSummaryWidget.cc.

References FWEventItem::defaultDisplayProperties(), FWEventItem::ModelInfo::displayProperties(), m_collection, m_indexForColor, FWEventItem::modelInfo(), FWDisplayProperties::setColor(), FWEventItem::setDefaultDisplayProperties(), and FWEventItem::setDisplayProperties().

433 {
434  if(-1 == m_indexForColor) {
436  changeProperties.setColor(color);
437  m_collection->setDefaultDisplayProperties(changeProperties);
438  return;
439  }
440 
442  changeProperties.setColor(color);
444 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void setColor(Color_t iColor)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:278
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:157
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
void FWCollectionSummaryWidget::colorClicked ( )

Definition at line 536 of file FWCollectionSummaryWidget.cc.

References create_public_lumi_plots::ax, FWColorManager::backgroundColorIndex(), FWDisplayProperties::color(), FWEventItem::colorManager(), colors, createColorPopup(), FWEventItem::defaultDisplayProperties(), FWColorManager::fillLimitedColors(), FWColorManager::kBlackIndex, m_collection, m_colorPopup, m_colorSelectWidget, m_indexForColor, FWEventItem::name(), FWColorPopup::PlacePopup(), FWColorPopup::ResetColors(), FWColorPopup::SetName(), and FWColorPopup::SetSelection().

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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void SetName(const char *iName)
const std::string & name() const
Definition: FWEventItem.cc:502
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
void fillLimitedColors(std::vector< Color_t > &cv) const
Color_t color() const
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
vector< Color_t > colors
BackgroundColorIndex backgroundColorIndex() const
void ResetColors(const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
void SetSelection(Color_t)
void FWCollectionSummaryWidget::colorTable ( )
private

Definition at line 709 of file FWCollectionSummaryWidget.cc.

References ClassImp(), kWidgetColor, kWidgetColorLight, m_backgroundIsWhite, m_tableContext, m_tableWidget, FWTableWidget::SetBackgroundColor(), and FWTableWidget::SetLineSeparatorColor().

Referenced by setBackgroundToWhite(), and toggleShowHide().

710 {
711  if(0==m_tableWidget) {
712  return;
713  }
714  if(m_backgroundIsWhite) {
717  m_tableContext->SetForeground(0x000000);
718  } else {
721  m_tableContext->SetForeground(0xffffff);
722  }
723 }
void SetBackgroundColor(Pixel_t)
void SetLineSeparatorColor(Pixel_t)
static const unsigned long kWidgetColor
static const unsigned long kWidgetColorLight
void FWCollectionSummaryWidget::createColorPopup ( )
private

Definition at line 522 of file FWCollectionSummaryWidget.cc.

References FWDisplayProperties::color(), FWEventItem::colorManager(), colors, FWEventItem::defaultDisplayProperties(), FWColorManager::fillLimitedColors(), FWColorPopup::InitContent(), m_collection, m_colorPopup, and FWEventItem::name().

Referenced by colorClicked(), and itemColorClicked().

523 {
524  if (0==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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void InitContent(const char *name, const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
const std::string & name() const
Definition: FWEventItem.cc:502
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
void fillLimitedColors(std::vector< Color_t > &cv) const
Color_t color() const
vector< Color_t > colors
void FWCollectionSummaryWidget::displayChanged ( )

Definition at line 395 of file FWCollectionSummaryWidget.cc.

References FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), hcaldqm::fClient, FWDisplayProperties::isVisible(), FWEventItem::itemIsSelected(), m_backgroundIsWhite, m_collection, m_colorSelectWidget, m_graphicsContext, m_isVisibleButton, m_isVisibleCheckBox, m_label, FWCheckBoxIcon::setChecked(), and setLabelBackgroundColor().

Referenced by FWCollectionSummaryWidget().

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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
bool itemIsSelected() const
Definition: FWEventItem.cc:663
Color_t color() const
void setChecked(bool iChecked)
static void setLabelBackgroundColor(TGTextButton *iLabel, bool iIsSelected, bool iBackgroundIsWhite)
void FWCollectionSummaryWidget::infoClicked ( )

Definition at line 619 of file FWCollectionSummaryWidget.cc.

References FWSelectionManager::clearSelection(), FWEventItem::itemIsSelected(), m_collection, requestForInfo(), FWEventItem::selectionManager(), and FWEventItem::selectItem().

620 {
621  if(!m_collection->itemIsSelected()) {
622  //NOTE: Want to be sure if models are selected then their collection is also selected
625  }
627 }
bool itemIsSelected() const
Definition: FWEventItem.cc:663
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
void selectItem()
Definition: FWEventItem.cc:634
void FWCollectionSummaryWidget::itemChanged ( )

Definition at line 406 of file FWCollectionSummaryWidget.cc.

References alert(), alert_over(), mps_check::disabled, down, FWEventItem::errorMessage(), filtered(), filtered_over(), FWEventItem::filterExpression(), FWEventItem::hasError(), m_backgroundIsWhite, m_collection, m_stateButton, FWCustomIconsButton::swapIcons(), unfiltered(), and unfiltered_over().

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

407 {
408  const TGPicture* picture = 0;
409  const TGPicture* down = 0;
410  const TGPicture* disabled=0;
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().size()) {
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 }
string disabled
Definition: mps_check.py:63
const std::string & filterExpression() const
Definition: FWEventItem.cc:604
static const TGPicture * alert(bool iBackgroundIsBlack)
static const TGPicture * alert_over(bool iBackgroundIsBlack)
static const TGPicture * filtered(bool iBackgroundIsBlack)
static const TGPicture * unfiltered_over(bool iBackgroundIsBlack)
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:669
static const TGPicture * filtered_over(bool iBackgroundIsBlack)
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:674
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
static const TGPicture * unfiltered(bool iBackgroundIsBlack)
void FWCollectionSummaryWidget::itemColorClicked ( int  iIndex,
Int_t  iRootX,
Int_t  iRootY 
)

Definition at line 555 of file FWCollectionSummaryWidget.cc.

References FWColorManager::backgroundColorIndex(), FWDisplayProperties::color(), FWEventItem::colorManager(), colors, createColorPopup(), FWEventItem::ModelInfo::displayProperties(), FWColorManager::fillLimitedColors(), FWColorManager::kBlackIndex, m_collection, m_colorPopup, m_indexForColor, FWEventItem::modelInfo(), FWEventItem::modelName(), FWColorPopup::PlacePopup(), FWColorPopup::ResetColors(), FWColorPopup::SetName(), and FWColorPopup::SetSelection().

Referenced by FWCollectionSummaryTableManager::buttonReleasedInRowHeader().

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 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void SetName(const char *iName)
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:576
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
void fillLimitedColors(std::vector< Color_t > &cv) const
Color_t color() const
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
vector< Color_t > colors
BackgroundColorIndex backgroundColorIndex() const
void ResetColors(const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
void SetSelection(Color_t)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
void FWCollectionSummaryWidget::labelClicked ( )

Definition at line 641 of file FWCollectionSummaryWidget.cc.

References FWSelectionManager::clearSelection(), FWEventItem::itemIsSelected(), m_collection, requestForController(), FWEventItem::selectionManager(), and FWEventItem::selectItem().

642 {
643  if(!m_collection->itemIsSelected()) {
644  //NOTE: Want to be sure if models are selected then their collection is also selected
647  }
649 }
bool itemIsSelected() const
Definition: FWEventItem.cc:663
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
void selectItem()
Definition: FWEventItem.cc:634
void FWCollectionSummaryWidget::modelSelected ( Int_t  iRow,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 570 of file FWCollectionSummaryWidget.cc.

References FWEventItem::changeManager(), FWSelectionManager::clearSelection(), m_collection, requestForModelContextMenu(), FWEventItem::select(), FWEventItem::selectionManager(), and FWEventItem::toggleSelect().

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 }
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:132
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:266
void select(int iIndex) const
Definition: FWEventItem.cc:252
void requestForModelContextMenu(Int_t, Int_t)
const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator= ( const FWCollectionSummaryWidget )
private
void FWCollectionSummaryWidget::requestForController ( FWEventItem iItem)

Definition at line 604 of file FWCollectionSummaryWidget.cc.

Referenced by labelClicked().

605 {
606  Emit("requestForController(FWEventItem*)",reinterpret_cast<long>(iItem));
607 }
void FWCollectionSummaryWidget::requestForErrorInfo ( FWEventItem iItem)

Definition at line 598 of file FWCollectionSummaryWidget.cc.

599 {
600  Emit("requestForErrorInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
601 }
void FWCollectionSummaryWidget::requestForFilter ( FWEventItem iItem)

Definition at line 592 of file FWCollectionSummaryWidget.cc.

Referenced by stateClicked().

593 {
594  Emit("requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
595 }
void FWCollectionSummaryWidget::requestForInfo ( FWEventItem iItem)

Definition at line 586 of file FWCollectionSummaryWidget.cc.

Referenced by infoClicked().

587 {
588  Emit("requestForInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
589 }
void FWCollectionSummaryWidget::requestForModelContextMenu ( Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 610 of file FWCollectionSummaryWidget.cc.

References createfilelist::args.

Referenced by modelSelected().

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 }
void FWCollectionSummaryWidget::setBackgroundToWhite ( bool  iToWhite)

Definition at line 652 of file FWCollectionSummaryWidget.cc.

References arrow_down(), arrow_down_disabled(), arrow_right(), arrow_right_disabled(), FWDisplayProperties::color(), colorTable(), FWEventItem::defaultDisplayProperties(), mps_check::disabled, down, hcaldqm::fClient, info(), info_disabled(), info_over(), itemChanged(), FWEventItem::itemIsSelected(), kWidgetColor, kWidgetColorLight, m_backgroundIsWhite, m_collection, m_collectionShown, m_colorSelectWidget, m_graphicsContext, m_holder, m_infoButton, m_isVisibleButton, m_label, m_showHideButton, selectContext(), setLabelBackgroundColor(), FWBoxIconButton::setNormCG(), and FWCustomIconsButton::swapIcons().

Referenced by FWSummaryManager::newItem().

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);
693  const TGPicture* disabled = 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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
static const TGPicture * info(bool iBackgroundIsBlack)
string disabled
Definition: mps_check.py:63
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
static TGGC * selectContext()
bool itemIsSelected() const
Definition: FWEventItem.cc:663
Color_t color() const
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
FWCustomIconsButton * m_showHideButton
static const TGPicture * info_disabled(bool iBackgroundIsBlack)
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)
static const unsigned long kWidgetColorLight
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
static const TGPicture * arrow_right_disabled(bool iBackgroundIsBlack)
void FWCollectionSummaryWidget::stateClicked ( )

Definition at line 630 of file FWCollectionSummaryWidget.cc.

References FWSelectionManager::clearSelection(), FWEventItem::itemIsSelected(), m_collection, requestForFilter(), FWEventItem::selectionManager(), and FWEventItem::selectItem().

631 {
632  if(!m_collection->itemIsSelected()) {
633  //NOTE: Want to be sure if models are selected then their collection is also selected
636  }
638 }
bool itemIsSelected() const
Definition: FWEventItem.cc:663
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
void selectItem()
Definition: FWEventItem.cc:634
void FWCollectionSummaryWidget::toggleItemVisible ( )

Definition at line 447 of file FWCollectionSummaryWidget.cc.

References FWEventItem::defaultDisplayProperties(), hcaldqm::fClient, FWCheckBoxIcon::isChecked(), m_collection, m_isVisibleButton, m_isVisibleCheckBox, FWCheckBoxIcon::setChecked(), FWEventItem::setDefaultDisplayProperties(), and FWDisplayProperties::setIsVisible().

448 {
451  changeProperties.setIsVisible(m_isVisibleCheckBox->isChecked());
452  m_collection->setDefaultDisplayProperties(changeProperties);
453  fClient->NeedRedraw(m_isVisibleButton);
454 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:157
bool isChecked() const
void setChecked(bool iChecked)
void setIsVisible(bool iSet)
void FWCollectionSummaryWidget::toggleShowHide ( )

Definition at line 470 of file FWCollectionSummaryWidget.cc.

References arrow_down(), arrow_down_disabled(), arrow_right(), arrow_right_disabled(), colorTable(), mps_check::disabled, down, hcaldqm::fClient, m_backgroundIsWhite, m_collection, m_collectionShown, m_hints, m_parent, m_showHideButton, m_tableContext, m_tableManager, m_tableWidget, FWTableWidget::Resize(), selectContext(), FWTableWidget::SetHeaderBackgroundColor(), FWCustomIconsButton::swapIcons(), and lumiQTWidget::t.

471 {
472  const TGPicture* picture = 0;
473  const TGPicture* down = 0;
474  const TGPicture* disabled=0;
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(0 == 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(0!=m_parent) {
514  m_parent->Layout();
515  }
516  m_showHideButton->swapIcons(picture,down,disabled);
517 }
string disabled
Definition: mps_check.py:63
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
void SetHeaderBackgroundColor(Pixel_t)
static TGGC * selectContext()
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
FWCustomIconsButton * m_showHideButton
static const TGPicture * arrow_down_disabled(bool iBackgroundIsBlack)
virtual void Resize(UInt_t w, UInt_t h)
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
static const TGPicture * arrow_right_disabled(bool iBackgroundIsBlack)
FWCollectionSummaryTableManager * m_tableManager

Member Data Documentation

bool FWCollectionSummaryWidget::m_backgroundIsWhite
private
FWEventItem* FWCollectionSummaryWidget::m_collection
private
bool FWCollectionSummaryWidget::m_collectionShown
private
FWColorPopup* FWCollectionSummaryWidget::m_colorPopup
private
FWColorBoxIcon* FWCollectionSummaryWidget::m_colorSelectBox
private

Definition at line 103 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget().

FWBoxIconButton* FWCollectionSummaryWidget::m_colorSelectWidget
private
FWCollectionSummaryWidgetConnectionHolder* FWCollectionSummaryWidget::m_connectionHolder
private
TGGC* FWCollectionSummaryWidget::m_graphicsContext
private
TGLayoutHints* FWCollectionSummaryWidget::m_hints
private

Definition at line 96 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

TGFrame* FWCollectionSummaryWidget::m_holder
private

Definition at line 107 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

int FWCollectionSummaryWidget::m_indexForColor
private
FWCustomIconsButton* FWCollectionSummaryWidget::m_infoButton
private

Definition at line 105 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

FWBoxIconButton* FWCollectionSummaryWidget::m_isVisibleButton
private
FWCheckBoxIcon* FWCollectionSummaryWidget::m_isVisibleCheckBox
private
TGTextButton* FWCollectionSummaryWidget::m_label
private
TGFrame* FWCollectionSummaryWidget::m_parent
private

Definition at line 97 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

FWCustomIconsButton* FWCollectionSummaryWidget::m_showHideButton
private
FWCustomIconsButton* FWCollectionSummaryWidget::m_stateButton
private

Definition at line 104 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and itemChanged().

TGGC* FWCollectionSummaryWidget::m_tableContext
private

Definition at line 110 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().

FWCollectionSummaryTableManager* FWCollectionSummaryWidget::m_tableManager
private

Definition at line 114 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

FWTableWidget* FWCollectionSummaryWidget::m_tableWidget
private

Definition at line 115 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().