CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
 
virtual bool HandleCrossing (Event_t *)
 
void setIcons (const TGPicture *iUpIcon, const TGPicture *iDownIcon, const TGPicture *iDisabledIcon, const TGPicture *ibelowMouseIcon=0)
 
void swapIcons (const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
 
const TGPicture * upIcon () const
 
virtual ~FWCustomIconsButton ()
 

Protected Member Functions

virtual void DoRedraw ()
 

Private Member Functions

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

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 = 0,
Int_t  id = -1,
GContext_t  norm = TGButton::GetDefaultGC() (),
UInt_t  option = 0 
)

Definition at line 33 of file FWCustomIconsButton.cc.

References assert().

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(0!=iUpIcon);
47  assert(0!=iDownIcon);
48  assert(0!=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
assert(m_qm.get())
const TGPicture * m_upIcon
const TGPicture * m_downIcon
FWCustomIconsButton::~FWCustomIconsButton ( )
virtual

Definition at line 61 of file FWCustomIconsButton.cc.

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

Member Function Documentation

const TGPicture* FWCustomIconsButton::bellowMouseIcon ( ) const
inline

Definition at line 63 of file FWCustomIconsButton.h.

References m_belowMouseIcon.

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 ( )
protectedvirtual

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.

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)
virtual

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 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const FWCustomIconsButton& FWCustomIconsButton::operator= ( const FWCustomIconsButton )
private
void FWCustomIconsButton::setIcons ( const TGPicture *  iUpIcon,
const TGPicture *  iDownIcon,
const TGPicture *  iDisabledIcon,
const TGPicture *  ibelowMouseIcon = 0 
)

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().