CMS 3D CMS Logo

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

#include <FWGUIEventSelector.h>

Inheritance diagram for FWGUIEventSelector:

Public Member Functions

void deleteCallback ()
 
void enableCallback (bool)
 
void expressionCallback (char *)
 
 FWGUIEventSelector (TGCompositeFrame *p, FWEventSelector *sel, std::vector< std::string > &triggerProcessList)
 
FWEventSelectorguiSelector ()
 
FWEventSelectororigSelector ()
 
void removeSelector (FWGUIEventSelector *)
 
void selectorChanged ()
 
void setOrigSelector (FWEventSelector *s)
 
void triggerProcessCallback (const char *)
 
void updateNEvents ()
 
 ~FWGUIEventSelector () override
 

Private Member Functions

 ClassDefOverride (FWGUIEventSelector, 0)
 
 FWGUIEventSelector (const FWGUIEventSelector &)
 
const FWGUIEventSelectoroperator= (const FWGUIEventSelector &)
 

Private Attributes

TGComboBox * m_combo
 
FWCustomIconsButtonm_deleteBtn
 
TGCheckButton * m_enableBtn
 
FWEventSelectorm_guiSelector
 
TGLabel * m_nEvents
 
FWEventSelectorm_origSelector
 
FWGUIValidatingTextEntrym_text1
 
FWGUIValidatingTextEntrym_text2
 
FWHLTValidatorm_validator
 

Detailed Description

Definition at line 15 of file FWGUIEventSelector.h.

Constructor & Destructor Documentation

◆ FWGUIEventSelector() [1/2]

FWGUIEventSelector::FWGUIEventSelector ( TGCompositeFrame *  p,
FWEventSelector sel,
std::vector< std::string > &  triggerProcessList 
)

Definition at line 11 of file FWGUIEventSelector.cc.

References FWCheckBoxIcon::coreIcondir(), hcaldqm::fClient, mps_fire::i, m_combo, m_deleteBtn, FWEventSelector::m_description, m_enableBtn, FWEventSelector::m_enabled, FWEventSelector::m_expression, m_guiSelector, m_nEvents, m_origSelector, m_text1, m_text2, FWEventSelector::m_triggerProcess, m_validator, EgammaValidation_Wenu_cff::sel, FWGUIValidatingTextEntry::setValidator(), and updateNEvents().

