CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
CSGContinuousAction Class Reference

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

Inheritance diagram for CSGContinuousAction:
CSGAction

Public Member Functions

void createCustomIconsButton (TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, const TGPicture *upRunningPic, const TGPicture *downRunningPic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
 
 CSGContinuousAction (CSGActionSupervisor *sup, const char *name)
 
virtual void globalDisable ()
 
virtual void globalEnable ()
 
bool isRunning () const
 
void stop ()
 
void switchMode ()
 
- Public Member Functions inherited from CSGAction
void activate ()
 
void addSCToMenu ()
 
void createCheckButton (TGCompositeFrame *p, TGLayoutHints *l=0, Bool_t state=true, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), FontStruct_t font=TGTextButton::GetDefaultFontStruct())
 
FWCustomIconsButtoncreateCustomIconsButton (TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
 
void createMenuEntry (TGPopupMenu *menu)
 
void createPictureButton (TGCompositeFrame *p, const TGPicture *pic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
void createShortcut (UInt_t key, const char *mod, int windowID)
 
void createTextButton (TGCompositeFrame *p, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), FontStruct_t font=TGTextButton::GetDefaultFontStruct(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
 CSGAction (CSGActionSupervisor *supervisor, const char *name)
 
void disable ()
 
void enable ()
 
Int_t getKeycode () const
 
TGPopupMenu * getMenu () const
 
int getMenuEntry () const
 
Int_t getModcode () const
 
const std::string & getName () const
 
TString getSCCombo () const
 
TGToolBar * getToolBar () const
 
ToolBarData_t * getToolBarData () const
 
const std::string & getToolTip () const
 
virtual Bool_t isEnabled () const
 
Bool_t resizeMenuEntry ()
 
void setMenuLabel (const std::string &label)
 
void setName (const std::string &name)
 
void setToolTip (const std::string &tip)
 
virtual ~CSGAction ()
 

Public Attributes

sigc::signal< void > started_
 
sigc::signal< void > stopped_
 
- Public Attributes inherited from CSGAction
sigc::signal< void > activated
 

Private Member Functions

 CSGContinuousAction (const CSGContinuousAction &)
 
const CSGContinuousActionoperator= (const CSGContinuousAction &)
 

Private Attributes

FWCustomIconsButtonm_button
 
const TGPicture * m_disabledPic
 
const TGPicture * m_downPic
 
std::string m_imageFileName
 
bool m_isRunning
 
const TGPicture * m_runningDownPic
 
std::string m_runningImageFileName
 
const TGPicture * m_runningUpPic
 
const TGPicture * m_upPic
 

Additional Inherited Members

- Static Public Member Functions inherited from CSGAction
static TString keycodeToString (Int_t keycode)
 

Detailed Description

Description: An action which continues over time (e.g. playing events)

Usage: <usage>

Definition at line 30 of file CSGContinuousAction.h.

Constructor & Destructor Documentation

CSGContinuousAction::CSGContinuousAction ( CSGActionSupervisor sup,
const char *  name 
)

Definition at line 33 of file CSGContinuousAction.cc.

References CSGAction::activated, and switchMode().

33  :
34  CSGAction(iSupervisor,iName),
35  m_upPic(0),
36  m_downPic(0),
37  m_disabledPic(0),
38  m_runningUpPic(0),
40  m_button(0),
41  m_isRunning(false)
42 {
43  activated.connect(boost::bind(&CSGContinuousAction::switchMode, this));
44 }
sigc::signal< void > activated
Definition: CSGAction.h:89
FWCustomIconsButton * m_button
const TGPicture * m_downPic
const TGPicture * m_upPic
const TGPicture * m_runningUpPic
const TGPicture * m_disabledPic
const TGPicture * m_runningDownPic
CSGAction(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:38
CSGContinuousAction::CSGContinuousAction ( const CSGContinuousAction )
private

Member Function Documentation

void CSGContinuousAction::createCustomIconsButton ( TGCompositeFrame *  p,
const TGPicture *  upPic,
const TGPicture *  downPic,
const TGPicture *  disabledPic,
const TGPicture *  upRunningPic,
const TGPicture *  downRunningPic,
TGLayoutHints *  l = 0,
Int_t  id = -1,
GContext_t  norm = TGButton::GetDefaultGC() (),
UInt_t  option = 0 
)

Definition at line 47 of file CSGContinuousAction.cc.

References CSGAction::createCustomIconsButton(), m_button, m_disabledPic, m_downPic, m_runningDownPic, m_runningUpPic, and m_upPic.

Referenced by CmsShowMainFrame::CmsShowMainFrame().

57 {
58  m_upPic=upPic;
59  m_downPic=downPic;
60  m_disabledPic=disabledPic;
61  m_runningUpPic=upRunningPic;
62  m_runningDownPic=downRunningPic;
63  m_button =
64  CSGAction::createCustomIconsButton(p,upPic,downPic,disabledPic,l,id,norm,option);
65 }
FWCustomIconsButton * m_button
const TGPicture * m_downPic
const TGPicture * m_upPic
tuple norm
Definition: lumiNorm.py:78
const TGPicture * m_runningUpPic
const TGPicture * m_disabledPic
const TGPicture * m_runningDownPic
FWCustomIconsButton * createCustomIconsButton(TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
Definition: CSGAction.cc:152
void CSGContinuousAction::globalDisable ( )
virtual

Reimplemented from CSGAction.

Definition at line 118 of file CSGContinuousAction.cc.

References CSGAction::globalDisable(), and m_isRunning.

119 {
120  if(!m_isRunning) {
122  }
123 }
virtual void globalDisable()
Definition: CSGAction.cc:292
void CSGContinuousAction::globalEnable ( )
virtual

Reimplemented from CSGAction.

Definition at line 112 of file CSGContinuousAction.cc.

References CSGAction::globalEnable().

113 {
115 }
virtual void globalEnable()
Definition: CSGAction.cc:285
bool CSGContinuousAction::isRunning ( ) const
inline

Definition at line 37 of file CSGContinuousAction.h.

References m_isRunning.

Referenced by python.Vispa.Share.ThreadChain.ThreadChain::start().

37 { return m_isRunning; }
const CSGContinuousAction& CSGContinuousAction::operator= ( const CSGContinuousAction )
private
void CSGContinuousAction::stop ( )

Definition at line 92 of file CSGContinuousAction.cc.

References CSGAction::getMenu(), CSGAction::getMenuEntry(), CSGAction::getToolBar(), CSGAction::getToolBarData(), m_button, m_disabledPic, m_downPic, m_imageFileName, m_isRunning, m_upPic, and FWCustomIconsButton::swapIcons().

Referenced by CmsShowMainFrame::enableNext(), CmsShowMainFrame::enablePrevious(), and switchMode().

93 {
94  m_isRunning=false;
95  if(getToolBar() && m_imageFileName.size()) {
96  getToolBar()->ChangeIcon(getToolBarData(),m_imageFileName.c_str());
97  }
98  if(0!=m_button) {
99  const TGPicture* tUp = m_upPic;
100  const TGPicture* tDown = m_downPic;
101 
102  m_button->swapIcons(tUp,tDown,m_disabledPic);
103  }
104  if(0!=getMenu()) {
105  getMenu()->UnCheckEntry(getMenuEntry());
106  }
107 
108 }
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:266
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:250
FWCustomIconsButton * m_button
const TGPicture * m_downPic
TGToolBar * getToolBar() const
Definition: CSGAction.cc:270
const TGPicture * m_upPic
int getMenuEntry() const
Definition: CSGAction.cc:254
const TGPicture * m_disabledPic
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
void CSGContinuousAction::switchMode ( )

Definition at line 68 of file CSGContinuousAction.cc.

References CSGAction::getMenu(), CSGAction::getMenuEntry(), CSGAction::getToolBar(), CSGAction::getToolBarData(), CSGAction::globalEnable(), m_button, m_disabledPic, m_isRunning, m_runningDownPic, m_runningImageFileName, m_runningUpPic, started_, stop(), stopped_, and FWCustomIconsButton::swapIcons().

Referenced by CmsShowMain::checkLiveMode(), and CSGContinuousAction().

69 {
70  if(!m_isRunning) {
71  m_isRunning = true;
73  if(getToolBar() && m_runningImageFileName.size()) {
74  getToolBar()->ChangeIcon(getToolBarData(),m_runningImageFileName.c_str());
75  }
76  if(0!=m_button) {
77  const TGPicture* tUp = m_runningUpPic;
78  const TGPicture* tDown = m_runningDownPic;
79  m_button->swapIcons(tUp,tDown,m_disabledPic);
80  }
81  if(0!=getMenu()) {
82  getMenu()->CheckEntry(getMenuEntry());
83  }
84  started_();
85  } else {
86  stop();
87  stopped_();
88  }
89 }
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:266
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:250
FWCustomIconsButton * m_button
TGToolBar * getToolBar() const
Definition: CSGAction.cc:270
sigc::signal< void > started_
int getMenuEntry() const
Definition: CSGAction.cc:254
std::string m_runningImageFileName
sigc::signal< void > stopped_
const TGPicture * m_runningUpPic
const TGPicture * m_disabledPic
const TGPicture * m_runningDownPic
virtual void globalEnable()
Definition: CSGAction.cc:285
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)

Member Data Documentation

FWCustomIconsButton* CSGContinuousAction::m_button
private

Definition at line 78 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), stop(), and switchMode().

const TGPicture* CSGContinuousAction::m_disabledPic
private

Definition at line 74 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), stop(), and switchMode().

const TGPicture* CSGContinuousAction::m_downPic
private

Definition at line 73 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and stop().

std::string CSGContinuousAction::m_imageFileName
private

Definition at line 69 of file CSGContinuousAction.h.

Referenced by stop().

bool CSGContinuousAction::m_isRunning
private

Definition at line 80 of file CSGContinuousAction.h.

Referenced by globalDisable(), isRunning(), stop(), and switchMode().

const TGPicture* CSGContinuousAction::m_runningDownPic
private

Definition at line 76 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and switchMode().

std::string CSGContinuousAction::m_runningImageFileName
private

Definition at line 70 of file CSGContinuousAction.h.

Referenced by switchMode().

const TGPicture* CSGContinuousAction::m_runningUpPic
private

Definition at line 75 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and switchMode().

const TGPicture* CSGContinuousAction::m_upPic
private

Definition at line 72 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and stop().

sigc::signal<void> CSGContinuousAction::started_

Definition at line 54 of file CSGContinuousAction.h.

Referenced by switchMode().

sigc::signal<void> CSGContinuousAction::stopped_

Definition at line 55 of file CSGContinuousAction.h.

Referenced by switchMode().