CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
CSGAction Class Reference

#include <Fireworks/Core/interface/CSGAction.h>

Inheritance diagram for CSGAction:
CSGContinuousAction

Public Member Functions

void activate ()
 
void addSCToMenu ()
 
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())
 
FWCustomIconsButtoncreateCustomIconsButton (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)
 
void createMenuEntry (TGPopupMenu *menu)
 
void createPictureButton (TGCompositeFrame *p, const TGPicture *pic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
void createShortcut (UInt_t key, const char *mod, int windowID)
 
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)
 
 CSGAction (CSGActionSupervisor *supervisor, const char *name)
 
void disable ()
 
void enable ()
 
Int_t getKeycode () const
 
TGPopupMenu * getMenu () const
 
int getMenuEntry () const
 
Int_t getModcode () const
 
const std::string & getName () const
 
TString getSCCombo () const
 
TGToolBar * getToolBar () const
 
ToolBarData_t * getToolBarData () const
 
const std::string & getToolTip () const
 
virtual void globalDisable ()
 
virtual void globalEnable ()
 
virtual Bool_t isEnabled () const
 
Bool_t resizeMenuEntry ()
 
void setMenuLabel (const std::string &label)
 
void setName (const std::string &name)
 
void setToolTip (const std::string &tip)
 
virtual ~CSGAction ()
 

Static Public Member Functions

static TString keycodeToString (Int_t keycode)
 

Public Attributes

sigc::signal< void > activated
 

Private Member Functions

 CSGAction (const CSGAction &)
 
void disableImp ()
 
void enableImp ()
 
const CSGActionoperator= (const CSGAction &)
 

Private Attributes

std::vector< TGButton * > m_buttons
 
CSGConnectorm_connector
 
Bool_t m_enabled
 
int m_entry
 
Bool_t m_globalEnabled
 
Int_t m_keycode
 
TGPopupMenu * m_menu
 
Int_t m_modcode
 
std::string m_name
 
TString m_scCombo
 
CSGActionSupervisorm_supervisor
 
TGToolBar * m_toolBar
 
ToolBarData_t * m_tools
 
std::string m_toolTip
 
int m_windowID
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 38 of file CSGAction.h.

Constructor & Destructor Documentation

CSGAction::CSGAction ( CSGActionSupervisor supervisor,
const char *  name 
)

Definition at line 37 of file CSGAction.cc.

References CSGActionSupervisor::addToActionMap(), CSGActionSupervisor::getListOfActions(), m_connector, m_enabled, m_entry, m_globalEnabled, m_keycode, m_menu, m_modcode, m_name, m_supervisor, m_toolBar, m_tools, m_toolTip, m_windowID, and dataset::name.

37  :
38  m_connector(0)
39  {
40  m_enabled = true;
41  m_globalEnabled = true;
42  m_supervisor = supervisor;
43  m_name = name;
44  m_toolTip = "";
45  m_menu = 0;
46  m_toolBar = 0;
47  m_tools = 0;
51  m_keycode = 0;
52  m_modcode = 0;
53  m_windowID = -1;
54 }
int m_entry
Definition: CSGAction.h:106
Int_t m_modcode
Definition: CSGAction.h:104
ToolBarData_t * m_tools
Definition: CSGAction.h:108
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
Bool_t m_enabled
Definition: CSGAction.h:110
void addToActionMap(CSGAction *action)
Bool_t m_globalEnabled
Definition: CSGAction.h:111
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
const std::vector< CSGAction * > & getListOfActions() const
std::string m_toolTip
Definition: CSGAction.h:100
std::string m_name
Definition: CSGAction.h:99
Int_t m_keycode
Definition: CSGAction.h:103
CSGAction::~CSGAction ( )
virtual

Definition at line 60 of file CSGAction.cc.

References m_connector.

61 {
62  delete m_connector;
63  //Don't delete GUI parts since they are owned by their GUI parent
64 }
CSGConnector * m_connector
Definition: CSGAction.h:109
CSGAction::CSGAction ( const CSGAction )
private

Member Function Documentation

void CSGAction::activate ( )
inline

Definition at line 84 of file CSGAction.h.

