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

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.

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 }

References cms::cuda::assert().

◆ ~FWCustomIconsButton()

FWCustomIconsButton::~FWCustomIconsButton ( )
override

Definition at line 61 of file FWCustomIconsButton.cc.

61 {}

◆ FWCustomIconsButton() [2/2]

FWCustomIconsButton::FWCustomIconsButton ( const FWCustomIconsButton )
privatedelete

Member Function Documentation

◆ bellowMouseIcon()

const TGPicture* FWCustomIconsButton::bellowMouseIcon ( ) const
inline

Definition at line 59 of file FWCustomIconsButton.h.

59 { return m_belowMouseIcon; }

References m_belowMouseIcon.

◆ disabledIcon()

const TGPicture* FWCustomIconsButton::disabledIcon ( ) const
inline

Definition at line 58 of file FWCustomIconsButton.h.

58 { return m_disabledIcon; }

References m_disabledIcon.

◆ DoRedraw()

void FWCustomIconsButton::DoRedraw ( )
overrideprotected

Definition at line 117 of file FWCustomIconsButton.cc.

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 }

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

◆ downIcon()

const TGPicture* FWCustomIconsButton::downIcon ( ) const
inline

Definition at line 57 of file FWCustomIconsButton.h.

57 { return m_downIcon; }

References m_downIcon.

◆ HandleCrossing()

bool FWCustomIconsButton::HandleCrossing ( Event_t *  event)
override

Definition at line 106 of file FWCustomIconsButton.cc.

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 }

References hcaldqm::fClient, and m_inside.

◆ operator=()

const FWCustomIconsButton& FWCustomIconsButton::operator= ( const FWCustomIconsButton )
privatedelete

◆ setIcons()

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

Definition at line 88 of file FWCustomIconsButton.cc.

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 }

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

Referenced by FWGUIManager::setFilterButtonIcon().

◆ swapIcons()

void FWCustomIconsButton::swapIcons ( const TGPicture *&  iUpIcon,
const TGPicture *&  iDownIcon,
const TGPicture *&  iDisabledIcon 
)

◆ upIcon()

const TGPicture* FWCustomIconsButton::upIcon ( ) const
inline

Definition at line 56 of file FWCustomIconsButton.h.

56 { return m_upIcon; }

References m_upIcon.

Member Data Documentation

◆ m_belowMouseIcon

const TGPicture* FWCustomIconsButton::m_belowMouseIcon
private

Definition at line 73 of file FWCustomIconsButton.h.

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

◆ m_disabledIcon

const TGPicture* FWCustomIconsButton::m_disabledIcon
private

Definition at line 72 of file FWCustomIconsButton.h.

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

◆ m_downIcon

const TGPicture* FWCustomIconsButton::m_downIcon
private

Definition at line 71 of file FWCustomIconsButton.h.

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

◆ m_inside

bool FWCustomIconsButton::m_inside
private

Definition at line 75 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), and HandleCrossing().

◆ m_upIcon

const TGPicture* FWCustomIconsButton::m_upIcon
private

Definition at line 70 of file FWCustomIconsButton.h.

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

DDAxes::y
FWCustomIconsButton::m_downIcon
const TGPicture * m_downIcon
Definition: FWCustomIconsButton.h:71
cms::cuda::assert
assert(be >=bs)
DDAxes::x
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
FWCustomIconsButton::m_inside
bool m_inside
Definition: FWCustomIconsButton.h:75
hcaldqm::fClient
Definition: DQModule.h:24
FWCustomIconsButton::m_disabledIcon
const TGPicture * m_disabledIcon
Definition: FWCustomIconsButton.h:72
FWCustomIconsButton::m_belowMouseIcon
const TGPicture * m_belowMouseIcon
Definition: FWCustomIconsButton.h:73
hcaldqm::quantity::fState
Definition: ValueQuantity.h:47
event
Definition: event.py:1
FWCustomIconsButton::m_upIcon
const TGPicture * m_upIcon
Definition: FWCustomIconsButton.h:70