#include <Fireworks/Core/interface/CSGContinuousAction.h>
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 Attributes | |
sigc::signal< void > | started_ |
sigc::signal< void > | stopped_ |
Private Member Functions | |
CSGContinuousAction (const CSGContinuousAction &) | |
const CSGContinuousAction & | operator= (const CSGContinuousAction &) |
Private Attributes | |
FWCustomIconsButton * | m_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 |
Description: An action which continues over time (e.g. playing events)
Usage: <usage>
Definition at line 30 of file CSGContinuousAction.h.
CSGContinuousAction::CSGContinuousAction | ( | CSGActionSupervisor * | sup, |
const char * | name | ||
) |
Definition at line 33 of file CSGContinuousAction.cc.
References CSGAction::activated, and switchMode().
: CSGAction(iSupervisor,iName), m_upPic(0), m_downPic(0), m_disabledPic(0), m_runningUpPic(0), m_runningDownPic(0), m_button(0), m_isRunning(false) { activated.connect(boost::bind(&CSGContinuousAction::switchMode, this)); }
CSGContinuousAction::CSGContinuousAction | ( | const CSGContinuousAction & | ) | [private] |
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 m_button, m_disabledPic, m_downPic, m_runningDownPic, m_runningUpPic, and m_upPic.
Referenced by CmsShowMainFrame::CmsShowMainFrame().
{ m_upPic=upPic; m_downPic=downPic; m_disabledPic=disabledPic; m_runningUpPic=upRunningPic; m_runningDownPic=downRunningPic; m_button = CSGAction::createCustomIconsButton(p,upPic,downPic,disabledPic,l,id,norm,option); }
void CSGContinuousAction::globalDisable | ( | ) | [virtual] |
Reimplemented from CSGAction.
Definition at line 118 of file CSGContinuousAction.cc.
References m_isRunning.
{ if(!m_isRunning) { CSGAction::globalDisable(); } }
void CSGContinuousAction::globalEnable | ( | ) | [virtual] |
Reimplemented from CSGAction.
Definition at line 112 of file CSGContinuousAction.cc.
Referenced by switchMode().
{ CSGAction::globalEnable(); }
bool CSGContinuousAction::isRunning | ( | ) | const [inline] |
Definition at line 37 of file CSGContinuousAction.h.
References m_isRunning.
{ 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().
{ m_isRunning=false; if(getToolBar() && m_imageFileName.size()) { getToolBar()->ChangeIcon(getToolBarData(),m_imageFileName.c_str()); } if(0!=m_button) { const TGPicture* tUp = m_upPic; const TGPicture* tDown = m_downPic; m_button->swapIcons(tUp,tDown,m_disabledPic); } if(0!=getMenu()) { getMenu()->UnCheckEntry(getMenuEntry()); } }
void CSGContinuousAction::switchMode | ( | ) |
Definition at line 68 of file CSGContinuousAction.cc.
References CSGAction::getMenu(), CSGAction::getMenuEntry(), CSGAction::getToolBar(), CSGAction::getToolBarData(), 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().
{ if(!m_isRunning) { m_isRunning = true; CSGAction::globalEnable(); if(getToolBar() && m_runningImageFileName.size()) { getToolBar()->ChangeIcon(getToolBarData(),m_runningImageFileName.c_str()); } if(0!=m_button) { const TGPicture* tUp = m_runningUpPic; const TGPicture* tDown = m_runningDownPic; m_button->swapIcons(tUp,tDown,m_disabledPic); } if(0!=getMenu()) { getMenu()->CheckEntry(getMenuEntry()); } started_(); } else { stop(); stopped_(); } }
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().