References activated.

84  {
85  activated.emit();
86  }
sigc::signal< void > activated
Definition: CSGAction.h:88
void CSGAction::addSCToMenu ( )

Definition at line 223 of file CSGAction.cc.

References m_menu, m_supervisor, CSGActionSupervisor::resizeMenu(), and resizeMenuEntry().

Referenced by createMenuEntry(), and createShortcut().

223  {
224  Bool_t widthChanged = resizeMenuEntry();
225  if (widthChanged) m_supervisor->resizeMenu(m_menu);
226 }
void resizeMenu(TGPopupMenu *menu)
TGPopupMenu * m_menu
Definition: CSGAction.h:105
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:228
void CSGAction::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 at line 137 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), hcalTTPDigis_cfi::id, isEnabled(), m_buttons, m_name, m_supervisor, and m_toolTip.

137  {
138  TGCheckButton* checkButton = new TGCheckButton(p, m_name.c_str(), id, norm, font);
139  if (m_toolTip != "") checkButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
140  p->AddFrame(checkButton, l);
141 
142  if (state) checkButton->SetState(kButtonDown, false);
143  TQObject::Connect(checkButton, "Clicked()", "CSGAction", this, "activate()");
144  m_buttons.push_back(checkButton);
145  if(!isEnabled()) {
146  checkButton->SetEnabled(kFALSE);
147  }
148 }
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
Long_t getToolTipDelay() const
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_toolTip
Definition: CSGAction.h:100
std::string m_name
Definition: CSGAction.h:99
FWCustomIconsButton * CSGAction::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 at line 162 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), isEnabled(), m_buttons, m_supervisor, and m_toolTip.

Referenced by CmsShowMainFrame::CmsShowMainFrame(), and CSGContinuousAction::createCustomIconsButton().

170 {
171  FWCustomIconsButton* picButton = new FWCustomIconsButton(p, upPic, downPic, disabledPic, 0, id, norm, option);
172  if (m_toolTip != "") picButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
173  p->AddFrame(picButton, l);
174  TQObject::Connect(picButton, "Clicked()", "CSGAction", this, "activate()");
175  m_buttons.push_back(picButton);
176  if(!isEnabled()) {
177  picButton->SetEnabled(kFALSE);
178  }
179  return picButton;
180 }
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
Long_t getToolTipDelay() const
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_toolTip
Definition: CSGAction.h:100
void CSGAction::createMenuEntry ( TGPopupMenu *  menu)

Definition at line 213 of file CSGAction.cc.

References addSCToMenu(), isEnabled(), m_connector, m_entry, m_keycode, m_menu, and m_name.

Referenced by CmsShowMainFrame::CmsShowMainFrame(), and CmsShowMainFrame::createNewViewerAction().

213  {
214  m_menu = menu;
215  if (!(menu->HasConnection("Activated(Int_t)"))) TQObject::Connect(menu, "Activated(Int_t)", "CSGConnector", m_connector, "handleMenu(Int_t)");
216  menu->AddEntry(m_name.c_str(), m_entry);
217  if (m_keycode != 0) addSCToMenu();
218  if(!isEnabled()) {
219  m_menu->DisableEntry(m_entry);
220  }
221 }
int m_entry
Definition: CSGAction.h:106
void addSCToMenu()
Definition: CSGAction.cc:223
CSGConnector * m_connector
Definition: CSGAction.h:109
TGPopupMenu * m_menu
Definition: CSGAction.h:105
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
std::string m_name
Definition: CSGAction.h:99
Int_t m_keycode
Definition: CSGAction.h:103
void CSGAction::createPictureButton ( TGCompositeFrame *  p,
const TGPicture *  pic,
TGLayoutHints *  l = 0,
Int_t  id = -1,
GContext_t  norm = TGButton::GetDefaultGC() (),
UInt_t  option = kRaisedFrame|kDoubleBorder 
)

Definition at line 150 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), isEnabled(), m_buttons, m_supervisor, and m_toolTip.

