CMS 3D CMS Logo

CSGAction.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_CSGAction_h
2 #define Fireworks_Core_CSGAction_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : CSGAction
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu May 29 18:15:56 CDT 2008
19 //
20 
21 // system include files
22 #include <string>
23 #include <vector>
24 #include <sigc++/sigc++.h>
25 #include <TGFrame.h>
26 #include <TGButton.h>
27 #include <TGToolBar.h>
28 
29 // user include files
30 
31 // forward declarations
32 class TGMenuBar;
33 class TString;
35 class CSGConnector;
37 
38 class CSGAction : public sigc::trackable {
39 public:
40  CSGAction(CSGActionSupervisor* supervisor, const char* name);
41  virtual ~CSGAction();
42 
43  // ---------- const member functions ---------------------
44  const std::string& getName() const;
45  const std::string& getToolTip() const;
46  TString getSCCombo() const;
47  Int_t getKeycode() const;
48  Int_t getModcode() const;
49  TGPopupMenu* getMenu() const;
50  int getMenuEntry() const;
51  ToolBarData_t* getToolBarData() const;
52  TGToolBar* getToolBar() const;
53  virtual Bool_t isEnabled() const;
54 
55  // ---------- static member functions --------------------
56  static TString keycodeToString(Int_t keycode);
57 
58  // ---------- member functions ---------------------------
59  void setName(const std::string& name);
60  void setMenuLabel(const std::string& label);
61  void setToolTip(const std::string& tip);
62  void createTextButton(TGCompositeFrame* p,
63  TGLayoutHints* l = nullptr,
64  Int_t id = -1,
65  GContext_t norm = TGButton::GetDefaultGC()(),
66  FontStruct_t font = TGTextButton::GetDefaultFontStruct(),
67  UInt_t option = kRaisedFrame | kDoubleBorder);
68  void createCheckButton(TGCompositeFrame* p,
69  TGLayoutHints* l = nullptr,
70  Bool_t state = true,
71  Int_t id = -1,
72  GContext_t norm = TGButton::GetDefaultGC()(),
73  FontStruct_t font = TGTextButton::GetDefaultFontStruct());
74  void createPictureButton(TGCompositeFrame* p,
75  const TGPicture* pic,
76  TGLayoutHints* l = nullptr,
77  Int_t id = -1,
78  GContext_t norm = TGButton::GetDefaultGC()(),
79  UInt_t option = kRaisedFrame | kDoubleBorder);
81  const TGPicture* upPic,
82  const TGPicture* downPic,
83  const TGPicture* disabledPic,
84  TGLayoutHints* l = nullptr,
85  Int_t id = -1,
86  GContext_t norm = TGButton::GetDefaultGC()(),
87  UInt_t option = 0);
88  void createShortcut(UInt_t key, const char* mod, int windowID);
89  void createMenuEntry(TGPopupMenu* menu);
90  void enable();
91  void disable();
92 
93  virtual void globalEnable();
94  virtual void globalDisable();
95 
96  void addSCToMenu();
97  Bool_t resizeMenuEntry();
98  void activate() { activated.emit(); }
99 
100  sigc::signal<void> activated;
101 
102 private:
103  CSGAction(const CSGAction&) = delete; // stop default
104 
105  const CSGAction& operator=(const CSGAction&) = delete; // stop default
106 
107  void enableImp();
108  void disableImp();
109  // ---------- member data --------------------------------
113  TString m_scCombo;
114  std::vector<TGButton*> m_buttons;
115  Int_t m_keycode;
116  Int_t m_modcode;
117  TGPopupMenu* m_menu;
118  int m_entry;
119  TGToolBar* m_toolBar;
120  ToolBarData_t* m_tools;
122  Bool_t m_enabled;
125 };
126 
127 #endif
CSGAction::enableImp
void enableImp()
Definition: CSGAction.cc:291
CSGActionSupervisor
Definition: CSGActionSupervisor.h:27
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
CSGAction::addSCToMenu
void addSCToMenu()
Definition: CSGAction.cc:217
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
CSGAction::setToolTip
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:104
CSGAction::getToolBarData
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:265
CSGAction::resizeMenuEntry
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:223
CSGAction::createShortcut
void createShortcut(UInt_t key, const char *mod, int windowID)
Definition: CSGAction.cc:175
CSGAction::m_keycode
Int_t m_keycode
Definition: CSGAction.h:115
CSGAction
Definition: CSGAction.h:38
CSGAction::disable
void disable()
Definition: CSGAction.cc:274
CSGAction::m_enabled
Bool_t m_enabled
Definition: CSGAction.h:122
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:94
CSGAction::getName
const std::string & getName() const
Definition: CSGAction.cc:79
CSGAction::getModcode
Int_t getModcode() const
Definition: CSGAction.cc:263
CSGAction::createCheckButton
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())
Definition: CSGAction.cc:126
CSGAction::operator=
const CSGAction & operator=(const CSGAction &)=delete
CSGAction::m_entry
int m_entry
Definition: CSGAction.h:118
CSGAction::m_scCombo
TString m_scCombo
Definition: CSGAction.h:113
CSGAction::~CSGAction
virtual ~CSGAction()
Definition: CSGAction.cc:59
CSGAction::setMenuLabel
void setMenuLabel(const std::string &label)
Definition: CSGAction.cc:98
CSGAction::activated
sigc::signal< void > activated
Definition: CSGAction.h:100
CSGAction::setName
void setName(const std::string &name)
Definition: CSGAction.cc:85
CSGAction::getToolTip
const std::string & getToolTip() const
Definition: CSGAction.cc:81
CSGAction::disableImp
void disableImp()
Definition: CSGAction.cc:310
CSGConnector
Definition: CSGConnector.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
qcdUeDQM_cfi.tip
tip
Definition: qcdUeDQM_cfi.py:23
CSGAction::getToolBar
TGToolBar * getToolBar() const
Definition: CSGAction.cc:267
optionsL1T.menu
menu
Definition: optionsL1T.py:29
FWCustomIconsButton
Definition: FWCustomIconsButton.h:29
CSGAction::m_menu
TGPopupMenu * m_menu
Definition: CSGAction.h:117
CSGAction::m_windowID
int m_windowID
Definition: CSGAction.h:124
CSGAction::m_toolTip
std::string m_toolTip
Definition: CSGAction.h:112
CSGAction::getSCCombo
TString getSCCombo() const
Definition: CSGAction.cc:83
CSGAction::m_tools
ToolBarData_t * m_tools
Definition: CSGAction.h:120
CSGAction::createPictureButton
void createPictureButton(TGCompositeFrame *p, const TGPicture *pic, TGLayoutHints *l=nullptr, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
Definition: CSGAction.cc:142
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
CSGAction::keycodeToString
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:332
CSGAction::m_buttons
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
CSGAction::m_supervisor
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
CSGAction::isEnabled
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
CSGAction::m_modcode
Int_t m_modcode
Definition: CSGAction.h:116
CSGAction::getMenuEntry
int getMenuEntry() const
Definition: CSGAction.cc:259
CSGAction::m_name
std::string m_name
Definition: CSGAction.h:111
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CSGAction::createTextButton
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)
Definition: CSGAction.cc:113
CSGAction::createMenuEntry
void createMenuEntry(TGPopupMenu *menu)
Definition: CSGAction.cc:205
CSGAction::enable
void enable()
Definition: CSGAction.cc:269
CSGAction::globalEnable
virtual void globalEnable()
Definition: CSGAction.cc:279
crabWrapper.key
key
Definition: crabWrapper.py:19
CSGAction::getKeycode
Int_t getKeycode() const
Definition: CSGAction.cc:261
CSGAction::CSGAction
CSGAction(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:38
CSGAction::m_toolBar
TGToolBar * m_toolBar
Definition: CSGAction.h:119
label
const char * label
Definition: PFTauDecayModeTools.cc:11
CSGAction::m_connector
CSGConnector * m_connector
Definition: CSGAction.h:121
CSGAction::m_globalEnabled
Bool_t m_globalEnabled
Definition: CSGAction.h:123
CSGAction::activate
void activate()
Definition: CSGAction.h:98
CSGAction::getMenu
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:257