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() [1/2]

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

Definition at line 225 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(), submitPVValidationJobs::t, unfiltered(), and unfiltered_over().

226  : TGCompositeFrame(iParent),
227  m_collection(&iItem),
228  m_hints(iHints),
229  m_parent(iParent),
230  m_collectionShown(false),
231  m_tableContext(nullptr),
232  m_indexForColor(-1),
233  m_colorPopup(nullptr),
234  m_tableManager(nullptr),
235  m_tableWidget(nullptr),
236  m_backgroundIsWhite(false),
238  SetBackgroundColor(kWidgetColor);
239  const unsigned int backgroundColor = kBlack;
240 
241  TGCompositeFrame* hFrame = new TGHorizontalFrame(this, 10, 10, 0, backgroundColor);
242  m_holder = hFrame;
243  this->AddFrame(hFrame, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
244 
249  m_showHideButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleShowHide()");
250  m_showHideButton->SetToolTipText("show/hide individual collection items");
251  m_collectionShown = false;
252  hFrame->AddFrame(m_showHideButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 6, 10));
253 
254  //m_isVisibleButton = new TGCheckButton(this,"");
255  //m_isVisibleButton->SetState(kButtonDown, kFALSE);
257  m_isVisibleButton = new FWBoxIconButton(this, m_isVisibleCheckBox, -1, GetWhiteGC()());
258  m_isVisibleButton->SetBackgroundColor(backgroundColor);
259  m_isVisibleButton->SetToolTipText("make all items in collection visible/invisible");
260  hFrame->AddFrame(m_isVisibleButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 1));
261  m_isVisibleButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleItemVisible()");
262 
264  m_colorSelectWidget = new FWBoxIconButton(this, m_colorSelectBox, -1, GetWhiteGC()());
265  hFrame->AddFrame(m_colorSelectWidget, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 1));
266  //m_colorSelectWidget->Connect("ColorSelected(Pixel_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Pixel_t)");
267  m_colorSelectWidget->Connect("Clicked()", "FWCollectionSummaryWidget", this, "colorClicked()");
268  m_colorSelectWidget->SetBackgroundColor(backgroundColor);
269  m_colorSelectWidget->SetToolTipText("set default color of items in collection");
270  GCValues_t t = *(GetWhiteGC().GetAttributes());
271  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
273 
274  m_label = new BorderlessTextButton(this, m_collection->name().c_str());
275  m_label->SetBackgroundColor(backgroundColor);
276  m_label->SetTextJustify(kTextLeft | kTextCenterY);
277  m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
278  hFrame->AddFrame(m_label, new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX, 5, 5));
279  m_label->Connect("Clicked()", "FWCollectionSummaryWidget", this, "labelClicked()");
280  m_label->SetToolTipText("select collection and show controller");
281 
286  hFrame->AddFrame(m_stateButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft));
287  itemChanged();
288  displayChanged();
289  m_stateButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "stateClicked()");
290  m_stateButton->SetToolTipText("select collection and show filter");
291 
294  hFrame->AddFrame(m_infoButton, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2));
295  m_infoButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "infoClicked()");
296  m_infoButton->SetToolTipText("select collection and show data info");
297 
300  std::bind(&FWCollectionSummaryWidget::displayChanged, this)));
305 
306  MapSubwindows();
307  Layout();
308  MapWindow();
309 }
static const TGPicture * info(bool iBackgroundIsBlack)
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
const std::string & name() const
Definition: FWEventItem.cc:435
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::~FWCollectionSummaryWidget ( )
override

Definition at line 316 of file FWCollectionSummaryWidget.cc.

References m_colorPopup, m_connectionHolder, and m_graphicsContext.

316  {
317  delete m_colorPopup;
318  /* the following deletes lead to an infinite loop at the end of the job
319  delete m_hints;
320  delete m_showHideButton;
321  delete m_isVisibleButton;
322  delete m_colorSelectWidget;
323  delete m_stateButton;
324  delete m_infoButton;
325  */
326  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_graphicsContext->GetGC());
327  delete m_connectionHolder;
328 }
FWCollectionSummaryWidgetConnectionHolder * m_connectionHolder

