CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: CSGAction.h,v 1.14 2009/08/26 18:59:20 amraktad Exp $
20 //
21 
22 // system include files
23 #include <string>
24 #include <vector>
25 #include <sigc++/sigc++.h>
26 #include <TGFrame.h>
27 #include <TGButton.h>
28 #include <TGToolBar.h>
29 
30 // user include files
31 
32 // forward declarations
33 class TGMenuBar;
34 class TString;
36 class CSGConnector;
38 
39 class CSGAction : public sigc::trackable {
40 
41 public:
42  CSGAction(CSGActionSupervisor *supervisor, const char *name);
43  virtual ~CSGAction();
44 
45  // ---------- const member functions ---------------------
46  const std::string& getName() const;
47  const std::string& getToolTip() const;
48  TString getSCCombo() const;
49  Int_t getKeycode() const;
50  Int_t getModcode() const;
51  TGPopupMenu *getMenu() const;
52  int getMenuEntry() const;
53  ToolBarData_t *getToolBarData() const;
54  TGToolBar *getToolBar() const;
55  virtual Bool_t isEnabled() const;
56 
57  // ---------- static member functions --------------------
58  static TString keycodeToString(Int_t keycode);
59 
60  // ---------- member functions ---------------------------
61  void setName(const std::string& name);
62  void setMenuLabel(const std::string& label);
63  void setToolTip(const std::string& tip);
64  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);
65  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());
66  void createPictureButton(TGCompositeFrame* p, const TGPicture* pic, TGLayoutHints* l = 0, Int_t id = -1, GContext_t norm = TGButton::GetDefaultGC() (), UInt_t option = kRaisedFrame|kDoubleBorder);
67  FWCustomIconsButton* createCustomIconsButton(TGCompositeFrame* p,
68  const TGPicture* upPic,
69  const TGPicture* downPic,
70  const TGPicture* disabledPic,
71  TGLayoutHints* l = 0,
72  Int_t id = -1,
73  GContext_t norm = TGButton::GetDefaultGC() (),
74  UInt_t option = 0);
75  void createShortcut(UInt_t key, const char *mod, int windowID);
76  void createMenuEntry(TGPopupMenu *menu);
77  void enable();
78  void disable();
79 
80  virtual void globalEnable();
81  virtual void globalDisable();
82 
83  void addSCToMenu();
84  Bool_t resizeMenuEntry();
85  void activate(){
86  activated.emit();
87  }
88 
89  sigc::signal<void> activated;
90 
91 private:
92  CSGAction(const CSGAction&); // stop default
93 
94  const CSGAction& operator=(const CSGAction&); // stop default
95 
96  void enableImp();
97  void disableImp();
98  // ---------- member data --------------------------------
100  std::string m_name;
101  std::string m_toolTip;
102  TString m_scCombo;
103  std::vector<TGButton*> m_buttons;
104  Int_t m_keycode;
105  Int_t m_modcode;
106  TGPopupMenu *m_menu;
107  int m_entry;
108  TGToolBar *m_toolBar;
109  ToolBarData_t *m_tools;
111  Bool_t m_enabled;
114 };
115 
116 
117 #endif
const std::string & getName() const
Definition: CSGAction.cc:82
int m_entry
Definition: CSGAction.h:107
Int_t m_modcode
Definition: CSGAction.h:105
TString m_scCombo
Definition: CSGAction.h:102
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:266
const std::string & label
Definition: MVAComputer.cc:186
virtual ~CSGAction()
Definition: CSGAction.cc:61
ToolBarData_t * m_tools
Definition: CSGAction.h:109
void setMenuLabel(const std::string &label)
Definition: CSGAction.cc:100
void enable()
Definition: CSGAction.cc:274
void disableImp()
Definition: CSGAction.cc:321
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:250
void addSCToMenu()
Definition: CSGAction.cc:213
sigc::signal< void > activated
Definition: CSGAction.h:89
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())
Definition: CSGAction.cc:127
CSGConnector * m_connector
Definition: CSGAction.h:110
TGToolBar * m_toolBar
Definition: CSGAction.h:108
TGPopupMenu * m_menu
Definition: CSGAction.h:106
int m_windowID
Definition: CSGAction.h:113
void disable()
Definition: CSGAction.cc:279
void createPictureButton(TGCompositeFrame *p, const TGPicture *pic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
Definition: CSGAction.cc:140
Bool_t m_enabled
Definition: CSGAction.h:111
virtual void globalDisable()
Definition: CSGAction.cc:292
const CSGAction & operator=(const CSGAction &)
TGToolBar * getToolBar() const
Definition: CSGAction.cc:270
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:106
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:298
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:345
tuple norm
Definition: lumiNorm.py:78
Bool_t m_globalEnabled
Definition: CSGAction.h:112
TString getSCCombo() const
Definition: CSGAction.cc:90
int getMenuEntry() const
Definition: CSGAction.cc:254
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:99
void setName(const std::string &name)
Definition: CSGAction.cc:94
void enableImp()
Definition: CSGAction.cc:302
void createMenuEntry(TGPopupMenu *menu)
Definition: CSGAction.cc:203
Int_t getKeycode() const
Definition: CSGAction.cc:258
CSGAction(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:38
unsigned int UInt_t
Definition: FUTypes.h:12
virtual void globalEnable()
Definition: CSGAction.cc:285
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:103
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 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)
Definition: CSGAction.cc:116
char state
Definition: procUtils.cc:75
list key
Definition: combine.py:13
std::string m_toolTip
Definition: CSGAction.h:101
void createShortcut(UInt_t key, const char *mod, int windowID)
Definition: CSGAction.cc:172
Int_t getModcode() const
Definition: CSGAction.cc:262
std::string m_name
Definition: CSGAction.h:100
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:218
const std::string & getToolTip() const
Definition: CSGAction.cc:86
void activate()
Definition: CSGAction.h:85
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Int_t m_keycode
Definition: CSGAction.h:104