CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FWCustomIconsButton Class Reference

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

List of all members.

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.

                                                                                   :
   TGButton(iParent,id, norm, option),
   m_upIcon(iUpIcon),
   m_downIcon(iDownIcon),
   m_disabledIcon(iDisabledIcon),
   m_belowMouseIcon(iBelowMouseIcon),
   m_inside(false)
{
   assert(0!=iUpIcon);
   assert(0!=iDownIcon);
   assert(0!=iDisabledIcon);
   gVirtualX->ShapeCombineMask(GetId(), 0, 0, iUpIcon->GetMask());
   SetBackgroundPixmap(iUpIcon->GetPicture());
   Resize(iUpIcon->GetWidth(),iUpIcon->GetHeight());
   fTWidth = iUpIcon->GetWidth();
   fTHeight = iUpIcon->GetHeight();
}
FWCustomIconsButton::~FWCustomIconsButton ( ) [virtual]

Definition at line 62 of file FWCustomIconsButton.cc.

{
}
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.

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

Definition at line 63 of file FWCustomIconsButton.h.

References m_disabledIcon.

{ return m_disabledIcon; }
void FWCustomIconsButton::DoRedraw ( ) [protected, virtual]

Definition at line 127 of file FWCustomIconsButton.cc.

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

{
   //ChangeOptions(0);
   //TGButton::DoRedraw();
   //Stole this from TGPictureButton.
   int x = (fWidth - fTWidth) >> 1;
   int y = (fHeight - fTHeight) >> 1;

   gVirtualX->FillRectangle(fId, fNormGC, 2,2,fWidth,fHeight);
   
   switch(fState)
   {
      case kButtonUp:
         if (m_belowMouseIcon && m_inside)
              m_belowMouseIcon->Draw(fId, fNormGC,x,y);
         else
              m_upIcon->Draw(fId, fNormGC,x,y);
         break;
      case kButtonEngaged:
      case kButtonDown:
         m_downIcon->Draw(fId, fNormGC,x,y);
         break;
      case kButtonDisabled:
      default:
         m_disabledIcon->Draw(fId, fNormGC,x,y);
   }
}
const TGPicture* FWCustomIconsButton::downIcon ( ) const [inline]

Definition at line 62 of file FWCustomIconsButton.h.

References m_downIcon.

{ return m_downIcon; }
bool FWCustomIconsButton::HandleCrossing ( Event_t *  event) [virtual]

Definition at line 113 of file FWCustomIconsButton.cc.

References m_inside.

{
   if (event->fType == kEnterNotify)
      m_inside = true;      
   else if (event->fType == kLeaveNotify)   
      m_inside = false;

   fClient->NeedRedraw(this);

   return TGButton::HandleCrossing(event);
}
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().

{
   m_upIcon       = iUpIcon;
   m_downIcon     = iDownIcon;
   m_disabledIcon = iDisabledIcon;
   m_belowMouseIcon = iBelowMouseIcon;

   gVirtualX->ShapeCombineMask(GetId(), 0, 0, m_upIcon->GetMask());
   fClient->NeedRedraw(this);
}
void FWCustomIconsButton::swapIcons ( const TGPicture *&  iUpIcon,
const TGPicture *&  iDownIcon,
const TGPicture *&  iDisabledIcon 
)
const TGPicture* FWCustomIconsButton::upIcon ( ) const [inline]

Definition at line 61 of file FWCustomIconsButton.h.

References m_upIcon.

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

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