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  CSGAction(const CSGAction&) = delete; // stop default
103 
104  const CSGAction& operator=(const CSGAction&) = delete; // stop default
105 
106 private:
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
TGToolBar * getToolBar() const
Definition: CSGAction.cc:267
int m_entry
Definition: CSGAction.h:118
Int_t m_modcode
Definition: CSGAction.h:116
TString m_scCombo
Definition: CSGAction.h:113
int getMenuEntry() const
Definition: CSGAction.cc:259
virtual ~CSGAction()
Definition: CSGAction.cc:59
ToolBarData_t * m_tools
Definition: CSGAction.h:120
void setMenuLabel(const std::string &label)
Definition: CSGAction.cc:98
void enable()
Definition: CSGAction.cc:269
void disableImp()
Definition: CSGAction.cc:310
void addSCToMenu()
Definition: CSGAction.cc:217
CSGConnector * m_connector
Definition: CSGAction.h:121
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:265
TGToolBar * m_toolBar
Definition: CSGAction.h:119
const CSGAction & operator=(const CSGAction &)=delete
TGPopupMenu * m_menu
Definition: CSGAction.h:117
int m_windowID
Definition: CSGAction.h:124
void disable()
Definition: CSGAction.cc:274
Bool_t m_enabled
Definition: CSGAction.h:122
virtual void globalDisable()
Definition: CSGAction.cc:284
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
const std::string & getName() const
Definition: CSGAction.cc:79
char const * label
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
Int_t getKeycode() const
Definition: CSGAction.cc:261
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:104
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:332
Bool_t m_globalEnabled
Definition: CSGAction.h:123
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:257
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
key
prepare the HTCondor submission files and eventually submit them
void setName(const std::string &name)
Definition: CSGAction.cc:85
const std::string & getToolTip() const
Definition: CSGAction.cc:81
void enableImp()
Definition: CSGAction.cc:291
void createMenuEntry(TGPopupMenu *menu)
Definition: CSGAction.cc:205
Int_t getModcode() const
Definition: CSGAction.cc:263
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(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:38
virtual void globalEnable()
Definition: CSGAction.cc:279
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
sigc::signal< void()> activated
Definition: CSGAction.h:100
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
std::string m_toolTip
Definition: CSGAction.h:112
void createShortcut(UInt_t key, const char *mod, int windowID)
Definition: CSGAction.cc:175
TString getSCCombo() const
Definition: CSGAction.cc:83
std::string m_name
Definition: CSGAction.h:111
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:223
void activate()
Definition: CSGAction.h:98
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Int_t m_keycode
Definition: CSGAction.h:115