CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected 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)
 
 FWCustomIconsButton (const FWCustomIconsButton &)=delete
 
bool HandleCrossing (Event_t *) override
 
const FWCustomIconsButtonoperator= (const FWCustomIconsButton &)=delete
 
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 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 32 of file FWCustomIconsButton.cc.

References cms::cuda::assert().

40  : TGButton(iParent, id, norm, option),
41  m_upIcon(iUpIcon),
42  m_downIcon(iDownIcon),
43  m_disabledIcon(iDisabledIcon),
44  m_belowMouseIcon(iBelowMouseIcon),
45  m_inside(false) {
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
assert(be >=bs)
const TGPicture * m_downIcon
FWCustomIconsButton::~FWCustomIconsButton ( )
override

Definition at line 61 of file FWCustomIconsButton.cc.

61 {}
FWCustomIconsButton::FWCustomIconsButton ( const FWCustomIconsButton )
delete

Member Function Documentation

const TGPicture* FWCustomIconsButton::bellowMouseIcon ( ) const
inline

Definition at line 59 of file FWCustomIconsButton.h.

References m_belowMouseIcon.

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

Definition at line 58 of file FWCustomIconsButton.h.

References m_disabledIcon.

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

Definition at line 117 of file FWCustomIconsButton.cc.

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

117  {
118  //ChangeOptions(0);
119  //TGButton::DoRedraw();
120  //Stole this from TGPictureButton.
121  int x = (fWidth - fTWidth) >> 1;
122  int y = (fHeight - fTHeight) >> 1;
123 
124  switch (fState) {
125  case kButtonUp:
126  if (m_belowMouseIcon && m_inside)
127  m_belowMouseIcon->Draw(fId, fNormGC, x, y);
128  else
129  m_upIcon->Draw(fId, fNormGC, x, y);
130  break;
131  case kButtonEngaged:
132  case kButtonDown:
133  m_downIcon->Draw(fId, fNormGC, x, y);
134  break;
135  case kButtonDisabled:
136  default:
137  m_disabledIcon->Draw(fId, fNormGC, x, y);
138  }
139 }
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 57 of file FWCustomIconsButton.h.

References m_downIcon.

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

Definition at line 106 of file FWCustomIconsButton.cc.

References hcaldqm::fClient, and m_inside.

106  {
107  if (event->fType == kEnterNotify)
108  m_inside = true;
109  else if (event->fType == kLeaveNotify)
110  m_inside = false;
111 
112  fClient->NeedRedraw(this);
113 
114  return TGButton::HandleCrossing(event);
115 }
const FWCustomIconsButton& FWCustomIconsButton::operator= ( const FWCustomIconsButton )
delete
void FWCustomIconsButton::setIcons ( const TGPicture *  iUpIcon,
const TGPicture *  iDownIcon,
const TGPicture *  iDisabledIcon,
const TGPicture *  ibelowMouseIcon = nullptr 
)

Definition at line 88 of file FWCustomIconsButton.cc.

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

Referenced by FWGUIManager::setFilterButtonIcon().

91  {
92  m_upIcon = iUpIcon;
93  m_downIcon = iDownIcon;
94  m_disabledIcon = iDisabledIcon;
95  m_belowMouseIcon = iBelowMouseIcon;
96 
97  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
98  fClient->NeedRedraw(this);
99 }
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 78 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().

80  {
81  std::swap(iUpIcon, m_upIcon);
82  std::swap(iDownIcon, m_downIcon);
83  std::swap(iDisabledIcon, m_disabledIcon);
84  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
85  fClient->NeedRedraw(this);
86 }
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 56 of file FWCustomIconsButton.h.

References m_upIcon.

56 { return m_upIcon; }
const TGPicture * m_upIcon

Member Data Documentation

const TGPicture* FWCustomIconsButton::m_belowMouseIcon
private

Definition at line 73 of file FWCustomIconsButton.h.

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

const TGPicture* FWCustomIconsButton::m_disabledIcon
private

Definition at line 72 of file FWCustomIconsButton.h.

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

const TGPicture* FWCustomIconsButton::m_downIcon
private

Definition at line 71 of file FWCustomIconsButton.h.

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

bool FWCustomIconsButton::m_inside
private

Definition at line 75 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), and HandleCrossing().

const TGPicture* FWCustomIconsButton::m_upIcon
private

Definition at line 70 of file FWCustomIconsButton.h.

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