14  : TGHorizontalFrame(p),
15  m_guiSelector(nullptr),
16  m_origSelector(nullptr),
17  m_text1(nullptr),
18  m_text2(nullptr),
19  m_enableBtn(nullptr),
20  m_deleteBtn(nullptr),
21  m_nEvents(nullptr),
22  m_combo(nullptr),
23  m_validator(nullptr) {
26 
27  if (!m_guiSelector->m_triggerProcess.empty()) {
28  m_combo = new TGComboBox(this);
29  int cnt = 0;
30  int id = -1;
31  for (std::vector<std::string>::iterator i = triggerProcessList.begin(); i != triggerProcessList.end(); ++i) {
32  if (*i == sel->m_triggerProcess)
33  id = cnt;
34  m_combo->AddEntry((*i).c_str(), cnt++);
35  }
36 
37  if (id < 0) {
38  m_combo->AddEntry(sel->m_triggerProcess.c_str(), cnt);
39  id = cnt;
40  }
41  m_combo->Select(id, false);
42  m_combo->Resize(80, 21);
43  AddFrame(m_combo, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 1));
44 
46  m_combo->Connect("Selected(const char*)", "FWGUIEventSelector", this, "triggerProcessCallback(const char*)");
47  }
48 
49  // -------------- expression
50 
52  m_text1->SetHeight(20);
54  m_text1->ChangeOptions(0);
55  m_text1->Connect("TextChanged(char*)", "FWGUIEventSelector", this, "expressionCallback(char*)");
56  AddFrame(m_text1, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2, 2, 1, 1));
57 
58  // -------------- comment
59 
60  TGCompositeFrame* cfr = new TGHorizontalFrame(this, 120, 20, kFixedSize);
61  AddFrame(cfr, new TGLayoutHints(kLHintsNormal, 2, 2, 1, 3));
63  // m_text2->SetHeight(21);
65  m_text2->ChangeOptions(0);
66  m_text2->Connect("TextChanged(char*)", "string", &m_guiSelector->m_description, "assign(char*)");
67  cfr->AddFrame(m_text2, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2, 2, 0, 0));
68 
69  // ---------------- selection info
70 
71  TGHorizontalFrame* labFrame = new TGHorizontalFrame(this, 60, 22, kFixedSize);
72  AddFrame(labFrame, new TGLayoutHints(kLHintsBottom, 2, 2, 2, 2));
73  m_nEvents = new TGLabel(labFrame, "");
74  m_nEvents->SetTextJustify(kTextLeft);
75  labFrame->AddFrame(m_nEvents, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX));
76  updateNEvents();
77 
78  // ---------------- enable
79 
80  m_enableBtn = new TGCheckButton(this, "");
81  m_enableBtn->SetToolTipText("Enable/disable the selection");
83  m_enableBtn->Connect("Toggled(bool)", "FWGUIEventSelector", this, "enableCallback(bool)");
84  AddFrame(m_enableBtn, new TGLayoutHints(kLHintsNormal | kLHintsCenterY, 2, 2, 0, 0));
85 
86  // ---------------- delete
88  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete.png"),
89  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete-over.png"),
90  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete-disabled.png"));
91  AddFrame(m_deleteBtn, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 0, 0));
92  TQObject::Connect(m_deleteBtn, "Clicked()", "FWGUIEventSelector", this, "deleteCallback()");
93 }
static const TString & coreIcondir()
FWGUIValidatingTextEntry * m_text2
FWGUIValidatingTextEntry * m_text1
std::string m_triggerProcess
FWEventSelector * m_origSelector
FWHLTValidator * m_validator
std::string m_expression
FWCustomIconsButton * m_deleteBtn
void setValidator(FWValidatorBase *)
std::string m_description
FWEventSelector * m_guiSelector
TGCheckButton * m_enableBtn

◆ ~FWGUIEventSelector()

FWGUIEventSelector::~FWGUIEventSelector ( )
override

Definition at line 95 of file FWGUIEventSelector.cc.

References m_guiSelector, and m_validator.

95  {
96  delete m_guiSelector;
97  delete m_validator;
98 }
FWHLTValidator * m_validator
FWEventSelector * m_guiSelector

◆ FWGUIEventSelector() [2/2]

FWGUIEventSelector::FWGUIEventSelector ( const FWGUIEventSelector )
private

Member Function Documentation

◆ ClassDefOverride()

FWGUIEventSelector::ClassDefOverride ( FWGUIEventSelector  ,
 
)
private

◆ deleteCallback()

void FWGUIEventSelector::deleteCallback ( )

Definition at line 112 of file FWGUIEventSelector.cc.

References removeSelector().

112 { removeSelector(this); }
void removeSelector(FWGUIEventSelector *)

◆ enableCallback()

void FWGUIEventSelector::enableCallback ( bool  x)

Definition at line 101 of file FWGUIEventSelector.cc.

References FWEventSelector::m_enabled, m_guiSelector, selectorChanged(), and x.

101  {
103  selectorChanged();
104 }
FWEventSelector * m_guiSelector

◆ expressionCallback()

void FWGUIEventSelector::expressionCallback ( char *  txt)

Definition at line 122 of file FWGUIEventSelector.cc.

References FWEventSelector::m_expression, m_guiSelector, and selectorChanged().

122  {
124  selectorChanged();
125 }
std::string m_expression
FWEventSelector * m_guiSelector

◆ guiSelector()