150  {
151  TGPictureButton* picButton = new TGPictureButton(p, pic, id, norm, option);
152  if (m_toolTip != "") picButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
153  p->AddFrame(picButton, l);
154  TQObject::Connect(picButton, "Clicked()", "CSGAction", this, "activate()");
155  m_buttons.push_back(picButton);
156  if(!isEnabled()) {
157  picButton->SetEnabled(kFALSE);
158  }
159 }
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
Long_t getToolTipDelay() const
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_toolTip
Definition: CSGAction.h:100
void CSGAction::createShortcut ( UInt_t  key,
const char *  mod,
int  windowID 
)

Definition at line 182 of file CSGAction.cc.

References addSCToMenu(), keycodeToString(), m_keycode, m_menu, m_modcode, m_scCombo, and m_windowID.

Referenced by CmsShowMainFrame::CmsShowMainFrame().

182  {
183  Int_t keycode = gVirtualX->KeysymToKeycode((int)key);
184  m_windowID = windowID;
185  Int_t modcode;
186  TString scText;
187  if (strcmp(mod, "CTRL") == 0) {
188  modcode = kKeyControlMask;
189  scText = "<ctrl> ";
190  }
191  else if (strcmp(mod, "CTRL+SHIFT") == 0) {
192  modcode = kKeyControlMask | kKeyShiftMask;
193  scText = "<ctrl> <shift> ";
194  }
195  else {
196  // Default to ALT for now
197  modcode = kKeyMod1Mask;
198  scText = "<alt> ";
199  }
200  scText += keycodeToString(keycode);
201  m_scCombo = scText;
202 
203  gVirtualX->GrabKey(m_windowID, keycode, modcode, kTRUE);
204  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyMod2Mask, kTRUE);
205  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyLockMask, kTRUE);
206  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyMod2Mask | kKeyLockMask, kTRUE);
207 
208  m_keycode = keycode;
209  m_modcode = modcode;
210  if (m_menu != 0) addSCToMenu();
211 }
Int_t m_modcode
Definition: CSGAction.h:104
TString m_scCombo
Definition: CSGAction.h:101
void addSCToMenu()
Definition: CSGAction.cc:223
TGPopupMenu * m_menu
Definition: CSGAction.h:105
int m_windowID
Definition: CSGAction.h:112
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:355
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Int_t m_keycode
Definition: CSGAction.h:103
void CSGAction::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 at line 126 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), hcalTTPDigis_cfi::id, isEnabled(), m_buttons, m_name, m_supervisor, m_toolTip, and TSGForRoadSearch_cfi::option.

Referenced by FWTrackHitsDetailView::build(), and FWConvTrackHitsDetailView::build().

126  {
127  TGTextButton* textButton = new TGTextButton(p, m_name.c_str(), id, norm, font, option);
128  if (m_toolTip != "") textButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
129  p->AddFrame(textButton, l);
130  TQObject::Connect(textButton, "Clicked()", "CSGAction", this, "activate()");
131  m_buttons.push_back(textButton);
132  if(!isEnabled()) {
133  textButton->SetEnabled(kFALSE);
134  }
135 }
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
Long_t getToolTipDelay() const
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_toolTip
Definition: CSGAction.h:100
std::string m_name
Definition: CSGAction.h:99
void CSGAction::disable ( )
void CSGAction::disableImp ( )
private

Definition at line 331 of file CSGAction.cc.

References isEnabled(), m_buttons, m_entry, m_keycode, m_menu, m_modcode, m_toolBar, and m_windowID.

Referenced by disable(), and globalDisable().

331  {
332  if(!isEnabled()) {
333  if (m_menu != 0) m_menu->DisableEntry(m_entry);
334  for(std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end();
335  it != itEnd;
336  ++it) {
337  (*it)->SetEnabled(kFALSE);
338  }
339  if (m_toolBar != 0) m_toolBar->GetButton(m_entry)->SetEnabled(kFALSE);
340  if (m_keycode != 0) {
341  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode, kFALSE);
342  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask, kFALSE);
343  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyLockMask, kFALSE);
344  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask | kKeyLockMask, kFALSE);
345  }
346  }
347 }
int m_entry
Definition: CSGAction.h:106
Int_t m_modcode
Definition: CSGAction.h:104
TGToolBar * m_toolBar
Definition: CSGAction.h:107
TGPopupMenu * m_menu
Definition: CSGAction.h:105
int m_windowID
Definition: CSGAction.h:112
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
Int_t m_keycode
Definition: CSGAction.h:103
void CSGAction::enable ( )
void CSGAction::enableImp ( )
private

