CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
virtual ~FWGUIEventSelector ()
 

Private Member Functions

 ClassDef (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::FWGUIEventSelector ( TGCompositeFrame *  p,
FWEventSelector sel,
std::vector< std::string > &  triggerProcessList 
)

Definition at line 12 of file FWGUIEventSelector.cc.

References FWCheckBoxIcon::coreIcondir(), 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, runTheMatrix::sel, FWGUIValidatingTextEntry::setValidator(), and updateNEvents().

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

Definition at line 97 of file FWGUIEventSelector.cc.

References m_guiSelector, and m_validator.

98 {
99  delete m_guiSelector;
100  delete m_validator;
101 }
FWHLTValidator * m_validator
FWEventSelector * m_guiSelector
FWGUIEventSelector::FWGUIEventSelector ( const FWGUIEventSelector )
private

Member Function Documentation

FWGUIEventSelector::ClassDef ( FWGUIEventSelector  ,
 
)
private
void FWGUIEventSelector::deleteCallback ( )

Definition at line 117 of file FWGUIEventSelector.cc.

References removeSelector().

118 {
119  removeSelector(this);
120 }
void removeSelector(FWGUIEventSelector *)
void FWGUIEventSelector::enableCallback ( bool  x)
void FWGUIEventSelector::expressionCallback ( char *  txt)

Definition at line 131 of file FWGUIEventSelector.cc.

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

132 {
134  selectorChanged();
135 }
std::string m_expression
FWEventSelector * m_guiSelector
FWEventSelector* FWGUIEventSelector::guiSelector ( )
inline

Definition at line 27 of file FWGUIEventSelector.h.

References m_guiSelector.

27 { return m_guiSelector; }
FWEventSelector * m_guiSelector
const FWGUIEventSelector& FWGUIEventSelector::operator= ( const FWGUIEventSelector )
private
FWEventSelector* FWGUIEventSelector::origSelector ( )
inline

Definition at line 28 of file FWGUIEventSelector.h.

References m_origSelector.

Referenced by FWGUIEventFilter::deleteEntry().

28 { return m_origSelector; }
FWEventSelector * m_origSelector
void FWGUIEventSelector::removeSelector ( FWGUIEventSelector s)

Definition at line 111 of file FWGUIEventSelector.cc.

Referenced by deleteCallback().

112 {
113  Emit("removeSelector(FWGUIEventSelector*)", (Long_t)s);
114 }
void FWGUIEventSelector::selectorChanged ( )

Definition at line 138 of file FWGUIEventSelector.cc.

References m_origSelector, and FWEventSelector::m_updated.

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

139 {
141  Emit("selectorChanged()");
142 }
FWEventSelector * m_origSelector
void FWGUIEventSelector::setOrigSelector ( FWEventSelector s)
inline

Definition at line 29 of file FWGUIEventSelector.h.

References m_origSelector, and asciidump::s.

29 { m_origSelector = s; }
FWEventSelector * m_origSelector
string s
Definition: asciidump.py:422
void FWGUIEventSelector::triggerProcessCallback ( const char *  txt)

Definition at line 123 of file FWGUIEventSelector.cc.

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

124 {
126  m_validator->setProcess(txt);
127  selectorChanged();
128 }
std::string m_triggerProcess
void setProcess(const char *x)
FWHLTValidator * m_validator
FWEventSelector * m_guiSelector
void FWGUIEventSelector::updateNEvents ( )

Definition at line 145 of file FWGUIEventSelector.cc.

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

Referenced by FWGUIEventSelector().

146 {
147 
149  {
150  m_nEvents->Enable();
151  const char* txtInfo = Form("%3d", m_origSelector ? m_origSelector->m_selected : -1);
152  m_nEvents->SetText(txtInfo);
153  }
154  else
155  {
156  m_nEvents->Disable();
157  m_nEvents->SetText("no check");
158  }
159 }
FWEventSelector * m_origSelector

Member Data Documentation

TGComboBox* FWGUIEventSelector::m_combo
private

Definition at line 48 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

FWCustomIconsButton* FWGUIEventSelector::m_deleteBtn
private

Definition at line 45 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

TGCheckButton* FWGUIEventSelector::m_enableBtn
private

Definition at line 44 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

FWEventSelector* FWGUIEventSelector::m_guiSelector
private
TGLabel* FWGUIEventSelector::m_nEvents
private

Definition at line 46 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector(), and updateNEvents().

FWEventSelector* FWGUIEventSelector::m_origSelector
private
FWGUIValidatingTextEntry* FWGUIEventSelector::m_text1
private

Definition at line 42 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

FWGUIValidatingTextEntry* FWGUIEventSelector::m_text2
private

Definition at line 43 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

FWHLTValidator* FWGUIEventSelector::m_validator
private