◆ FWCollectionSummaryWidget() [2/2]

FWCollectionSummaryWidget::FWCollectionSummaryWidget ( const FWCollectionSummaryWidget )
private

Member Function Documentation

◆ ClassDefOverride()

FWCollectionSummaryWidget::ClassDefOverride ( FWCollectionSummaryWidget  ,
 
)

◆ colorChangeRequested()

void FWCollectionSummaryWidget::colorChangeRequested ( Color_t  iColorIndex)

Definition at line 394 of file FWCollectionSummaryWidget.cc.

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

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

◆ colorClicked()

void FWCollectionSummaryWidget::colorClicked ( )

Definition at line 488 of file FWCollectionSummaryWidget.cc.

References FWColorManager::backgroundColorIndex(), FWDisplayProperties::color(), FWEventItem::colorManager(), pv::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().

488  {
490  m_indexForColor = -1;
491 
493  Window_t wdummy;
494  Int_t ax, ay;
495  gVirtualX->TranslateCoordinates(m_colorSelectWidget->GetId(),
496  gClient->GetDefaultRoot()->GetId(),
497  0,
498  m_colorSelectWidget->GetHeight(),
499  ax,
500  ay,
501  wdummy);
502  m_colorPopup->SetName(m_collection->name().c_str());
503  std::vector<Color_t> colors;
507  m_colorPopup->PlacePopup(ax, ay, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
508 }
void SetName(const char *iName) override
BackgroundColorIndex backgroundColorIndex() const
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void ResetColors(const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
void SetSelection(Color_t)
const std::string & name() const
Definition: FWEventItem.cc:435
const Int_t colors[8]
Definition: colors.py:1
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
void fillLimitedColors(std::vector< Color_t > &cv) const

◆ colorTable()

void FWCollectionSummaryWidget::colorTable ( )
private

Definition at line 639 of file FWCollectionSummaryWidget.cc.

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

Referenced by setBackgroundToWhite(), and toggleShowHide().

639  {
640  if (nullptr == m_tableWidget) {
641  return;
642  }
643  if (m_backgroundIsWhite) {
646  m_tableContext->SetForeground(0x000000);
647  } else {
650  m_tableContext->SetForeground(0xffffff);
651  }
652 }
void SetLineSeparatorColor(Pixel_t)
void SetBackgroundColor(Pixel_t) override
static const unsigned long kWidgetColor
static const unsigned long kWidgetColorLight

◆ createColorPopup()

void FWCollectionSummaryWidget::createColorPopup ( )
private

Definition at line 477 of file FWCollectionSummaryWidget.cc.

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

Referenced by colorClicked(), and itemColorClicked().

477  {
478  if (nullptr == m_colorPopup) {
479  std::vector<Color_t> colors;
481 
482  m_colorPopup = new FWColorPopup(gClient->GetDefaultRoot(), m_collection->defaultDisplayProperties().color());
484  m_colorPopup->Connect("ColorSelected(Color_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Color_t)");
485  }
486 }
void InitContent(const char *name, const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
const std::string & name() const
Definition: FWEventItem.cc:435
const Int_t colors[8]
Definition: colors.py:1
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
void fillLimitedColors(std::vector< Color_t > &cv) const

◆ displayChanged()

void FWCollectionSummaryWidget::displayChanged ( )

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

361  {
362  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
363  fClient->NeedRedraw(m_colorSelectWidget);
365  fClient->NeedRedraw(m_isVisibleButton);
367  fClient->NeedRedraw(m_label);
368 }
bool itemIsSelected() const
Definition: FWEventItem.cc:537
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void setChecked(bool iChecked)
static void setLabelBackgroundColor(TGTextButton *iLabel, bool iIsSelected, bool iBackgroundIsWhite)

◆ infoClicked()

void FWCollectionSummaryWidget::infoClicked ( )

Definition at line 559 of file FWCollectionSummaryWidget.cc.

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

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

◆ itemChanged()

void FWCollectionSummaryWidget::itemChanged ( )

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

370  {
371  const TGPicture* picture = nullptr;
372  const TGPicture* down = nullptr;
373  const TGPicture* disabled = nullptr;
374  if (m_collection->hasError()) {
375  picture = alert(!m_backgroundIsWhite);
378  m_stateButton->SetToolTipText(m_collection->errorMessage().c_str());
379  } else {
380  if (!m_collection->filterExpression().empty()) {
381  picture = filtered(!m_backgroundIsWhite);
384  } else {
385  picture = unfiltered(!m_backgroundIsWhite);
388  }
389  m_stateButton->SetToolTipText("select collection and show filter");
390  }
391  m_stateButton->swapIcons(picture, down, disabled);
392 }
string disabled
Definition: mps_check.py:68
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:541
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
const std::string & filterExpression() const
Definition: FWEventItem.cc:491
static const TGPicture * filtered_over(bool iBackgroundIsBlack)
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
static const TGPicture * unfiltered(bool iBackgroundIsBlack)

◆ itemColorClicked()

void FWCollectionSummaryWidget::itemColorClicked ( int  iIndex,
Int_t  iRootX,
Int_t  iRootY 
)

Definition at line 510 of file FWCollectionSummaryWidget.cc.

References FWColorManager::backgroundColorIndex(), FWDisplayProperties::color(), FWEventItem::colorManager(), pv::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().

510  {
512  m_indexForColor = iIndex;
513 
515  std::vector<Color_t> colors;
518  m_colorPopup->SetName(m_collection->modelName(iIndex).c_str());
520  m_colorPopup->PlacePopup(iRootX, iRootY, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
521 }
void SetName(const char *iName) override
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
BackgroundColorIndex backgroundColorIndex() const
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
void ResetColors(const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
void SetSelection(Color_t)
const Int_t colors[8]
Definition: colors.py:1
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void fillLimitedColors(std::vector< Color_t > &cv) const

◆ labelClicked()

void FWCollectionSummaryWidget::labelClicked ( )

Definition at line 577 of file FWCollectionSummaryWidget.cc.

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

577  {
578  if (!m_collection->itemIsSelected()) {
579  //NOTE: Want to be sure if models are selected then their collection is also selected
582  }
584 }
bool itemIsSelected() const
Definition: FWEventItem.cc:537
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void selectItem()
Definition: FWEventItem.cc:514

◆ modelSelected()

void FWCollectionSummaryWidget::modelSelected ( Int_t  iRow,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 523 of file FWCollectionSummaryWidget.cc.

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

523  {
524  if (iKeyMod & kKeyControlMask) {
525  m_collection->toggleSelect(iRow);
526  } else {
529  m_collection->select(iRow);
530  }
531  if (iButton == kButton3) {
532  requestForModelContextMenu(iGlobalX, iGlobalY);
533  }
534 }
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:123
void select(int iIndex) const
Definition: FWEventItem.cc:224
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
void requestForModelContextMenu(Int_t, Int_t)
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:236

◆ operator=()

const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator= ( const FWCollectionSummaryWidget )
private

◆ requestForController()

void FWCollectionSummaryWidget::requestForController ( FWEventItem iItem)

Definition at line 548 of file FWCollectionSummaryWidget.cc.

Referenced by labelClicked().

548  {
549  Emit("requestForController(FWEventItem*)", reinterpret_cast<long>(iItem));
550 }

◆ requestForErrorInfo()

void FWCollectionSummaryWidget::requestForErrorInfo ( FWEventItem iItem)

Definition at line 544 of file FWCollectionSummaryWidget.cc.

544  {
545  Emit("requestForErrorInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
546 }

◆ requestForFilter()

void FWCollectionSummaryWidget::requestForFilter ( FWEventItem iItem)

Definition at line 540 of file FWCollectionSummaryWidget.cc.

Referenced by stateClicked().

540  {
541  Emit("requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
542 }

◆ requestForInfo()

void FWCollectionSummaryWidget::requestForInfo ( FWEventItem iItem)

Definition at line 536 of file FWCollectionSummaryWidget.cc.

Referenced by infoClicked().

536  {
537  Emit("requestForInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
538 }

◆ requestForModelContextMenu()

void FWCollectionSummaryWidget::requestForModelContextMenu ( Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 552 of file FWCollectionSummaryWidget.cc.

References writedatasetfile::args.

Referenced by modelSelected().

552  {
553  Long_t args[2];
554  args[0] = static_cast<Long_t>(iGlobalX);
555  args[1] = static_cast<Long_t>(iGlobalY);
556  Emit("requestForModelContextMenu(Int_t,Int_t)", args);
557 }

◆ setBackgroundToWhite()

void FWCollectionSummaryWidget::setBackgroundToWhite ( bool  iToWhite)

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

586  {
587  if (iToWhite == m_backgroundIsWhite) {
588  return;
589  }
590  Pixel_t bc = 0x000000;
591  Pixel_t fg = 0xffffff;
592  if (iToWhite) {
593  bc = 0xffffff;
594  fg = 0x000000;
595  m_backgroundIsWhite = true;
596  SetBackgroundColor(kWidgetColorLight);
597  m_isVisibleButton->setNormCG(GetBlackGC()());
598  m_colorSelectWidget->setNormCG(GetBlackGC()());
599  selectContext()->SetForeground(0xafafFF);
600  } else {
601  m_backgroundIsWhite = false;
602  SetBackgroundColor(kWidgetColor);
603  m_isVisibleButton->setNormCG(GetWhiteGC()());
604  m_colorSelectWidget->setNormCG(GetWhiteGC()());
605  selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
606  }
607  //this forces the icons to be changed to the correct background
608  itemChanged();
609  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
610  {
611  const TGPicture* picture = info(!m_backgroundIsWhite);
612  const TGPicture* over = info_over(!m_backgroundIsWhite);
613  const TGPicture* disabled = info_disabled(!m_backgroundIsWhite);
614  m_infoButton->swapIcons(picture, over, disabled);
615  }
616  if (m_collectionShown) {
617  const TGPicture* picture = arrow_down(!m_backgroundIsWhite);
618  const TGPicture* down = arrow_down_disabled(!m_backgroundIsWhite);
619  const TGPicture* disabled = arrow_down_disabled(!m_backgroundIsWhite);
621  } else {
622  const TGPicture* picture = arrow_right(!m_backgroundIsWhite);
623  const TGPicture* down = arrow_right_disabled(!m_backgroundIsWhite);
626  }
627  colorTable();
628  m_holder->SetBackgroundColor(bc);
630  m_label->SetTextColor(fg);
631  m_isVisibleButton->SetBackgroundColor(bc);
632  m_colorSelectWidget->SetBackgroundColor(bc);
633  fClient->NeedRedraw(m_isVisibleButton);
634  fClient->NeedRedraw(m_colorSelectWidget);
635  fClient->NeedRedraw(m_holder);
636  fClient->NeedRedraw(this);
637 }
static const TGPicture * info(bool iBackgroundIsBlack)
string disabled
Definition: mps_check.py:68
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
bool itemIsSelected() const
Definition: FWEventItem.cc:537
static TGGC * selectContext()
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
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)

◆ stateClicked()

void FWCollectionSummaryWidget::stateClicked ( )

Definition at line 568 of file FWCollectionSummaryWidget.cc.

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

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

◆ toggleItemVisible()

void FWCollectionSummaryWidget::toggleItemVisible ( )

Definition at line 407 of file FWCollectionSummaryWidget.cc.

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

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

◆ toggleShowHide()

void FWCollectionSummaryWidget::toggleShowHide ( )

Definition at line 426 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 submitPVValidationJobs::t.

426  {
427  const TGPicture* picture = nullptr;
428  const TGPicture* down = nullptr;
429  const TGPicture* disabled = nullptr;
430 
431  if (m_collectionShown) {
432  picture = arrow_right(!m_backgroundIsWhite);
435  m_collectionShown = false;
436  HideFrame(m_tableWidget);
437  m_hints->SetLayoutHints(kLHintsExpandX);
438  } else {
439  picture = arrow_down(!m_backgroundIsWhite);
442  m_collectionShown = true;
443 
444  if (nullptr == m_tableManager) {
445  GCValues_t t = *(GetWhiteGC().GetAttributes());
446  t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
447  m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
448 
449  TGGC* hilightContext = selectContext();
452  m_tableWidget->SetHeaderBackgroundColor(fClient->GetResourcePool()->GetFrameGC()->GetBackground());
453  colorTable();
454  AddFrame(m_tableWidget, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
455  m_tableWidget->Connect("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
456  "FWCollectionSummaryWidget",
457  this,
458  "modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
459 
460  MapSubwindows();
461  Layout();
462  }
463  ShowFrame(m_tableWidget);
464  m_hints->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
465  //NOTE: if I don't do the resize then the vertical scrollbars for the table are
466  // messed up when the number of entries in the table can be fully scene but
467  // a scrollbar is still added which thinks only a tiny area of the list can be seen
468  m_tableWidget->Resize(m_tableWidget->GetWidth(), m_tableWidget->GetHeight());
469  }
470 
471  if (nullptr != m_parent) {
472  m_parent->Layout();
473  }
475 }
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

◆ m_backgroundIsWhite

bool FWCollectionSummaryWidget::m_backgroundIsWhite
private

◆ m_collection

FWEventItem* FWCollectionSummaryWidget::m_collection
private

◆ m_collectionShown

bool FWCollectionSummaryWidget::m_collectionShown
private

◆ m_colorPopup

FWColorPopup* FWCollectionSummaryWidget::m_colorPopup
private

◆ m_colorSelectBox

FWColorBoxIcon* FWCollectionSummaryWidget::m_colorSelectBox
private

Definition at line 101 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget().

◆ m_colorSelectWidget

FWBoxIconButton* FWCollectionSummaryWidget::m_colorSelectWidget
private

◆ m_connectionHolder

FWCollectionSummaryWidgetConnectionHolder* FWCollectionSummaryWidget::m_connectionHolder
private

◆ m_graphicsContext

TGGC* FWCollectionSummaryWidget::m_graphicsContext
private

◆ m_hints

TGLayoutHints* FWCollectionSummaryWidget::m_hints
private

Definition at line 94 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

◆ m_holder

TGFrame* FWCollectionSummaryWidget::m_holder
private

Definition at line 105 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

◆ m_indexForColor

int FWCollectionSummaryWidget::m_indexForColor
private

◆ m_infoButton

FWCustomIconsButton* FWCollectionSummaryWidget::m_infoButton
private

Definition at line 103 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

◆ m_isVisibleButton

FWBoxIconButton* FWCollectionSummaryWidget::m_isVisibleButton
private

◆ m_isVisibleCheckBox

FWCheckBoxIcon* FWCollectionSummaryWidget::m_isVisibleCheckBox
private

◆ m_label

TGTextButton* FWCollectionSummaryWidget::m_label
private

◆ m_parent

TGFrame* FWCollectionSummaryWidget::m_parent
private

Definition at line 95 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

◆ m_showHideButton

FWCustomIconsButton* FWCollectionSummaryWidget::m_showHideButton
private

◆ m_stateButton

FWCustomIconsButton* FWCollectionSummaryWidget::m_stateButton
private

Definition at line 102 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and itemChanged().

◆ m_tableContext

TGGC* FWCollectionSummaryWidget::m_tableContext
private

Definition at line 108 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().

◆ m_tableManager

FWCollectionSummaryTableManager* FWCollectionSummaryWidget::m_tableManager
private

Definition at line 112 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

◆ m_tableWidget

FWTableWidget* FWCollectionSummaryWidget::m_tableWidget
private

Definition at line 113 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().