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 //
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 
40 public:
41  CSGAction(CSGActionSupervisor *supervisor, const char *name);
42  virtual ~CSGAction();
43 
44  // ---------- const member functions ---------------------
45  const std::string& getName() const;
46  const std::string& getToolTip() const;
47  TString getSCCombo() const;
48  Int_t getKeycode() const;
49  Int_t getModcode() const;
50  TGPopupMenu *getMenu() const;
51  int getMenuEntry() const;
52  ToolBarData_t *getToolBarData() const;
53  TGToolBar *getToolBar() const;
54  virtual Bool_t isEnabled() const;
55 
56  // ---------- static member functions --------------------
57  static TString keycodeToString(Int_t keycode);
58 
59  // ---------- member functions ---------------------------
60  void setName(const std::string& name);
61  void setMenuLabel(const std::string& label);
62  void setToolTip(const std::string& tip);
63  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);
64  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());
65  void createPictureButton(TGCompositeFrame* p, const TGPicture* pic, TGLayoutHints* l = 0, Int_t id = -1, GContext_t norm = TGButton::GetDefaultGC() (), UInt_t option = kRaisedFrame|kDoubleBorder);
66  FWCustomIconsButton* createCustomIconsButton(TGCompositeFrame* p,
67  const TGPicture* upPic,
68  const TGPicture* downPic,
69  const TGPicture* disabledPic,
70  TGLayoutHints* l = 0,
71  Int_t id = -1,
72  GContext_t norm = TGButton::GetDefaultGC() (),
73  UInt_t option = 0);
74  void createShortcut(UInt_t key, const char *mod, int windowID);
75  void createMenuEntry(TGPopupMenu *menu);
76  void enable();
77  void disable();
78 
79  virtual void globalEnable();
80  virtual void globalDisable();
81 
82  void addSCToMenu();
83  Bool_t resizeMenuEntry();
84  void activate(){
85  activated.emit();
86  }
87 
88  sigc::signal<void> activated;
89 
90 private:
91  CSGAction(const CSGAction&); // stop default
92 
93  const CSGAction& operator=(const CSGAction&); // stop default
94 
95  void enableImp();
96  void disableImp();
97  // ---------- member data --------------------------------
101  TString m_scCombo;
102  std::vector<TGButton*> m_buttons;
103  Int_t m_keycode;
104  Int_t m_modcode;
105  TGPopupMenu *m_menu;
106  int m_entry;
107  TGToolBar *m_toolBar;
108  ToolBarData_t *m_tools;
110  Bool_t m_enabled;
113 };
114 
115 
116 #endif
const std::string & getName() const
Definition: CSGAction.cc:81
int m_entry
Definition: CSGAction.h:106
Int_t m_modcode
Definition: CSGAction.h:104
TString m_scCombo
Definition: CSGAction.h:101
ToolBarData_t * getToolBarData() const
Definition: CSGAction.cc:276
virtual ~CSGAction()
Definition: CSGAction.cc:60
ToolBarData_t * m_tools
Definition: CSGAction.h:108
void setMenuLabel(const std::string &label)
Definition: CSGAction.cc:110
void enable()
Definition: CSGAction.cc:284
void disableImp()
Definition: CSGAction.cc:331
TGPopupMenu * getMenu() const
Definition: CSGAction.cc:260
void addSCToMenu()
Definition: CSGAction.cc:223
sigc::signal< void > activated
Definition: CSGAction.h:88
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:137
CSGConnector * m_connector
Definition: CSGAction.h:109
TGToolBar * m_toolBar
Definition: CSGAction.h:107
TGPopupMenu * m_menu
Definition: CSGAction.h:105
int m_windowID
Definition: CSGAction.h:112
void disable()
Definition: CSGAction.cc:289
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:150
Bool_t m_enabled
Definition: CSGAction.h:110
virtual void globalDisable()
Definition: CSGAction.cc:302
const CSGAction & operator=(const CSGAction &)
TGToolBar * getToolBar() const
Definition: CSGAction.cc:280
void setToolTip(const std::string &tip)
Definition: CSGAction.cc:116
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:355
Bool_t m_globalEnabled
Definition: CSGAction.h:111
TString getSCCombo() const
Definition: CSGAction.cc:89
int getMenuEntry() const
Definition: CSGAction.cc:264
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
void setName(const std::string &name)
Definition: CSGAction.cc:93
void enableImp()
Definition: CSGAction.cc:312
void createMenuEntry(TGPopupMenu *menu)
Definition: CSGAction.cc:213
Int_t getKeycode() const
Definition: CSGAction.cc:268
CSGAction(CSGActionSupervisor *supervisor, const char *name)
Definition: CSGAction.cc:37
virtual void globalEnable()
Definition: CSGAction.cc:295
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
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:162
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:126
list key
Definition: combine.py:13
std::string m_toolTip
Definition: CSGAction.h:100
void createShortcut(UInt_t key, const char *mod, int windowID)
Definition: CSGAction.cc:182
Int_t getModcode() const
Definition: CSGAction.cc:272
std::string m_name
Definition: CSGAction.h:99
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:228
const std::string & getToolTip() const
Definition: CSGAction.cc:85
void activate()
Definition: CSGAction.h:84
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Int_t m_keycode
Definition: CSGAction.h:103