CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWGUIEventSelector Class Reference

#include <FWGUIEventSelector.h>

List of all members.

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().

                                                                                                                         :
   TGHorizontalFrame(p),
   m_guiSelector(0),
   m_origSelector(0),
   m_text1(0),
   m_text2(0),
   m_enableBtn(0),
   m_deleteBtn(0),
   m_nEvents(0),
   m_combo(0),
   m_validator(0)
{
   m_origSelector = sel;
   m_guiSelector = new FWEventSelector(m_origSelector);
   
   if (!m_guiSelector->m_triggerProcess.empty())
   {
      m_combo = new TGComboBox(this);
      int cnt = 0;
      int id = -1;
      for ( std::vector<std::string>::iterator i = triggerProcessList.begin(); i!=triggerProcessList.end(); ++i)
      {
         if ((*i).c_str() == sel->m_triggerProcess) id = cnt;
         m_combo->AddEntry((*i).c_str(), cnt++);
      }

      if (id < 0)
      {
         m_combo->AddEntry(sel->m_triggerProcess.c_str(), cnt);
         id = cnt;
      }
      m_combo->Select(id, false);
      m_combo->Resize(80, 21);
      AddFrame(m_combo, new TGLayoutHints(kLHintsNormal, 2,2,0,1));

      m_validator = new FWHLTValidator(m_guiSelector->m_triggerProcess);
      m_combo->Connect("Selected(const char*)", "FWGUIEventSelector", this, "triggerProcessCallback(const char*)");
   }

   // -------------- expression

   m_text1 = new FWGUIValidatingTextEntry(this, m_guiSelector->m_expression.c_str());
   m_text1->SetHeight(20);
   m_text1->setValidator(m_validator);
   m_text1->ChangeOptions(0);
   m_text1->Connect("TextChanged(char*)", "FWGUIEventSelector",  this, "expressionCallback(char*)");
   AddFrame(m_text1, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2,2,1,1));
    
   // -------------- comment

   TGCompositeFrame *cfr = new TGHorizontalFrame(this, 120, 20, kFixedSize);
   AddFrame(cfr,new TGLayoutHints( kLHintsNormal, 2, 2, 1, 3 ));
   m_text2 = new FWGUIValidatingTextEntry(cfr, m_guiSelector->m_description.c_str());
   //   m_text2->SetHeight(21);
   m_text2->setValidator(m_validator);
   m_text2->ChangeOptions(0);
   m_text2->Connect("TextChanged(char*)", "string", &m_guiSelector->m_description, "assign(char*)");
   cfr->AddFrame(m_text2, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2,2,0,0));
  
   // ---------------- selection info

   TGHorizontalFrame* labFrame = new TGHorizontalFrame(this, 60, 22, kFixedSize);
   AddFrame(labFrame, new TGLayoutHints(kLHintsBottom, 2, 2, 2, 2));
   m_nEvents = new TGLabel(labFrame, "");
   m_nEvents->SetTextJustify(kTextLeft );
   labFrame->AddFrame(m_nEvents,  new TGLayoutHints(kLHintsCenterY|kLHintsExpandX));
   updateNEvents();
  
   // ---------------- enable

   m_enableBtn = new TGCheckButton(this,"");
   m_enableBtn->SetToolTipText("Enable/disable the selection");
   m_enableBtn->SetOn(m_guiSelector->m_enabled);
   m_enableBtn->Connect("Toggled(bool)","FWGUIEventSelector", this, "enableCallback(bool)");
   AddFrame(m_enableBtn, new TGLayoutHints(kLHintsNormal |  kLHintsCenterY , 2, 2, 0, 0));

   // ---------------- delete 
   m_deleteBtn = new FWCustomIconsButton(this, fClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"delete.png"),
                                         fClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"delete-over.png"),
                                         fClient->GetPicture(FWCheckBoxIcon::coreIcondir()+"delete-disabled.png"));
   AddFrame(m_deleteBtn, new TGLayoutHints(kLHintsRight|kLHintsCenterY, 2,2,0, 0));
   TQObject::Connect(m_deleteBtn, "Clicked()", "FWGUIEventSelector",  this, "deleteCallback()");

}
FWGUIEventSelector::~FWGUIEventSelector ( ) [virtual]

Definition at line 97 of file FWGUIEventSelector.cc.

References m_guiSelector, and m_validator.

{
   delete m_guiSelector;
   delete m_validator;
}
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().

{
   removeSelector(this);
}
void FWGUIEventSelector::enableCallback ( bool  x)
void FWGUIEventSelector::expressionCallback ( char *  txt)
FWEventSelector* FWGUIEventSelector::guiSelector ( ) [inline]

Definition at line 27 of file FWGUIEventSelector.h.

References m_guiSelector.

{ return 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().

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

Definition at line 111 of file FWGUIEventSelector.cc.

Referenced by deleteCallback().

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

Definition at line 138 of file FWGUIEventSelector.cc.

References m_origSelector, and FWEventSelector::m_updated.

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

{
   if (m_origSelector) m_origSelector->m_updated = false;
   Emit("selectorChanged()");
}
void FWGUIEventSelector::setOrigSelector ( FWEventSelector s) [inline]

Definition at line 29 of file FWGUIEventSelector.h.

References m_origSelector, and asciidump::s.

void FWGUIEventSelector::triggerProcessCallback ( const char *  txt)
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().

{
  
   if (m_origSelector && m_origSelector->m_updated)
   {
      m_nEvents->Enable();
      const char* txtInfo  =  Form("%3d",  m_origSelector ? m_origSelector->m_selected : -1);
      m_nEvents->SetText(txtInfo);
   }
   else
   {
      m_nEvents->Disable();
      m_nEvents->SetText("no check");
   }
}

Member Data Documentation

TGComboBox* FWGUIEventSelector::m_combo [private]

Definition at line 48 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

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().

TGLabel* FWGUIEventSelector::m_nEvents [private]

Definition at line 46 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector(), and updateNEvents().

Definition at line 42 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

Definition at line 43 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().