Definition at line 312 of file CSGAction.cc.

References isEnabled(), m_buttons, m_entry, m_keycode, m_menu, m_modcode, m_toolBar, and m_windowID.

Referenced by enable(), and globalEnable().

312  {
313  if(isEnabled()) {
314  if (m_menu != 0) m_menu->EnableEntry(m_entry);
315  for(std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end();
316  it != itEnd;
317  ++it) {
318  (*it)->SetEnabled(kTRUE);
319  }
320 
321  if (m_toolBar != 0) m_toolBar->GetButton(m_entry)->SetEnabled(kTRUE);
322  if (m_keycode != 0) {
323  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode, kTRUE);
324  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask, kTRUE);
325  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyLockMask, kTRUE);
326  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask | kKeyLockMask, kTRUE);
327  }
328  }
329 }
int m_entry
Definition: CSGAction.h:106
Int_t m_modcode
Definition: CSGAction.h:104
TGToolBar * m_toolBar
Definition: CSGAction.h:107
TGPopupMenu * m_menu
Definition: CSGAction.h:105
int m_windowID
Definition: CSGAction.h:112
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:308
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
Int_t m_keycode
Definition: CSGAction.h:103
Int_t CSGAction::getKeycode ( ) const

Definition at line 268 of file CSGAction.cc.

References m_keycode.

268  {
269  return m_keycode;
270 }
Int_t m_keycode
Definition: CSGAction.h:103
TGPopupMenu * CSGAction::getMenu ( ) const

Definition at line 260 of file CSGAction.cc.

References m_menu.

Referenced by CSGContinuousAction::stop(), and CSGContinuousAction::switchMode().

260  {
261  return m_menu;
262 }
TGPopupMenu * m_menu
Definition: CSGAction.h:105
int CSGAction::getMenuEntry ( ) const

Definition at line 264 of file CSGAction.cc.

References m_entry.

Referenced by CSGContinuousAction::stop(), and CSGContinuousAction::switchMode().

264  {
265  return m_entry;
266 }
int m_entry
Definition: CSGAction.h:106
Int_t CSGAction::getModcode ( ) const

Definition at line 272 of file CSGAction.cc.

References m_modcode.

272  {
273  return m_modcode;
274 }
Int_t m_modcode
Definition: CSGAction.h:104
const std::string & CSGAction::getName ( void  ) const

Definition at line 81 of file CSGAction.cc.

References m_name.

Referenced by FWPFCandidateDetailView::build(), FWConvTrackHitsDetailView::build(), and plotting.Plot::draw().

81  {
82  return m_name;
83 }
std::string m_name
Definition: CSGAction.h:99
TString CSGAction::getSCCombo ( ) const

Definition at line 89 of file CSGAction.cc.

References m_scCombo.

89  {
90  return m_scCombo;
91 }
TString m_scCombo
Definition: CSGAction.h:101
TGToolBar * CSGAction::getToolBar ( ) const

Definition at line 280 of file CSGAction.cc.

References m_toolBar.

Referenced by CSGContinuousAction::stop(), and CSGContinuousAction::switchMode().

280  {
281  return m_toolBar;
282 }
TGToolBar * m_toolBar
Definition: CSGAction.h:107
ToolBarData_t * CSGAction::getToolBarData ( ) const

Definition at line 276 of file CSGAction.cc.

References m_tools.

Referenced by CSGContinuousAction::stop(), and CSGContinuousAction::switchMode().

276  {
277  return m_tools;
278 }
ToolBarData_t * m_tools
Definition: CSGAction.h:108
const std::string & CSGAction::getToolTip ( ) const

Definition at line 85 of file CSGAction.cc.

References m_toolTip.

85  {
86  return m_toolTip;
87 }
std::string m_toolTip
Definition: CSGAction.h:100
void CSGAction::globalDisable ( )
virtual

