CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 50 of file FWCollectionSummaryWidget.h.

Constructor & Destructor Documentation

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

Definition at line 253 of file FWCollectionSummaryWidget.cc.

References arrow_right(), arrow_right_disabled(), FWEventItem::defaultDisplayPropertiesChanged_, displayChanged(), FWEventItem::filterChanged_, info, info_disabled(), info_over(), itemChanged(), FWEventItem::itemChanged_, 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().

253  :
254 TGCompositeFrame(iParent),
255 m_collection(&iItem),
256 m_hints(iHints),
257 m_parent(iParent),
258 m_collectionShown(false),
259 m_tableContext(0),
260 m_indexForColor(-1),
261 m_colorPopup(0),
262 m_tableManager(0),
263 m_tableWidget(0),
264 m_backgroundIsWhite(false),
266 {
267  SetBackgroundColor(kWidgetColor);
268  const unsigned int backgroundColor=kBlack;
269 
270  TGCompositeFrame* hFrame = new TGHorizontalFrame(this, 10, 10, 0, backgroundColor);
271  m_holder = hFrame;
272  this->AddFrame(hFrame, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
273 
278  m_showHideButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"toggleShowHide()");
279  m_showHideButton->SetToolTipText("show/hide individual collection items");
280  m_collectionShown = false;
281  hFrame->AddFrame(m_showHideButton,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,6,10));
282 
283  //m_isVisibleButton = new TGCheckButton(this,"");
284  //m_isVisibleButton->SetState(kButtonDown, kFALSE);
286  m_isVisibleButton = new FWBoxIconButton(this, m_isVisibleCheckBox,-1,GetWhiteGC()());
287  m_isVisibleButton->SetBackgroundColor(backgroundColor);
288  m_isVisibleButton->SetToolTipText("make all items in collection visible/invisible");
289  hFrame->AddFrame(m_isVisibleButton,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,0,1));
290  m_isVisibleButton->Connect("Clicked()", "FWCollectionSummaryWidget", this, "toggleItemVisible()");
291 
293  m_colorSelectWidget = new FWBoxIconButton(this,m_colorSelectBox,-1,GetWhiteGC()());
294  hFrame->AddFrame(m_colorSelectWidget,new TGLayoutHints(kLHintsCenterY | kLHintsLeft,1));
295  //m_colorSelectWidget->Connect("ColorSelected(Pixel_t)", "FWCollectionSummaryWidget", this, "colorChangeRequested(Pixel_t)");
296  m_colorSelectWidget->Connect("Clicked()", "FWCollectionSummaryWidget",this,"colorClicked()");
297  m_colorSelectWidget->SetBackgroundColor(backgroundColor);
298  m_colorSelectWidget->SetToolTipText("set default color of items in collection");
299  GCValues_t t = *( GetWhiteGC().GetAttributes());
300  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
302 
303 
304  m_label = new BorderlessTextButton(this,
305  m_collection->name().c_str());
306  m_label->SetBackgroundColor(backgroundColor);
307  m_label->SetTextJustify(kTextLeft|kTextCenterY);
308  m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
309  hFrame->AddFrame(m_label, new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX,5,5));
310  m_label->Connect("Clicked()","FWCollectionSummaryWidget",this,"labelClicked()");
311  m_label->SetToolTipText("select collection and show controller");
312 
316  hFrame->AddFrame(m_stateButton, new TGLayoutHints(kLHintsCenterY| kLHintsLeft));
317  itemChanged();
318  displayChanged();
319  m_stateButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"stateClicked()");
320  m_stateButton->SetToolTipText("select collection and show filter");
321 
326  );
327  hFrame->AddFrame(m_infoButton, new TGLayoutHints(kLHintsCenterY| kLHintsRight,2,2));
328  m_infoButton->Connect("Clicked()","FWCollectionSummaryWidget",this,"infoClicked()");
329  m_infoButton->SetToolTipText("select collection and show data info");
330 
335 
336  MapSubwindows();
337  Layout();
338  MapWindow();
339 }
const std::string & name() const
Definition: FWEventItem.cc:501
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:208
static const TGPicture * arrow_right(bool iBackgroundIsBlack)
static const TGPicture * unfiltered_over(bool iBackgroundIsBlack)
FWCustomIconsButton * m_showHideButton
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:199
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:211
FWCollectionSummaryWidget::~FWCollectionSummaryWidget ( )
virtual

Definition at line 346 of file FWCollectionSummaryWidget.cc.

References m_colorPopup, m_connectionHolder, and m_graphicsContext.

