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=nullptr, 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=nullptr, 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=nullptr, 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=nullptr, 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)
 
 CSGAction (const CSGAction &)=delete
 
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
 
const CSGActionoperator= (const CSGAction &)=delete
 
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

void disableImp ()
 
void enableImp ()
 

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() [1/2]

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 Skims_PA_cff::name.

38  : m_connector(nullptr) {
39  m_enabled = true;
40  m_globalEnabled = true;
41  m_supervisor = supervisor;
42  m_name = name;
43  m_toolTip = "";
44  m_menu = nullptr;
45  m_toolBar = nullptr;
46  m_tools = nullptr;
50  m_keycode = 0;
51  m_modcode = 0;
52  m_windowID = -1;
53 }
int m_entry
Definition: CSGAction.h:118
Int_t m_modcode
Definition: CSGAction.h:116
ToolBarData_t * m_tools
Definition: CSGAction.h:120
const std::vector< CSGAction * > & getListOfActions() const
CSGConnector * m_connector
Definition: CSGAction.h:121
TGToolBar * m_toolBar
Definition: CSGAction.h:119
TGPopupMenu * m_menu
Definition: CSGAction.h:117
int m_windowID
Definition: CSGAction.h:124
Bool_t m_enabled
Definition: CSGAction.h:122
void addToActionMap(CSGAction *action)
Bool_t m_globalEnabled
Definition: CSGAction.h:123
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::string m_toolTip
Definition: CSGAction.h:112
std::string m_name
Definition: CSGAction.h:111
Int_t m_keycode
Definition: CSGAction.h:115

◆ ~CSGAction()

CSGAction::~CSGAction ( )
virtual

Definition at line 59 of file CSGAction.cc.

References m_connector.

59  {
60  delete m_connector;
61  //Don't delete GUI parts since they are owned by their GUI parent
62 }
CSGConnector * m_connector
Definition: CSGAction.h:121

◆ CSGAction() [2/2]

CSGAction::CSGAction ( const CSGAction )
delete

Member Function Documentation

◆ activate()

void CSGAction::activate ( )
inline

Definition at line 98 of file CSGAction.h.

References activated.

98 { activated.emit(); }
sigc::signal< void()> activated
Definition: CSGAction.h:100

◆ addSCToMenu()

void CSGAction::addSCToMenu ( )

Definition at line 217 of file CSGAction.cc.

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

Referenced by createMenuEntry(), and createShortcut().

217  {
218  Bool_t widthChanged = resizeMenuEntry();
219  if (widthChanged)
221 }
void resizeMenu(TGPopupMenu *menu)
TGPopupMenu * m_menu
Definition: CSGAction.h:117
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
Bool_t resizeMenuEntry()
Definition: CSGAction.cc:223

◆ createCheckButton()

void CSGAction::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 at line 126 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), l1ctLayer2EG_cff::id, isEnabled(), MainPageGenerator::l, m_buttons, m_name, m_supervisor, m_toolTip, and AlCaHLTBitMon_ParallelJobs::p.

127  {
128  TGCheckButton* checkButton = new TGCheckButton(p, m_name.c_str(), id, norm, font);
129  if (!m_toolTip.empty())
130  checkButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
131  p->AddFrame(checkButton, l);
132 
133  if (state)
134  checkButton->SetState(kButtonDown, false);
135  TQObject::Connect(checkButton, "Clicked()", "CSGAction", this, "activate()");
136  m_buttons.push_back(checkButton);
137  if (!isEnabled()) {
138  checkButton->SetEnabled(kFALSE);
139  }
140 }
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Long_t getToolTipDelay() const
std::string m_toolTip
Definition: CSGAction.h:112
std::string m_name
Definition: CSGAction.h:111

◆ createCustomIconsButton()

FWCustomIconsButton * CSGAction::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 at line 155 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), isEnabled(), MainPageGenerator::l, m_buttons, m_supervisor, m_toolTip, fileinputsource_cfi::option, and AlCaHLTBitMon_ParallelJobs::p.

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

