CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 39 of file CSGAction.h.

Constructor & Destructor Documentation

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

Definition at line 38 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 mergeVDriftHistosByStation::name.

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

Definition at line 61 of file CSGAction.cc.

References m_connector.

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

Member Function Documentation

void CSGAction::activate ( )
inline

Definition at line 85 of file CSGAction.h.

References activated.

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

Definition at line 224 of file CSGAction.cc.

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

Referenced by createMenuEntry(), and createShortcut().

224  {
225  Bool_t widthChanged = resizeMenuEntry();
226  if (widthChanged) m_supervisor->resizeMenu(m_menu);
227 }
void resizeMenu(TGPopupMenu *menu)
TGPopupMenu * m_menu
Definition: CSGAction.h:106
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:99
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:229
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 138 of file CSGAction.cc.

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

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

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

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

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

Definition at line 214 of file CSGAction.cc.

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

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

214  {
215  m_menu = menu;
216  if (!(menu->HasConnection("Activated(Int_t)"))) TQObject::Connect(menu, "Activated(Int_t)", "CSGConnector", m_connector, "handleMenu(Int_t)");
217  menu->AddEntry(m_name.c_str(), m_entry);
218  if (m_keycode != 0) addSCToMenu();
219  if(!isEnabled()) {
220  m_menu->DisableEntry(m_entry);
221  }
222 }
int m_entry
Definition: CSGAction.h:107
void addSCToMenu()
Definition: CSGAction.cc:224
CSGConnector * m_connector
Definition: CSGAction.h:110
TGPopupMenu * m_menu
Definition: CSGAction.h:106
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:309
std::string m_name
Definition: CSGAction.h:100
Int_t m_keycode
Definition: CSGAction.h:104
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 151 of file CSGAction.cc.

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

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

Definition at line 183 of file CSGAction.cc.

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

Referenced by CmsShowMainFrame::CmsShowMainFrame().

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

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

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

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

Definition at line 332 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().

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

Definition at line 313 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().

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

Definition at line 269 of file CSGAction.cc.

References m_keycode.

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

Definition at line 261 of file CSGAction.cc.

References m_menu.

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

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

Definition at line 265 of file CSGAction.cc.

References m_entry.

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

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

Definition at line 273 of file CSGAction.cc.

References m_modcode.

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

Definition at line 82 of file CSGAction.cc.

References m_name.

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

Definition at line 90 of file CSGAction.cc.

References m_scCombo.

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

Definition at line 281 of file CSGAction.cc.

References m_toolBar.

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

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

Definition at line 277 of file CSGAction.cc.

References m_tools.

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

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

Definition at line 86 of file CSGAction.cc.

References m_toolTip.

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

Reimplemented in CSGContinuousAction.

Definition at line 303 of file CSGAction.cc.

References disableImp(), and m_globalEnabled.

Referenced by CSGContinuousAction::globalDisable().

304 {
305  m_globalEnabled=false;
306  disableImp();
307 }
void disableImp()
Definition: CSGAction.cc:332
Bool_t m_globalEnabled
Definition: CSGAction.h:112
void CSGAction::globalEnable ( )
virtual

Reimplemented in CSGContinuousAction.

Definition at line 296 of file CSGAction.cc.

References enableImp(), and m_globalEnabled.

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

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

Definition at line 356 of file CSGAction.cc.

References i, and cuy::rep.

Referenced by createShortcut().

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

Definition at line 229 of file CSGAction.cc.

References cond::rpcobimon::current, m_entry, m_menu, m_name, m_scCombo, and create_public_lumi_plots::width.

Referenced by addSCToMenu().

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

Definition at line 111 of file CSGAction.cc.

References m_entry, and m_menu.

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

Definition at line 94 of file CSGAction.cc.

References m_buttons, m_name, and mergeVDriftHistosByStation::name.

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

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

Definition at line 117 of file CSGAction.cc.

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

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

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

Member Data Documentation

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

Definition at line 110 of file CSGAction.h.

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

Bool_t CSGAction::m_enabled
private

Definition at line 111 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 112 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 105 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 102 of file CSGAction.h.

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

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

Definition at line 108 of file CSGAction.h.

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

ToolBarData_t* CSGAction::m_tools
private

Definition at line 109 of file CSGAction.h.

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

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

Definition at line 113 of file CSGAction.h.

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