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

 ClassDefOverride (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 ()
 
 ~FWCollectionSummaryWidget () override
 

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 223 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(), OrderedSet::t, unfiltered(), and unfiltered_over().

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),
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 }
static const TGPicture * info(bool iBackgroundIsBlack)
const std::string & name() const
Definition: FWEventItem.cc:435
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:190
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
static const TGPicture * unfiltered_over(bool iBackgroundIsBlack)
FWCustomIconsButton * m_showHideButton
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
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:193
FWCollectionSummaryWidget::~FWCollectionSummaryWidget ( )
override

Definition at line 314 of file FWCollectionSummaryWidget.cc.

References m_colorPopup, m_connectionHolder, and m_graphicsContext.

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

Member Function Documentation

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

Definition at line 392 of file FWCollectionSummaryWidget.cc.

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

392  {
393  if (-1 == m_indexForColor) {
395  changeProperties.setColor(color);
396  m_collection->setDefaultDisplayProperties(changeProperties);
397  return;
398  }
399 
401  changeProperties.setColor(color);
403 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void setColor(Color_t iColor)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:247
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:138
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void FWCollectionSummaryWidget::colorClicked ( )

Definition at line 486 of file FWCollectionSummaryWidget.cc.

References 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().

486  {
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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
const std::string & name() const
Definition: FWEventItem.cc:435
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
void fillLimitedColors(std::vector< Color_t > &cv) const
void SetName(const char *iName) override
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 637 of file FWCollectionSummaryWidget.cc.

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

Referenced by setBackgroundToWhite(), and toggleShowHide().

637  {
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 }
void SetLineSeparatorColor(Pixel_t)
void SetBackgroundColor(Pixel_t) override
static const unsigned long kWidgetColor
static const unsigned long kWidgetColorLight
void FWCollectionSummaryWidget::createColorPopup ( )
private

Definition at line 475 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().

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

Definition at line 359 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().

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

Definition at line 557 of file FWCollectionSummaryWidget.cc.

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

557  {
558  if (!m_collection->itemIsSelected()) {
559  //NOTE: Want to be sure if models are selected then their collection is also selected
562  }
564 }
bool itemIsSelected() const
Definition: FWEventItem.cc:537
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void selectItem()
Definition: FWEventItem.cc:514
void FWCollectionSummaryWidget::itemChanged ( )

Definition at line 368 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().

368  {
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 }
string disabled
Definition: mps_check.py:68
const std::string & filterExpression() const
Definition: FWEventItem.cc:491
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:539
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:541
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 508 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().

508  {
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 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
void fillLimitedColors(std::vector< Color_t > &cv) const
void SetName(const char *iName) override
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:446
void FWCollectionSummaryWidget::labelClicked ( )

Definition at line 575 of file FWCollectionSummaryWidget.cc.

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

575  {
576  if (!m_collection->itemIsSelected()) {
577  //NOTE: Want to be sure if models are selected then their collection is also selected
580  }
582 }
bool itemIsSelected() const
Definition: FWEventItem.cc:537
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void selectItem()
Definition: FWEventItem.cc:514
void FWCollectionSummaryWidget::modelSelected ( Int_t  iRow,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 521 of file FWCollectionSummaryWidget.cc.

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

521  {
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 }
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:123
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:236
void select(int iIndex) const
Definition: FWEventItem.cc:224
void requestForModelContextMenu(Int_t, Int_t)
const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator= ( const FWCollectionSummaryWidget )
private
void FWCollectionSummaryWidget::requestForController ( FWEventItem iItem)

Definition at line 546 of file FWCollectionSummaryWidget.cc.

Referenced by labelClicked().

546  {
547  Emit("requestForController(FWEventItem*)", reinterpret_cast<long>(iItem));
548 }
void FWCollectionSummaryWidget::requestForErrorInfo ( FWEventItem iItem)

Definition at line 542 of file FWCollectionSummaryWidget.cc.

542  {
543  Emit("requestForErrorInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
544 }
void FWCollectionSummaryWidget::requestForFilter ( FWEventItem iItem)

Definition at line 538 of file FWCollectionSummaryWidget.cc.

Referenced by stateClicked().

538  {
539  Emit("requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
540 }
void FWCollectionSummaryWidget::requestForInfo ( FWEventItem iItem)

Definition at line 534 of file FWCollectionSummaryWidget.cc.

Referenced by infoClicked().

534  {
535  Emit("requestForInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
536 }
void FWCollectionSummaryWidget::requestForModelContextMenu ( Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 550 of file FWCollectionSummaryWidget.cc.

References writedatasetfile::args.

Referenced by modelSelected().

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

Definition at line 584 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().

584  {
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);
622  const TGPicture* disabled = 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 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
static const TGPicture * info(bool iBackgroundIsBlack)
string disabled
Definition: mps_check.py:68
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
static TGGC * selectContext()
bool itemIsSelected() const
Definition: FWEventItem.cc:537
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 566 of file FWCollectionSummaryWidget.cc.

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

566  {
567  if (!m_collection->itemIsSelected()) {
568  //NOTE: Want to be sure if models are selected then their collection is also selected
571  }
573 }
bool itemIsSelected() const
Definition: FWEventItem.cc:537
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void selectItem()
Definition: FWEventItem.cc:514
void FWCollectionSummaryWidget::toggleItemVisible ( )

Definition at line 405 of file FWCollectionSummaryWidget.cc.

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

405  {
408  changeProperties.setIsVisible(m_isVisibleCheckBox->isChecked());
409  m_collection->setDefaultDisplayProperties(changeProperties);
410  fClient->NeedRedraw(m_isVisibleButton);
411 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:138
bool isChecked() const
void setChecked(bool iChecked)
void setIsVisible(bool iSet)
void FWCollectionSummaryWidget::toggleShowHide ( )

Definition at line 424 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 OrderedSet::t.

424  {
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 }
void Resize(UInt_t w, UInt_t h) override
string disabled
Definition: mps_check.py:68
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)
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 101 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 94 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

TGFrame* FWCollectionSummaryWidget::m_holder
private

Definition at line 105 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

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

Definition at line 103 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 95 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

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

Definition at line 102 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and itemChanged().

TGGC* FWCollectionSummaryWidget::m_tableContext
private

Definition at line 108 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().

FWCollectionSummaryTableManager* FWCollectionSummaryWidget::m_tableManager
private

Definition at line 112 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

FWTableWidget* FWCollectionSummaryWidget::m_tableWidget
private

Definition at line 113 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().