162  {
163  FWCustomIconsButton* picButton = new FWCustomIconsButton(p, upPic, downPic, disabledPic, nullptr, id, norm, option);
164  if (!m_toolTip.empty())
165  picButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
166  p->AddFrame(picButton, l);
167  TQObject::Connect(picButton, "Clicked()", "CSGAction", this, "activate()");
168  m_buttons.push_back(picButton);
169  if (!isEnabled()) {
170  picButton->SetEnabled(kFALSE);
171  }
172  return picButton;
173 }
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Long_t getToolTipDelay() const
std::string m_toolTip
Definition: CSGAction.h:112

◆ createMenuEntry()

void CSGAction::createMenuEntry ( TGPopupMenu *  menu)

Definition at line 205 of file CSGAction.cc.

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

Referenced by CmsShowMainFrame::CmsShowMainFrame().

205  {
206  m_menu = menu;
207  if (!(menu->HasConnection("Activated(Int_t)")))
208  TQObject::Connect(menu, "Activated(Int_t)", "CSGConnector", m_connector, "handleMenu(Int_t)");
209  menu->AddEntry(m_name.c_str(), m_entry);
210  if (m_keycode != 0)
211  addSCToMenu();
212  if (!isEnabled()) {
213  m_menu->DisableEntry(m_entry);
214  }
215 }
int m_entry
Definition: CSGAction.h:118
void addSCToMenu()
Definition: CSGAction.cc:217
CSGConnector * m_connector
Definition: CSGAction.h:121
TGPopupMenu * m_menu
Definition: CSGAction.h:117
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
std::string m_name
Definition: CSGAction.h:111
Int_t m_keycode
Definition: CSGAction.h:115

◆ createPictureButton()

void CSGAction::createPictureButton ( TGCompositeFrame *  p,
const TGPicture *  pic,
TGLayoutHints *  l = nullptr,
Int_t  id = -1,
GContext_t  norm = TGButton::GetDefaultGC()(),
UInt_t  option = kRaisedFrame | kDoubleBorder 
)

Definition at line 142 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), isEnabled(), MainPageGenerator::l, m_buttons, m_supervisor, m_toolTip, fileinputsource_cfi::option, and AlCaHLTBitMon_ParallelJobs::p.

143  {
144  TGPictureButton* picButton = new TGPictureButton(p, pic, id, norm, option);
145  if (!m_toolTip.empty())
146  picButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
147  p->AddFrame(picButton, l);
148  TQObject::Connect(picButton, "Clicked()", "CSGAction", this, "activate()");
149  m_buttons.push_back(picButton);
150  if (!isEnabled()) {
151  picButton->SetEnabled(kFALSE);
152  }
153 }
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Long_t getToolTipDelay() const
std::string m_toolTip
Definition: CSGAction.h:112

◆ createShortcut()

void CSGAction::createShortcut ( UInt_t  key,
const char *  mod,
int  windowID 
)

Definition at line 175 of file CSGAction.cc.

References addSCToMenu(), crabWrapper::key, keycodeToString(), m_keycode, m_menu, m_modcode, m_scCombo, m_windowID, and mod().

Referenced by CmsShowMainFrame::CmsShowMainFrame().

175  {
176  Int_t keycode = gVirtualX->KeysymToKeycode((int)key);
177  m_windowID = windowID;
178  Int_t modcode;
179  TString scText;
180  if (strcmp(mod, "CTRL") == 0) {
181  modcode = kKeyControlMask;
182  scText = "<ctrl> ";
183  } else if (strcmp(mod, "CTRL+SHIFT") == 0) {
184  modcode = kKeyControlMask | kKeyShiftMask;
185  scText = "<ctrl> <shift> ";
186  } else {
187  // Default to ALT for now
188  modcode = kKeyMod1Mask;
189  scText = "<alt> ";
190  }
191  scText += keycodeToString(keycode);
192  m_scCombo = scText;
193 
194  gVirtualX->GrabKey(m_windowID, keycode, modcode, kTRUE);
195  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyMod2Mask, kTRUE);
196  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyLockMask, kTRUE);
197  gVirtualX->GrabKey(m_windowID, keycode, modcode | kKeyMod2Mask | kKeyLockMask, kTRUE);
198 
199  m_keycode = keycode;
200  m_modcode = modcode;
201  if (m_menu != nullptr)
202  addSCToMenu();
203 }
Int_t m_modcode
Definition: CSGAction.h:116
TString m_scCombo
Definition: CSGAction.h:113
void addSCToMenu()
Definition: CSGAction.cc:217
TGPopupMenu * m_menu
Definition: CSGAction.h:117
int m_windowID
Definition: CSGAction.h:124
static TString keycodeToString(Int_t keycode)
Definition: CSGAction.cc:332
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Int_t m_keycode
Definition: CSGAction.h:115

