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 30 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 34 of file FWCustomIconsButton.cc.

39  :
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 {
47  assert(0!=iUpIcon);
48  assert(0!=iDownIcon);
49  assert(0!=iDisabledIcon);
50  gVirtualX->ShapeCombineMask(GetId(), 0, 0, iUpIcon->GetMask());
51  SetBackgroundPixmap(iUpIcon->GetPicture());
52  Resize(iUpIcon->GetWidth(),iUpIcon->GetHeight());
53  fTWidth = iUpIcon->GetWidth();
54  fTHeight = iUpIcon->GetHeight();
55 }
const TGPicture * m_disabledIcon
const TGPicture * m_belowMouseIcon
const TGPicture * m_upIcon
tuple norm
Definition: lumiNorm.py:78
const TGPicture * m_downIcon
FWCustomIconsButton::~FWCustomIconsButton ( )
virtual

Definition at line 62 of file FWCustomIconsButton.cc.

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

Member Function Documentation

const TGPicture* FWCustomIconsButton::bellowMouseIcon ( ) const
inline

Definition at line 64 of file FWCustomIconsButton.h.

References m_belowMouseIcon.

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

Definition at line 63 of file FWCustomIconsButton.h.

References m_disabledIcon.

63 { return m_disabledIcon; }
const TGPicture * m_disabledIcon
void FWCustomIconsButton::DoRedraw ( )
protectedvirtual

Definition at line 127 of file FWCustomIconsButton.cc.

References m_belowMouseIcon, m_disabledIcon, m_downIcon, m_inside, m_upIcon, x, and detailsBasic3DVector::y.

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

Definition at line 62 of file FWCustomIconsButton.h.

References m_downIcon.

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

Definition at line 113 of file FWCustomIconsButton.cc.

References m_inside.

114 {
115  if (event->fType == kEnterNotify)
116  m_inside = true;
117  else if (event->fType == kLeaveNotify)
118  m_inside = false;
119 
120  fClient->NeedRedraw(this);
121 
122  return TGButton::HandleCrossing(event);
123 }
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 94 of file FWCustomIconsButton.cc.

References m_belowMouseIcon, m_disabledIcon, m_downIcon, and m_upIcon.

Referenced by FWGUIManager::setFilterButtonIcon().

98 {
99  m_upIcon = iUpIcon;
100  m_downIcon = iDownIcon;
101  m_disabledIcon = iDisabledIcon;
102  m_belowMouseIcon = iBelowMouseIcon;
103 
104  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
105  fClient->NeedRedraw(this);
106 }
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 82 of file FWCustomIconsButton.cc.

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

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

85 {
86  std::swap(iUpIcon,m_upIcon);
87  std::swap(iDownIcon,m_downIcon);
88  std::swap(iDisabledIcon,m_disabledIcon);
89  gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
90  fClient->NeedRedraw(this);
91 }
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 61 of file FWCustomIconsButton.h.

References m_upIcon.

61 { return m_upIcon; }
const TGPicture * m_upIcon

Member Data Documentation

const TGPicture* FWCustomIconsButton::m_belowMouseIcon
private

Definition at line 77 of file FWCustomIconsButton.h.

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

const TGPicture* FWCustomIconsButton::m_disabledIcon
private

Definition at line 76 of file FWCustomIconsButton.h.

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

const TGPicture* FWCustomIconsButton::m_downIcon
private

Definition at line 75 of file FWCustomIconsButton.h.

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

bool FWCustomIconsButton::m_inside
private

Definition at line 79 of file FWCustomIconsButton.h.

Referenced by DoRedraw(), and HandleCrossing().

const TGPicture* FWCustomIconsButton::m_upIcon
private

Definition at line 74 of file FWCustomIconsButton.h.

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