CMS 3D CMS Logo

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=nullptr, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
 
 CSGContinuousAction (CSGActionSupervisor *sup, const char *name)
 
void globalDisable () override
 
void globalEnable () override
 
bool isRunning () const
 
void stop ()
 
void switchMode ()
 
- Public Member Functions inherited from CSGAction
void activate ()
 
void addSCToMenu ()
 
void createCheckButton (TGCompositeFrame *p, TGLayoutHints *l=nullptr, 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=nullptr, 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=nullptr, 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=nullptr, 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 &)=delete
 
const CSGContinuousActionoperator= (const CSGContinuousAction &)=delete
 

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 29 of file CSGContinuousAction.h.

Constructor & Destructor Documentation

◆ CSGContinuousAction() [1/2]

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

Definition at line 32 of file CSGContinuousAction.cc.

33  : CSGAction(iSupervisor, iName),
34  m_upPic(nullptr),
35  m_downPic(nullptr),
36  m_disabledPic(nullptr),
37  m_runningUpPic(nullptr),
38  m_runningDownPic(nullptr),
39  m_button(nullptr),
40  m_isRunning(false) {
41  activated.connect(boost::bind(&CSGContinuousAction::switchMode, this));
42 }

References CSGAction::activated, and switchMode().

◆ CSGContinuousAction() [2/2]

CSGContinuousAction::CSGContinuousAction ( const CSGContinuousAction )
privatedelete

Member Function Documentation

◆ createCustomIconsButton()

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

Definition at line 44 of file CSGContinuousAction.cc.

53  {
54  m_upPic = upPic;
55  m_downPic = downPic;
56  m_disabledPic = disabledPic;
57  m_runningUpPic = upRunningPic;
58  m_runningDownPic = downRunningPic;
59  m_button = CSGAction::createCustomIconsButton(p, upPic, downPic, disabledPic, l, id, norm, option);
60 }

References CSGAction::createCustomIconsButton(), cmsLHEtoEOSManager::l, m_button, m_disabledPic, m_downPic, m_runningDownPic, m_runningUpPic, m_upPic, fileinputsource_cfi::option, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by CmsShowMainFrame::CmsShowMainFrame().

◆ globalDisable()

void CSGContinuousAction::globalDisable ( )
overridevirtual

Reimplemented from CSGAction.

Definition at line 102 of file CSGContinuousAction.cc.

102  {
103  if (!m_isRunning) {
105  }
106 }

References CSGAction::globalDisable(), and m_isRunning.

◆ globalEnable()

void CSGContinuousAction::globalEnable ( )
overridevirtual

Reimplemented from CSGAction.

Definition at line 100 of file CSGContinuousAction.cc.

References CSGAction::globalEnable().

◆ isRunning()

bool CSGContinuousAction::isRunning ( ) const
inline

Definition at line 35 of file CSGContinuousAction.h.

35 { return m_isRunning; }

References m_isRunning.

◆ operator=()

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

◆ stop()

void CSGContinuousAction::stop ( )

Definition at line 84 of file CSGContinuousAction.cc.

84  {
85  m_isRunning = false;
86  if (getToolBar() && !m_imageFileName.empty()) {
87  getToolBar()->ChangeIcon(getToolBarData(), m_imageFileName.c_str());
88  }
89  if (nullptr != m_button) {
90  const TGPicture* tUp = m_upPic;
91  const TGPicture* tDown = m_downPic;
92 
93  m_button->swapIcons(tUp, tDown, m_disabledPic);
94  }
95  if (nullptr != getMenu()) {
96  getMenu()->UnCheckEntry(getMenuEntry());
97  }
98 }

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

◆ switchMode()

void CSGContinuousAction::switchMode ( )

Definition at line 62 of file CSGContinuousAction.cc.

62  {
63  if (!m_isRunning) {
64  m_isRunning = true;
66  if (getToolBar() && !m_runningImageFileName.empty()) {
67  getToolBar()->ChangeIcon(getToolBarData(), m_runningImageFileName.c_str());
68  }
69  if (nullptr != m_button) {
70  const TGPicture* tUp = m_runningUpPic;
71  const TGPicture* tDown = m_runningDownPic;
72  m_button->swapIcons(tUp, tDown, m_disabledPic);
73  }
74  if (nullptr != getMenu()) {
75  getMenu()->CheckEntry(getMenuEntry());
76  }
77  started_();
78  } else {
79  stop();
80  stopped_();
81  }
82 }

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(), CSGContinuousAction(), and CmsShowMainFrame::HandleKey().