◆ createTextButton()

void CSGAction::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 at line 113 of file CSGAction.cc.

References CSGActionSupervisor::getToolTipDelay(), l1ctLayer2EG_cff::id, isEnabled(), MainPageGenerator::l, m_buttons, m_name, m_supervisor, m_toolTip, fileinputsource_cfi::option, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by FWConvTrackHitsDetailView::build().

114  {
115  TGTextButton* textButton = new TGTextButton(p, m_name.c_str(), id, norm, font, option);
116  if (!m_toolTip.empty())
117  textButton->SetToolTipText(m_toolTip.c_str(), m_supervisor->getToolTipDelay());
118  p->AddFrame(textButton, l);
119  TQObject::Connect(textButton, "Clicked()", "CSGAction", this, "activate()");
120  m_buttons.push_back(textButton);
121  if (!isEnabled()) {
122  textButton->SetEnabled(kFALSE);
123  }
124 }
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Long_t getToolTipDelay() const
std::string m_toolTip
Definition: CSGAction.h:112
std::string m_name
Definition: CSGAction.h:111

◆ disable()

void CSGAction::disable ( )

◆ disableImp()

void CSGAction::disableImp ( )
private

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

310  {
311  if (!isEnabled()) {
312  if (m_menu != nullptr)
313  m_menu->DisableEntry(m_entry);
314  for (std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end(); it != itEnd; ++it) {
315  (*it)->SetEnabled(kFALSE);
316  }
317  if (m_toolBar != nullptr)
318  m_toolBar->GetButton(m_entry)->SetEnabled(kFALSE);
319  if (m_keycode != 0) {
320  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode, kFALSE);
321  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask, kFALSE);
322  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyLockMask, kFALSE);
323  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask | kKeyLockMask, kFALSE);
324  }
325  }
326 }
int m_entry
Definition: CSGAction.h:118
Int_t m_modcode
Definition: CSGAction.h:116
TGToolBar * m_toolBar
Definition: CSGAction.h:119
TGPopupMenu * m_menu
Definition: CSGAction.h:117
int m_windowID
Definition: CSGAction.h:124
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Int_t m_keycode
Definition: CSGAction.h:115

◆ enable()

void CSGAction::enable ( )

◆ enableImp()

void CSGAction::enableImp ( )
private

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

291  {
292  if (isEnabled()) {
293  if (m_menu != nullptr)
294  m_menu->EnableEntry(m_entry);
295  for (std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end(); it != itEnd; ++it) {
296  (*it)->SetEnabled(kTRUE);
297  }
298 
299  if (m_toolBar != nullptr)
300  m_toolBar->GetButton(m_entry)->SetEnabled(kTRUE);
301  if (m_keycode != 0) {
302  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode, kTRUE);
303  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask, kTRUE);
304  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyLockMask, kTRUE);
305  gVirtualX->GrabKey(m_windowID, m_keycode, m_modcode | kKeyMod2Mask | kKeyLockMask, kTRUE);
306  }
307  }
308 }
int m_entry
Definition: CSGAction.h:118
Int_t m_modcode
Definition: CSGAction.h:116
TGToolBar * m_toolBar
Definition: CSGAction.h:119
TGPopupMenu * m_menu
Definition: CSGAction.h:117
int m_windowID
Definition: CSGAction.h:124
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
virtual Bool_t isEnabled() const
Definition: CSGAction.cc:289
Int_t m_keycode
Definition: CSGAction.h:115

◆ getKeycode()

Int_t CSGAction::getKeycode ( ) const

Definition at line 261 of file CSGAction.cc.

References m_keycode.