347 {
348  delete m_colorPopup;
349  /* the following deletes lead to an infinite loop at the end of the job
350  delete m_hints;
351  delete m_showHideButton;
352  delete m_isVisibleButton;
353  delete m_colorSelectWidget;
354  delete m_stateButton;
355  delete m_infoButton;
356  */
357  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_graphicsContext->GetGC());
358  delete m_connectionHolder;
359 }
FWCollectionSummaryWidgetConnectionHolder * m_connectionHolder
FWCollectionSummaryWidget::FWCollectionSummaryWidget ( const FWCollectionSummaryWidget )
private

Member Function Documentation

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

Definition at line 433 of file FWCollectionSummaryWidget.cc.

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

434 {
435  if(-1 == m_indexForColor) {
437  changeProperties.setColor(color);
438  m_collection->setDefaultDisplayProperties(changeProperties);
439  return;
440  }
441 
443  changeProperties.setColor(color);
445 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
void setColor(Color_t iColor)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:277
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:156
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
void FWCollectionSummaryWidget::colorClicked ( )

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

538 {
540  m_indexForColor=-1;
541 
543  Window_t wdummy;
544  Int_t ax, ay;
545  gVirtualX->TranslateCoordinates(m_colorSelectWidget->GetId(), gClient->GetDefaultRoot()->GetId(), 0,
546  m_colorSelectWidget->GetHeight(), ax, ay, wdummy);
547  m_colorPopup->SetName(m_collection->name().c_str());
548  std::vector<Color_t> colors;
549  cm->fillLimitedColors(colors);
552  m_colorPopup->PlacePopup(ax, ay, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
553 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
void SetName(const char *iName)
const std::string & name() const
Definition: FWEventItem.cc:501
FWColorManager * colorManager() const
Definition: FWEventItem.h:138
std::vector< Color_t > colors
Definition: eve_filter.cc:26
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)
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 710 of file FWCollectionSummaryWidget.cc.

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

Referenced by setBackgroundToWhite(), and toggleShowHide().

711 {
712  if(0==m_tableWidget) {
713  return;
714  }
715  if(m_backgroundIsWhite) {
718  m_tableContext->SetForeground(0x000000);
719  } else {
722  m_tableContext->SetForeground(0xffffff);
723  }
724 }
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 523 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().

524 {
525  if (0==m_colorPopup)
526  {
527  std::vector<Color_t> colors;
529 
530  m_colorPopup = new FWColorPopup(gClient->GetDefaultRoot(), m_collection->defaultDisplayProperties().color());
532  m_colorPopup->Connect("ColorSelected(Color_t)","FWCollectionSummaryWidget", this, "colorChangeRequested(Color_t)");
533  }
534 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
void InitContent(const char *name, const std::vector< Color_t > &colors, bool backgroundIsBlack=true)
const std::string & name() const
Definition: FWEventItem.cc:501
FWColorManager * colorManager() const
Definition: FWEventItem.h:138
std::vector< Color_t > colors
Definition: eve_filter.cc:26
void fillLimitedColors(std::vector< Color_t > &cv) const
Color_t color() const
void FWCollectionSummaryWidget::displayChanged ( )

Definition at line 396 of file FWCollectionSummaryWidget.cc.

References FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), 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().

397 {
398  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
399  fClient->NeedRedraw(m_colorSelectWidget);
401  fClient->NeedRedraw(m_isVisibleButton);
403  fClient->NeedRedraw(m_label);
404 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
bool itemIsSelected() const
Definition: FWEventItem.cc:662
Color_t color() const
void setChecked(bool iChecked)
static void setLabelBackgroundColor(TGTextButton *iLabel, bool iIsSelected, bool iBackgroundIsWhite)
void FWCollectionSummaryWidget::infoClicked ( )

Definition at line 620 of file FWCollectionSummaryWidget.cc.

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

621 {
622  if(!m_collection->itemIsSelected()) {
623  //NOTE: Want to be sure if models are selected then their collection is also selected
626  }
628 }
bool itemIsSelected() const
Definition: FWEventItem.cc:662
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:134
void selectItem()
Definition: FWEventItem.cc:633
void FWCollectionSummaryWidget::itemChanged ( )

Definition at line 407 of file FWCollectionSummaryWidget.cc.

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

408 {
409  const TGPicture* picture = 0;
410  const TGPicture* down = 0;
411  const TGPicture* disabled=0;
412  if(m_collection->hasError()) {
413  picture = alert(!m_backgroundIsWhite);
415  disabled = alert_over(!m_backgroundIsWhite);
416  m_stateButton->SetToolTipText(m_collection->errorMessage().c_str());
417  } else {
418  if(m_collection->filterExpression().size()) {
419  picture = filtered(!m_backgroundIsWhite);
421  disabled = filtered_over(!m_backgroundIsWhite);
422  } else {
423  picture = unfiltered(!m_backgroundIsWhite);
426  }
427  m_stateButton->SetToolTipText("select collection and show filter");
428  }
429  m_stateButton->swapIcons(picture,down,disabled);
430 }
const std::string & filterExpression() const
Definition: FWEventItem.cc:603
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:668
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:673
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 556 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().

557 {
559  m_indexForColor=iIndex;
560 
562  std::vector<Color_t> colors;
563  cm->fillLimitedColors(colors);
565  m_colorPopup->SetName(m_collection->modelName(iIndex).c_str());
567  m_colorPopup->PlacePopup(iRootX, iRootY, m_colorPopup->GetDefaultWidth(), m_colorPopup->GetDefaultHeight());
568 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void SetName(const char *iName)
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:575
FWColorManager * colorManager() const
Definition: FWEventItem.h:138
std::vector< Color_t > colors
Definition: eve_filter.cc:26
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)
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:536
void FWCollectionSummaryWidget::labelClicked ( )

Definition at line 642 of file FWCollectionSummaryWidget.cc.

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

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

Definition at line 571 of file FWCollectionSummaryWidget.cc.

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

572 {
573  if(iKeyMod & kKeyControlMask) {
574  m_collection->toggleSelect(iRow);
575  } else {
578  m_collection->select(iRow);
579  }
580  if(iButton==kButton3) {
581  requestForModelContextMenu(iGlobalX,iGlobalY);
582  }
583 }
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:131
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:134
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:265
void select(int iIndex) const
Definition: FWEventItem.cc:251
void requestForModelContextMenu(Int_t, Int_t)
const FWCollectionSummaryWidget& FWCollectionSummaryWidget::operator= ( const FWCollectionSummaryWidget )
private
void FWCollectionSummaryWidget::requestForController ( FWEventItem iItem)

Definition at line 605 of file FWCollectionSummaryWidget.cc.

Referenced by labelClicked().

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

Definition at line 599 of file FWCollectionSummaryWidget.cc.

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

Definition at line 593 of file FWCollectionSummaryWidget.cc.

Referenced by stateClicked().

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

Definition at line 587 of file FWCollectionSummaryWidget.cc.

Referenced by infoClicked().

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

Definition at line 611 of file FWCollectionSummaryWidget.cc.

References harvestRelVal::args.

Referenced by modelSelected().

612 {
613  Long_t args[2];
614  args[0]=static_cast<Long_t>(iGlobalX);
615  args[1]=static_cast<Long_t> (iGlobalY);
616  Emit("requestForModelContextMenu(Int_t,Int_t)",args);
617 }
dictionary args
void FWCollectionSummaryWidget::setBackgroundToWhite ( bool  iToWhite)

Definition at line 653 of file FWCollectionSummaryWidget.cc.

References arrow_down(), arrow_down_disabled(), arrow_right(), arrow_right_disabled(), FWDisplayProperties::color(), colorTable(), FWEventItem::defaultDisplayProperties(), info, info_disabled(), info_over(), itemChanged(), FWEventItem::itemIsSelected(), 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().

654 {
655  if(iToWhite == m_backgroundIsWhite) {
656  return;
657  }
658  Pixel_t bc = 0x000000;
659  Pixel_t fg = 0xffffff;
660  if(iToWhite) {
661  bc = 0xffffff;
662  fg = 0x000000;
663  m_backgroundIsWhite=true;
664  SetBackgroundColor(kWidgetColorLight);
665  m_isVisibleButton->setNormCG(GetBlackGC()());
666  m_colorSelectWidget->setNormCG(GetBlackGC()());
667  selectContext()->SetForeground(0xafafFF);
668  } else {
669  m_backgroundIsWhite=false;
670  SetBackgroundColor(kWidgetColor);
671  m_isVisibleButton->setNormCG(GetWhiteGC()());
672  m_colorSelectWidget->setNormCG(GetWhiteGC()());
673  selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
674  }
675  //this forces the icons to be changed to the correct background
676  itemChanged();
677  m_graphicsContext->SetForeground(gVirtualX->GetPixel(m_collection->defaultDisplayProperties().color()));
678  {
679  const TGPicture* picture = info(!m_backgroundIsWhite);
680  const TGPicture* over = info_over(!m_backgroundIsWhite);
681  const TGPicture* disabled = info_disabled(!m_backgroundIsWhite);
682  m_infoButton->swapIcons(picture,
683  over,
684  disabled);
685  }
686  if(m_collectionShown) {
687  const TGPicture* picture = arrow_down(!m_backgroundIsWhite);
688  const TGPicture* down = arrow_down_disabled(!m_backgroundIsWhite);
689  const TGPicture* disabled = arrow_down_disabled(!m_backgroundIsWhite);
690  m_showHideButton->swapIcons(picture,down,disabled);
691  } else {
692  const TGPicture* picture = arrow_right(!m_backgroundIsWhite);
693  const TGPicture* down = arrow_right_disabled(!m_backgroundIsWhite);
694  const TGPicture* disabled = arrow_right_disabled(!m_backgroundIsWhite);
695  m_showHideButton->swapIcons(picture,down,disabled);
696  }
697  colorTable();
698  m_holder->SetBackgroundColor(bc);
700  m_label->SetTextColor(fg);
701  m_isVisibleButton->SetBackgroundColor(bc);
702  m_colorSelectWidget->SetBackgroundColor(bc);
703  fClient->NeedRedraw(m_isVisibleButton);
704  fClient->NeedRedraw(m_colorSelectWidget);
705  fClient->NeedRedraw(m_holder);
706  fClient->NeedRedraw(this);
707 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
static const TGPicture * arrow_down(bool iBackgroundIsBlack)
static TGGC * selectContext()
bool itemIsSelected() const
Definition: FWEventItem.cc:662
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 631 of file FWCollectionSummaryWidget.cc.

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

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

Definition at line 448 of file FWCollectionSummaryWidget.cc.

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

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

Definition at line 471 of file FWCollectionSummaryWidget.cc.

References arrow_down(), arrow_down_disabled(), arrow_right(), arrow_right_disabled(), colorTable(), 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.

472 {
473  const TGPicture* picture = 0;
474  const TGPicture* down = 0;
475  const TGPicture* disabled=0;
476 
477  if(m_collectionShown) {
478  picture = arrow_right(!m_backgroundIsWhite);
481  m_collectionShown = false;
482  HideFrame(m_tableWidget);
483  m_hints->SetLayoutHints(kLHintsExpandX);
484  } else {
485  picture = arrow_down(!m_backgroundIsWhite);
488  m_collectionShown = true;
489 
490  if(0 == m_tableManager) {
491  GCValues_t t = *(GetWhiteGC().GetAttributes());
492  t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
493  m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
494 
495  TGGC* hilightContext=selectContext();
498  m_tableWidget->SetHeaderBackgroundColor(fClient->GetResourcePool()->GetFrameGC()->GetBackground());
499  colorTable();
500  AddFrame(m_tableWidget, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
501  m_tableWidget->Connect("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)","FWCollectionSummaryWidget",this,"modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
502 
503  MapSubwindows();
504  Layout();
505  }
506  ShowFrame(m_tableWidget);
507  m_hints->SetLayoutHints(kLHintsExpandX|kLHintsExpandY);
508  //NOTE: if I don't do the resize then the vertical scrollbars for the table are
509  // messed up when the number of entries in the table can be fully scene but
510  // a scrollbar is still added which thinks only a tiny area of the list can be seen
511  m_tableWidget->Resize(m_tableWidget->GetWidth(),m_tableWidget->GetHeight());
512  }
513 
514  if(0!=m_parent) {
515  m_parent->Layout();
516  }
517  m_showHideButton->swapIcons(picture,down,disabled);
518 }
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 104 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 97 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

TGFrame* FWCollectionSummaryWidget::m_holder
private

Definition at line 108 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and setBackgroundToWhite().

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

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

Referenced by toggleShowHide().

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

Definition at line 105 of file FWCollectionSummaryWidget.h.

Referenced by FWCollectionSummaryWidget(), and itemChanged().

TGGC* FWCollectionSummaryWidget::m_tableContext
private

Definition at line 111 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().

FWCollectionSummaryTableManager* FWCollectionSummaryWidget::m_tableManager
private

Definition at line 115 of file FWCollectionSummaryWidget.h.

Referenced by toggleShowHide().

FWTableWidget* FWCollectionSummaryWidget::m_tableWidget
private

Definition at line 116 of file FWCollectionSummaryWidget.h.

Referenced by colorTable(), and toggleShowHide().