CMS 3D CMS Logo

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

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

Inheritance diagram for FWCustomIconsButton:

Public Member Functions

const TGPicture * bellowMouseIcon () const
 
const TGPicture * disabledIcon () const
 
const TGPicture * downIcon () const
 
 FWCustomIconsButton (const TGWindow *iParent, const TGPicture *iUpIcon, const TGPicture *iDownIcon, const TGPicture *iDisableIcon, const TGPicture *iBelowMouseIcon=nullptr, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
 
bool HandleCrossing (Event_t *) override
 
void setIcons (const TGPicture *iUpIcon, const TGPicture *iDownIcon, const TGPicture *iDisabledIcon, const TGPicture *ibelowMouseIcon=nullptr)
 
void swapIcons (const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
 
const TGPicture * upIcon () const
 
 ~FWCustomIconsButton () override
 

Protected Member Functions

void DoRedraw () override
 

Private Member Functions

 FWCustomIconsButton (const FWCustomIconsButton &)=delete
 
const FWCustomIconsButtonoperator= (const FWCustomIconsButton &)=delete
 

Private Attributes

const TGPicture * m_belowMouseIcon
 
const TGPicture * m_disabledIcon
 
const TGPicture * m_downIcon
 
bool m_inside
 
const TGPicture * m_upIcon
 

Detailed Description

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

Usage: <usage>

Definition at line 29 of file FWCustomIconsButton.h.

Constructor & Destructor Documentation

FWCustomIconsButton::FWCustomIconsButton ( const TGWindow *  iParent,
const TGPicture *  iUpIcon,
const TGPicture *  iDownIcon,
const TGPicture *  iDisableIcon,
const TGPicture *  iBelowMouseIcon = nullptr,
Int_t  id = -1,
GContext_t  norm = TGButton::GetDefaultGC() (),
UInt_t  option = 0 
)

Definition at line 33 of file FWCustomIconsButton.cc.

Referenced by bellowMouseIcon().

38  :
39  TGButton(iParent,id, norm, option),
40  m_upIcon(iUpIcon),
41  m_downIcon(iDownIcon),
42  m_disabledIcon(iDisabledIcon),
43  m_belowMouseIcon(iBelowMouseIcon),
44  m_inside(false)
45 {
46  assert(nullptr!=iUpIcon);
47  assert(nullptr!=iDownIcon);
48  assert(nullptr!=iDisabledIcon);
49  gVirtualX->ShapeCombineMask(GetId(), 0, 0, iUpIcon->GetMask());
50  SetBackgroundPixmap(iUpIcon->GetPicture());
51  Resize(iUpIcon->GetWidth(),iUpIcon->GetHeight());
52  fTWidth = iUpIcon->GetWidth();
53  fTHeight = iUpIcon->GetHeight();
54 }
const TGPicture * m_disabledIcon
const TGPicture * m_belowMouseIcon
const TGPicture * m_upIcon
const TGPicture * m_downIcon
FWCustomIconsButton::~FWCustomIconsButton ( )
override

Definition at line 61 of file FWCustomIconsButton.cc.

62 {
63 }
FWCustomIconsButton::FWCustomIconsButton ( const FWCustomIconsButton )
privatedelete

Member Function Documentation

const TGPicture* FWCustomIconsButton::bellowMouseIcon ( ) const
inline

Definition at line 63 of file FWCustomIconsButton.h.

References DoRedraw(), FWCustomIconsButton(), m_belowMouseIcon, and operator=().

63 { return m_belowMouseIcon; }
const TGPicture * m_belowMouseIcon
const TGPicture* FWCustomIconsButton::disabledIcon ( ) const
inline

Definition at line 62 of file FWCustomIconsButton.h.

References m_disabledIcon.

62 { return m_disabledIcon; }
const TGPicture * m_disabledIcon
void FWCustomIconsButton::DoRedraw ( )
overrideprotected

Definition at line 126 of file FWCustomIconsButton.cc.

References hcaldqm::quantity::fState, m_belowMouseIcon, m_disabledIcon, m_downIcon, m_inside, m_upIcon, x, and y.

Referenced by bellowMouseIcon().

127 {
128  //ChangeOptions(0);
129  //TGButton::DoRedraw();
130  //Stole this from TGPictureButton.
131  int x = (fWidth - fTWidth) >> 1;
132  int y = (fHeight - fTHeight) >> 1;
133 
134  switch(fState)
135  {
136  case kButtonUp:
137  if (m_belowMouseIcon && m_inside)
138  m_belowMouseIcon->Draw(fId, fNormGC,x,y);
139  else
140  m_upIcon->Draw(fId, fNormGC,x,y);
141  break;
142  case kButtonEngaged:
143  case kButtonDown:
144  m_downIcon->Draw(fId, fNormGC,x,y);
145  break;
146  case kButtonDisabled:
147  default:
148  m_disabledIcon->Draw(fId, fNormGC,x,y);
149  }
150 }
const TGPicture * m_disabledIcon
const TGPicture * m_belowMouseIcon
const TGPicture * m_upIcon
const TGPicture * m_downIcon
const TGPicture* FWCustomIconsButton::downIcon ( ) const
inline

Definition at line 61 of file FWCustomIconsButton.h.

References m_downIcon.

61 { return m_downIcon; }
const TGPicture * m_downIcon
bool FWCustomIconsButton::HandleCrossing ( Event_t *  event)
override

Definition at line 112 of file FWCustomIconsButton.cc.

References hcaldqm::fClient, and m_inside.

113 {
114  if (event->fType == kEnterNotify)
115  m_inside = true;
116  else if (event->fType == kLeaveNotify)
117  m_inside = false;
118 
119  fClient->NeedRedraw(this);
120 
121  return TGButton::HandleCrossing(event);
122 }
Definition: event.py:1
const FWCustomIconsButton& FWCustomIconsButton::operator= ( const FWCustomIconsButton )
privatedelete

Referenced by bellowMouseIcon().

void FWCustomIconsButton::setIcons ( const TGPicture *  iUpIcon,
const TGPicture *  iDownIcon,
const TGPicture *  iDisabledIcon,
const TGPicture *  ibelowMouseIcon = nullptr 
)

Definition at line 93 of file FWCustomIconsButton.cc.

References hcaldqm::fClient, m_belowMouseIcon, m_disabledIcon, m_downIcon, and m_upIcon.

Referenced by FWGUIManager::setFilterButtonIcon().

97 {
98  m_upIcon = iUpIcon;
99  m_downIcon = iDownIcon;
100  m_disabledIcon = iDisabledIcon;
101  m_belowMouseIcon = iBelowMouseIcon;
102 
103  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
104  fClient->NeedRedraw(this);
105 }
const TGPicture * m_disabledIcon
const TGPicture * m_belowMouseIcon
const TGPicture * m_upIcon
const TGPicture * m_downIcon
void FWCustomIconsButton::swapIcons ( const TGPicture *&  iUpIcon,
const TGPicture *&  iDownIcon,
const TGPicture *&  iDisabledIcon 
)

Definition at line 81 of file FWCustomIconsButton.cc.

References hcaldqm::fClient, m_disabledIcon, m_downIcon, m_upIcon, and std::swap().

Referenced by FWCollectionSummaryWidget::itemChanged(), FWCollectionSummaryWidget::setBackgroundToWhite(), CSGContinuousAction::stop(), CSGContinuousAction::switchMode(), FWCollectionSummaryWidget::toggleShowHide(), and FWTableView::toggleShowHide().

84 {
85  std::swap(iUpIcon,m_upIcon);
86  std::swap(iDownIcon,m_downIcon);
87  std::swap(iDisabledIcon,m_disabledIcon);
88  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
89  fClient->NeedRedraw(this);
90 }
const TGPicture * m_disabledIcon
const TGPicture * m_upIcon
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const TGPicture * m_downIcon
const TGPicture* FWCustomIconsButton::upIcon ( ) const
inline

Definition at line 60 of file FWCustomIconsButton.h.

References m_upIcon.

60 { return m_upIcon; }
const TGPicture * m_upIcon

Member Data Documentation

const TGPicture* FWCustomIconsButton::m_belowMouseIcon
private

Definition at line 76 of file FWCustomIconsButton.h.

Referenced by bellowMouseIcon(), DoRedraw(), and setIcons().

const TGPicture* FWCustomIconsButton::m_disabledIcon
private

Definition at line 75 of file FWCustomIconsButton.h.

Referenced by disabledIcon(), DoRedraw(), setIcons(), and swapIcons().

const TGPicture* FWCustomIconsButton::m_downIcon
private

Definition at line 74 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), downIcon(), setIcons(), and swapIcons().

bool FWCustomIconsButton::m_inside
private

Definition at line 78 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), and HandleCrossing().

const TGPicture* FWCustomIconsButton::m_upIcon
private

Definition at line 73 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), setIcons(), swapIcons(), and upIcon().