261 { return m_keycode; }
Int_t m_keycode
Definition: CSGAction.h:115

◆ getMenu()

TGPopupMenu * CSGAction::getMenu ( ) const

Definition at line 257 of file CSGAction.cc.

References m_menu.

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

257 { return m_menu; }
TGPopupMenu * m_menu
Definition: CSGAction.h:117

◆ getMenuEntry()

int CSGAction::getMenuEntry ( ) const

Definition at line 259 of file CSGAction.cc.

References m_entry.

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

259 { return m_entry; }
int m_entry
Definition: CSGAction.h:118

◆ getModcode()

Int_t CSGAction::getModcode ( ) const

Definition at line 263 of file CSGAction.cc.

References m_modcode.

263 { return m_modcode; }
Int_t m_modcode
Definition: CSGAction.h:116

◆ getName()

const std::string & CSGAction::getName ( void  ) const

Definition at line 79 of file CSGAction.cc.

References m_name.

Referenced by plotting.Plot::draw().

79 { return m_name; }
std::string m_name
Definition: CSGAction.h:111

◆ getSCCombo()

TString CSGAction::getSCCombo ( ) const

Definition at line 83 of file CSGAction.cc.

References m_scCombo.

83 { return m_scCombo; }
TString m_scCombo
Definition: CSGAction.h:113

◆ getToolBar()

TGToolBar * CSGAction::getToolBar ( ) const

Definition at line 267 of file CSGAction.cc.

References m_toolBar.

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

267 { return m_toolBar; }
TGToolBar * m_toolBar
Definition: CSGAction.h:119

◆ getToolBarData()

ToolBarData_t * CSGAction::getToolBarData ( ) const

Definition at line 265 of file CSGAction.cc.

References m_tools.

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

265 { return m_tools; }
ToolBarData_t * m_tools
Definition: CSGAction.h:120

◆ getToolTip()

const std::string & CSGAction::getToolTip ( ) const

Definition at line 81 of file CSGAction.cc.

References m_toolTip.

81 { return m_toolTip; }
std::string m_toolTip
Definition: CSGAction.h:112

◆ globalDisable()

void CSGAction::globalDisable ( )
virtual

Reimplemented in CSGContinuousAction.

Definition at line 284 of file CSGAction.cc.

References disableImp(), and m_globalEnabled.

Referenced by CSGContinuousAction::globalDisable().

284  {
285  m_globalEnabled = false;
286  disableImp();
287 }
void disableImp()
Definition: CSGAction.cc:310
Bool_t m_globalEnabled
Definition: CSGAction.h:123

◆ globalEnable()

void CSGAction::globalEnable ( )
virtual

Reimplemented in CSGContinuousAction.

Definition at line 279 of file CSGAction.cc.

References enableImp(), and m_globalEnabled.

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

279  {
280  m_globalEnabled = true;
281  enableImp();
282 }
Bool_t m_globalEnabled
Definition: CSGAction.h:123
void enableImp()
Definition: CSGAction.cc:291

◆ isEnabled()

Bool_t CSGAction::isEnabled ( ) const
virtual

◆ keycodeToString()

TString CSGAction::keycodeToString ( Int_t  keycode)
static

Definition at line 332 of file CSGAction.cc.

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

Referenced by createShortcut().

332  {
333  int i;
334  char letter;
335  TString rep;
336  for (i = kKey_a; i < kKey_a + 26; i++) {
337  if (gVirtualX->KeysymToKeycode(i) == keycode) {
338  letter = (char)(i - kKey_a + 'a');
339  rep = TString(letter);
340  return rep;
341  }
342  }
343  for (i = kKey_A; i < kKey_A + 26; i++) {
344  if (gVirtualX->KeysymToKeycode(i) == keycode) {
345  letter = (char)(i - kKey_A + 'a');
346  rep = TString(letter);
347  return rep;
348  }
349  }
350  if (keycode == gVirtualX->KeysymToKeycode(kKey_Left)) {
351  rep = TString("<-");
352  return rep;
353  }
354  if (keycode == gVirtualX->KeysymToKeycode(kKey_Right)) {
355  rep = TString("->");
356  return rep;
357  }
358  if (keycode == gVirtualX->KeysymToKeycode(kKey_Space)) {
359  rep = TString("space");
360  return rep;
361  }
362  rep = TString("");
363  return rep;
364 }
rep
Definition: cuy.py:1189