Reimplemented in CSGContinuousAction.

Definition at line 302 of file CSGAction.cc.

References disableImp(), and m_globalEnabled.

Referenced by CSGContinuousAction::globalDisable().

303 {
304  m_globalEnabled=false;
305  disableImp();
306 }
void disableImp()
Definition: CSGAction.cc:331
Bool_t m_globalEnabled
Definition: CSGAction.h:111
void CSGAction::globalEnable ( )
virtual

Reimplemented in CSGContinuousAction.

Definition at line 295 of file CSGAction.cc.

References enableImp(), and m_globalEnabled.

Referenced by CSGContinuousAction::globalEnable(), and CSGContinuousAction::switchMode().

296 {
297  m_globalEnabled=true;
298  enableImp();
299 }
Bool_t m_globalEnabled
Definition: CSGAction.h:111
void enableImp()
Definition: CSGAction.cc:312
Bool_t CSGAction::isEnabled ( ) const
virtual
TString CSGAction::keycodeToString ( Int_t  keycode)
static

Definition at line 355 of file CSGAction.cc.

References mps_fire::i, and cuy::rep.

Referenced by createShortcut().

355  {
356  int i;
357  char letter;
358  TString rep;
359  for (i = kKey_a; i < kKey_a + 26; i++) {
360  if (gVirtualX->KeysymToKeycode(i) == keycode) {
361  letter = (char)(i - kKey_a + 'a');
362  rep = TString(letter);
363  return rep;
364  }
365  }
366  for (i = kKey_A; i < kKey_A + 26; i++) {
367  if(gVirtualX->KeysymToKeycode(i) == keycode) {
368  letter = (char)(i - kKey_A + 'a');
369  rep = TString(letter);
370  return rep;
371  }
372  }
373  if (keycode == gVirtualX->KeysymToKeycode(kKey_Left)) {
374  rep = TString("<-");
375  return rep;
376  }
377  if (keycode == gVirtualX->KeysymToKeycode(kKey_Right)) {
378  rep = TString("->");
379  return rep;
380  }
381  if (keycode == gVirtualX->KeysymToKeycode(kKey_Space)) {
382  rep = TString("space");
383  return rep;
384  }
385  rep = TString("");
386  return rep;
387 }
rep
Definition: cuy.py:1188
const CSGAction& CSGAction::operator= ( const CSGAction )
private
Bool_t CSGAction::resizeMenuEntry ( )

Definition at line 228 of file CSGAction.cc.

References m_entry, m_menu, m_name, m_scCombo, GetRecoTauVFromDQM_MC_cff::next, and ApeEstimator_cff::width.

Referenced by addSCToMenu().

228  {
229  FontStruct_t font = gClient->GetResourcePool()->GetMenuHiliteFont()->GetFontStruct();
230  Bool_t widthChanged = kTRUE;
231  UInt_t width = m_menu->GetWidth();
232  TString realName(m_name);
233  if (realName.Contains("->")) {
234  // Should make function to do this and store in member data...
235  while (!(realName.BeginsWith("->")) && realName.Length() > 0) {
236  realName.Replace(0,1,0,0);
237  }
238  realName.Replace(0,2,0,0);
239  }
240  TString scText = m_scCombo;
241  while (gVirtualX->TextWidth(font, realName.Data(), realName.Length()) + gVirtualX->TextWidth(font, scText.Data(), scText.Length()) + 53 < (Int_t)width) {
242  widthChanged = kFALSE;
243  realName += " ";
244  }
245  realName += "\t";
246  realName += scText;
247  TIter next(m_menu->GetListOfEntries());
248  TGMenuEntry *current;
249  while (0 != (current = (TGMenuEntry *)next())) {
250  if (current == m_menu->GetEntry(m_entry)) {
251  break;
252  }
253  }
254  current = (TGMenuEntry *)next();
255  m_menu->DeleteEntry(m_entry);
256  m_menu->AddEntry(realName, m_entry, 0, 0, current);
257  return widthChanged;
258 }
int m_entry
Definition: CSGAction.h:106
TString m_scCombo
Definition: CSGAction.h:101
TGPopupMenu * m_menu
Definition: CSGAction.h:105
std::string m_name
Definition: CSGAction.h:99
void CSGAction::setMenuLabel ( const std::string &  label)

