BmnRoot
Loading...
Searching...
No Matches
MpdBoxSetEditor.cxx
Go to the documentation of this file.
1// MpdBoxSetEditor
2//
3// Specialization of TGedEditor for proper update propagation to TEveManager
4
5#include "MpdBoxSetEditor.h"
6
7#include "MpdEventManager.h"
8
9#include "TGLabel.h"
10#include "TGLayout.h" // for TGLayoutHints, etc
11
12#include <iostream>
13using namespace std;
14
15
16MpdBoxSetEditor::MpdBoxSetEditor(const TGWindow* p, Int_t width, Int_t height, UInt_t options, Pixel_t back)
17 : TGedFrame(p, width, height, options | kVerticalFrame, back),
18 fInfoFrame(NULL), fTimeWindowPlus(NULL), fTimeWindowMinus(NULL), fObject(NULL), fM(NULL)
19{
20 cout<<"MpdBoxSetEditor called!"<<endl;
21 Init();
22}
23
25{
26 MakeTitle("MpdBoxSet Editor");
27 fInfoFrame = CreateEditorTabSubFrame("Time");
28
29 TGCompositeFrame* title1 = new TGCompositeFrame(fInfoFrame, 250, 10,
30 kVerticalFrame | kLHintsExpandX |
31 kFixedWidth | kOwnBackground);
32
33 TGLabel* label1 = new TGLabel(title1,"Time window after event time [ns]: ");
34 title1->AddFrame(label1, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
35
36 fTimeWindowPlus = new TGNumberEntry(title1);//, 0, 5, -1, TGNumberFormat::kNESRealTwo); //, TGNumberFormat::kNEANonNegative);
37 //fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
38 fTimeWindowPlus->GetNumberEntry()->SetToolTipText("Time window in ns for which points are shown");
39 fTimeWindowPlus->Connect("ValueSet(Long_t)", "MpdBoxSetEditor",this, "TimeWindow()");
40 title1->AddFrame(fTimeWindowPlus, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
41
42 fInfoFrame->AddFrame(title1);
43
44 TGCompositeFrame* title2 = new TGCompositeFrame(fInfoFrame, 250, 10,
45 kVerticalFrame | kLHintsExpandX |
46 kFixedWidth | kOwnBackground);
47
48 TGLabel* label2 = new TGLabel(title2, "Time window before event time [ns]: ");
49 title2->AddFrame(label2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
50 fTimeWindowMinus = new TGNumberEntry(title2, 0., 6, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);//, 1, 5, -1, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
51 //fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
52 fTimeWindowMinus->GetNumberEntry()->SetToolTipText("Time window in ns for which points are shown");
53 fTimeWindowMinus->Connect("ValueSet(Long_t)", "MpdBoxSetEditor",this, "TimeWindow()");
54 title2->AddFrame(fTimeWindowMinus, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
55
56 fInfoFrame->AddFrame(title2);
57}
58
60{
61 cout<<"MpdBoxSetEditor::TimeWindowPlus "<<fTimeWindowPlus->GetNumber()<<endl;
62 cout<<"MpdBoxSetEditor::TimeWindowMinus "<<fTimeWindowMinus->GetNumber()<<endl;
65
67 man->GotoEvent(man->GetCurrentEvent());
68 Update();
69}
TGNumberEntry * fTimeWindowMinus
TGVerticalFrame * fInfoFrame
MpdBoxSetEditor(const TGWindow *p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
TGNumberEntry * fTimeWindowPlus
virtual void Init()
virtual void TimeWindow()
void SetTimeWindowMinus(Double_t time)
Definition MpdBoxSet.h:33
void SetTimeWindowPlus(Double_t time)
Definition MpdBoxSet.h:32
static MpdEventManager * Instance()
virtual void GotoEvent(Int_t event)
virtual Int_t GetCurrentEvent()
STL namespace.