FWEventSelector* FWGUIEventSelector::guiSelector ( )
inline

Definition at line 26 of file FWGUIEventSelector.h.

References m_guiSelector.

26 { return m_guiSelector; }
FWEventSelector * m_guiSelector

◆ operator=()

const FWGUIEventSelector& FWGUIEventSelector::operator= ( const FWGUIEventSelector )
private

◆ origSelector()

FWEventSelector* FWGUIEventSelector::origSelector ( )
inline

Definition at line 27 of file FWGUIEventSelector.h.

References m_origSelector.

27 { return m_origSelector; }
FWEventSelector * m_origSelector

◆ removeSelector()

void FWGUIEventSelector::removeSelector ( FWGUIEventSelector s)

Definition at line 107 of file FWGUIEventSelector.cc.

References alignCSCRings::s.

Referenced by deleteCallback().

107  {
108  Emit("removeSelector(FWGUIEventSelector*)", (Long_t)s);
109 }

◆ selectorChanged()

void FWGUIEventSelector::selectorChanged ( )

Definition at line 128 of file FWGUIEventSelector.cc.

References m_origSelector, and FWEventSelector::m_updated.

Referenced by enableCallback(), expressionCallback(), and triggerProcessCallback().

128  {
129  if (m_origSelector)
130  m_origSelector->m_updated = false;
131  Emit("selectorChanged()");
132 }
FWEventSelector * m_origSelector

◆ setOrigSelector()

void FWGUIEventSelector::setOrigSelector ( FWEventSelector s)
inline

Definition at line 28 of file FWGUIEventSelector.h.

References m_origSelector, and alignCSCRings::s.

28 { m_origSelector = s; }
FWEventSelector * m_origSelector

◆ triggerProcessCallback()

void FWGUIEventSelector::triggerProcessCallback ( const char *  txt)

Definition at line 115 of file FWGUIEventSelector.cc.

References m_guiSelector, FWEventSelector::m_triggerProcess, m_validator, selectorChanged(), and FWHLTValidator::setProcess().

115  {
117  m_validator->setProcess(txt);
118  selectorChanged();
119 }
std::string m_triggerProcess
void setProcess(const char *x)
FWHLTValidator * m_validator
FWEventSelector * m_guiSelector

◆ updateNEvents()

void FWGUIEventSelector::updateNEvents ( )

Definition at line 135 of file FWGUIEventSelector.cc.

References m_nEvents, m_origSelector, FWEventSelector::m_selected, and FWEventSelector::m_updated.

Referenced by FWGUIEventSelector().

135  {
137  m_nEvents->Enable();
138  const char* txtInfo = Form("%3d", m_origSelector ? m_origSelector->m_selected : -1);
139  m_nEvents->SetText(txtInfo);
140  } else {
141  m_nEvents->Disable();
142  m_nEvents->SetText("no check");
143  }
144 }
FWEventSelector * m_origSelector

Member Data Documentation

◆ m_combo

TGComboBox* FWGUIEventSelector::m_combo
private

Definition at line 46 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_deleteBtn

FWCustomIconsButton* FWGUIEventSelector::m_deleteBtn
private

Definition at line 43 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_enableBtn

TGCheckButton* FWGUIEventSelector::m_enableBtn
private

Definition at line 42 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_guiSelector

FWEventSelector* FWGUIEventSelector::m_guiSelector
private

◆ m_nEvents

TGLabel* FWGUIEventSelector::m_nEvents
private

Definition at line 44 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector(), and updateNEvents().

◆ m_origSelector

FWEventSelector* FWGUIEventSelector::m_origSelector
private

◆ m_text1

FWGUIValidatingTextEntry* FWGUIEventSelector::m_text1
private

Definition at line 40 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_text2

FWGUIValidatingTextEntry* FWGUIEventSelector::m_text2
private

Definition at line 41 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_validator

FWHLTValidator* FWGUIEventSelector::m_validator
private