Member Data Documentation

◆ m_button

FWCustomIconsButton* CSGContinuousAction::m_button
private

Definition at line 76 of file CSGContinuousAction.h.

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

◆ m_disabledPic

const TGPicture* CSGContinuousAction::m_disabledPic
private

Definition at line 72 of file CSGContinuousAction.h.

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

◆ m_downPic

const TGPicture* CSGContinuousAction::m_downPic
private

Definition at line 71 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and stop().

◆ m_imageFileName

std::string CSGContinuousAction::m_imageFileName
private

Definition at line 67 of file CSGContinuousAction.h.

Referenced by stop().

◆ m_isRunning

bool CSGContinuousAction::m_isRunning
private

Definition at line 78 of file CSGContinuousAction.h.

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

◆ m_runningDownPic

const TGPicture* CSGContinuousAction::m_runningDownPic
private

Definition at line 74 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and switchMode().

◆ m_runningImageFileName

std::string CSGContinuousAction::m_runningImageFileName
private

Definition at line 68 of file CSGContinuousAction.h.

Referenced by switchMode().

◆ m_runningUpPic

const TGPicture* CSGContinuousAction::m_runningUpPic
private

Definition at line 73 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and switchMode().

◆ m_upPic

const TGPicture* CSGContinuousAction::m_upPic
private

Definition at line 70 of file CSGContinuousAction.h.

Referenced by createCustomIconsButton(), and stop().

◆ started_

sigc::signal<void> CSGContinuousAction::started_

Definition at line 52 of file CSGContinuousAction.h.

Referenced by switchMode().

◆ stopped_

sigc::signal<void> CSGContinuousAction::stopped_

Definition at line 53 of file CSGContinuousAction.h.

Referenced by switchMode().

CSGAction::globalDisable
virtual void globalDisable()
Definition: CSGAction.cc:284
CSGAction::createCustomIconsButton
FWCustomIconsButton * createCustomIconsButton(TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, TGLayoutHints *l=nullptr, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
Definition: CSGAction.cc:155
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSGAction::getToolBarData
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:265
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
CSGContinuousAction::m_button
FWCustomIconsButton * m_button
Definition: CSGContinuousAction.h:76
FWCustomIconsButton::swapIcons
void swapIcons(const TGPicture *&iUpIcon, const TGPicture *&iDownIcon, const TGPicture *&iDisabledIcon)
Definition: FWCustomIconsButton.cc:78
CSGContinuousAction::stop
void stop()
Definition: CSGContinuousAction.cc:84
CSGAction::activated
sigc::signal< void > activated
Definition: CSGAction.h:100
CSGContinuousAction::m_runningDownPic
const TGPicture * m_runningDownPic
Definition: CSGContinuousAction.h:74
CSGAction::getToolBar
TGToolBar * getToolBar() const
Definition: CSGAction.cc:267
CSGContinuousAction::started_
sigc::signal< void > started_
Definition: CSGContinuousAction.h:52
CSGContinuousAction::m_isRunning
bool m_isRunning
Definition: CSGContinuousAction.h:78
CSGContinuousAction::m_disabledPic
const TGPicture * m_disabledPic
Definition: CSGContinuousAction.h:72
CSGContinuousAction::m_runningUpPic
const TGPicture * m_runningUpPic
Definition: CSGContinuousAction.h:73
CSGContinuousAction::m_imageFileName
std::string m_imageFileName
Definition: CSGContinuousAction.h:67
CSGContinuousAction::m_upPic
const TGPicture * m_upPic
Definition: CSGContinuousAction.h:70
CSGContinuousAction::m_downPic
const TGPicture * m_downPic
Definition: CSGContinuousAction.h:71
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
CSGAction::getMenuEntry
int getMenuEntry() const
Definition: CSGAction.cc:259
CSGContinuousAction::stopped_
sigc::signal< void > stopped_
Definition: CSGContinuousAction.h:53
CSGContinuousAction::switchMode
void switchMode()
Definition: CSGContinuousAction.cc:62
CSGAction::globalEnable
virtual void globalEnable()
Definition: CSGAction.cc:279
CSGAction::CSGAction
CSGAction(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:38
CSGAction::getMenu
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:257
CSGContinuousAction::m_runningImageFileName
std::string m_runningImageFileName
Definition: CSGContinuousAction.h:68