◆ operator=()

const CSGAction& CSGAction::operator= ( const CSGAction )
delete

◆ resizeMenuEntry()

Bool_t CSGAction::resizeMenuEntry ( )

Definition at line 223 of file CSGAction.cc.

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

Referenced by addSCToMenu().

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

◆ setMenuLabel()

void CSGAction::setMenuLabel ( const std::string &  label)

Definition at line 98 of file CSGAction.cc.

References label, m_entry, and m_menu.

98  {
99  if (m_menu) {
100  m_menu->GetEntry(m_entry)->GetLabel()->SetString(label.c_str());
101  }
102 }
int m_entry
Definition: CSGAction.h:118
TGPopupMenu * m_menu
Definition: CSGAction.h:117
char const * label

◆ setName()

void CSGAction::setName ( const std::string &  name)

Definition at line 85 of file CSGAction.cc.

References m_buttons, m_name, and Skims_PA_cff::name.

Referenced by FWConvTrackHitsDetailView::switchProjection().

85  {
86  // Does not update menu yet
87  m_name = name;
88 
89  for (std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end(); it != itEnd; ++it) {
90  TGTextButton* tb = dynamic_cast<TGTextButton*>(*it);
91  if (tb) {
92  (tb)->SetText(name.c_str());
93  gClient->NeedRedraw(tb);
94  }
95  }
96 }
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
std::string m_name
Definition: CSGAction.h:111

◆ setToolTip()

void CSGAction::setToolTip ( const std::string &  tip)

Definition at line 104 of file CSGAction.cc.

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

Referenced by CmsShowMainFrame::CmsShowMainFrame().

104  {
105  m_toolTip = tip;
106  for (std::vector<TGButton*>::iterator it = m_buttons.begin(), itEnd = m_buttons.end(); it != itEnd; ++it) {
107  (*it)->SetToolTipText(tip.c_str(), m_supervisor->getToolTipDelay());
108  }
109  if (m_tools != nullptr)
110  m_tools->fTipText = tip.c_str();
111 }
ToolBarData_t * m_tools
Definition: CSGAction.h:120
CSGActionSupervisor * m_supervisor
Definition: CSGAction.h:110
std::vector< TGButton * > m_buttons
Definition: CSGAction.h:114
Long_t getToolTipDelay() const
std::string m_toolTip
Definition: CSGAction.h:112

Member Data Documentation

◆ activated

sigc::signal<void()> CSGAction::activated

◆ m_buttons

std::vector<TGButton*> CSGAction::m_buttons
private

◆ m_connector

CSGConnector* CSGAction::m_connector
private

Definition at line 121 of file CSGAction.h.

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

◆ m_enabled

Bool_t CSGAction::m_enabled
private

Definition at line 122 of file CSGAction.h.

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

◆ m_entry

int CSGAction::m_entry
private

◆ m_globalEnabled

Bool_t CSGAction::m_globalEnabled
private

Definition at line 123 of file CSGAction.h.

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

◆ m_keycode

Int_t CSGAction::m_keycode
private

◆ m_menu

TGPopupMenu* CSGAction::m_menu
private

◆ m_modcode

Int_t CSGAction::m_modcode
private

Definition at line 116 of file CSGAction.h.

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

◆ m_name

std::string CSGAction::m_name
private

◆ m_scCombo

TString CSGAction::m_scCombo
private

Definition at line 113 of file CSGAction.h.

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

◆ m_supervisor

CSGActionSupervisor* CSGAction::m_supervisor
private

◆ m_toolBar

TGToolBar* CSGAction::m_toolBar
private

Definition at line 119 of file CSGAction.h.

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

◆ m_tools

ToolBarData_t* CSGAction::m_tools
private

Definition at line 120 of file CSGAction.h.

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

◆ m_toolTip

std::string CSGAction::m_toolTip
private

◆ m_windowID

int CSGAction::m_windowID
private

Definition at line 124 of file CSGAction.h.

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