Definition at line 110 of file CSGAction.cc.

References m_entry, and m_menu.

110  {
111  if(m_menu) {
112  m_menu->GetEntry(m_entry)->GetLabel()->SetString(label.c_str());
113  }
114 }
int m_entry
Definition: CSGAction.h:106
TGPopupMenu * m_menu
Definition: CSGAction.h:105
void CSGAction::setName ( const std::string &  name)

Definition at line 93 of file CSGAction.cc.

References m_buttons, m_name, and dataset::name.

Referenced by Vispa.Gui.PortWidget.PortWidget::__init__(), Vispa.Views.PropertyView.Property::__init__(), and FWConvTrackHitsDetailView::switchProjection().

93  {
94  // Does not update menu yet
95  m_name = name;
96 
97  for(std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end();
98  it != itEnd;
99  ++it) {
100  TGTextButton* tb = dynamic_cast<TGTextButton*>(*it);
101  if (tb)
102  {
103  (tb)->SetText(name.c_str());
104  gClient->NeedRedraw(tb);
105  }
106  }
107 }
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_name
Definition: CSGAction.h:99
void CSGAction::setToolTip ( const std::string &  tip)

Definition at line 116 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), m_buttons, m_supervisor, m_tools, m_toolTip, and btvTracks_cfi::tip.

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.LabelItem::__init__(), FWTrackHitsDetailView::build(), CmsShowMainFrame::CmsShowMainFrame(), Vispa.Gui.PortWidget.PortWidget::setName(), Vispa.Gui.VispaWidget.VispaWidget::setText(), and Vispa.Views.PropertyView.TextEditWithButtonProperty::valueChanged().

116  {
117  m_toolTip = tip;
118  for(std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end();
119  it != itEnd;
120  ++it) {
121  (*it)->SetToolTipText(tip.c_str(), m_supervisor->getToolTipDelay());
122  }
123  if (m_tools != 0) m_tools->fTipText = tip.c_str();
124 }
ToolBarData_t * m_tools
Definition: CSGAction.h:108
Long_t getToolTipDelay() const
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:98
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:102
std::string m_toolTip
Definition: CSGAction.h:100

Member Data Documentation

sigc::signal<void> CSGAction::activated
std::vector<TGButton*> CSGAction::m_buttons
private
CSGConnector* CSGAction::m_connector
private

Definition at line 109 of file CSGAction.h.

Referenced by createMenuEntry(), CSGAction(), and ~CSGAction().

Bool_t CSGAction::m_enabled
private

Definition at line 110 of file CSGAction.h.

Referenced by CSGAction(), disable(), enable(), and isEnabled().

int CSGAction::m_entry
private
Bool_t CSGAction::m_globalEnabled
private

Definition at line 111 of file CSGAction.h.

Referenced by CSGAction(), globalDisable(), globalEnable(), and isEnabled().

Int_t CSGAction::m_keycode
private
TGPopupMenu* CSGAction::m_menu
private
Int_t CSGAction::m_modcode
private

Definition at line 104 of file CSGAction.h.

Referenced by createShortcut(), CSGAction(), disableImp(), enableImp(), and getModcode().

std::string CSGAction::m_name
private
TString CSGAction::m_scCombo
private

Definition at line 101 of file CSGAction.h.

Referenced by createShortcut(), getSCCombo(), and resizeMenuEntry().

CSGActionSupervisor* CSGAction::m_supervisor
private
TGToolBar* CSGAction::m_toolBar
private

Definition at line 107 of file CSGAction.h.

Referenced by CSGAction(), disableImp(), enableImp(), and getToolBar().

ToolBarData_t* CSGAction::m_tools
private

Definition at line 108 of file CSGAction.h.

Referenced by CSGAction(), getToolBarData(), and setToolTip().

std::string CSGAction::m_toolTip
private
int CSGAction::m_windowID
private

Definition at line 112 of file CSGAction.h.

Referenced by createShortcut(), CSGAction(), disableImp(), and enableImp().