CbmRoot
CbmPointSetArrayEditor.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmPointSetArrayEditor source file -----
3 // ----- Created 18/07/05 by J. Brandt -----
4 // ----- Following class TEvePointSetArrayEditor -----
5 // -------------------------------------------------------------------------
6 
8 
9 #include "CbmPointSetArray.h" // for CbmPointSetArray
10 
11 #include <TGComboBox.h> // for TGComboBox
12 #include <TGFrame.h> // for TGCompositeFrame, kFixedWidth, kHoriz...
13 #include <TGLabel.h> // for TGLabel
14 #include <TGLayout.h> // for TGLayoutHints, kLHintsExpandX, kLHint...
15 #include <TGedFrame.h> // for TGedFrame
16 #include <TGenericClassInfo.h> // for TGenericClassInfo
17 #include <TObject.h> // for TObject
18 
21 
23  Int_t width,
24  Int_t height,
25  UInt_t options,
26  Pixel_t back)
27  : TGedFrame(p, width, height, options | kVerticalFrame, back)
28  , fM(0)
29  , fComboColor(0)
30  , fComboMarker(0) {
31  fM = 0;
32  MakeTitle("CbmPointSetArray");
33 
34  // frame for ComboBox Color
35  TGCompositeFrame* fCframe =
36  new TGCompositeFrame(this, width, 20, kHorizontalFrame | kFixedWidth);
37  TGLabel* fLabel = new TGLabel(fCframe, "Color:");
38  fCframe->AddFrame(
39  fLabel, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 2, 1));
40  fComboColor = new TGComboBox(fCframe);
41  // options for Color-Coding (have to be in CbmPointSetArray::ApplyColor() aswell with same integer)
42  fComboColor->AddEntry("Id", 3);
43  fComboColor->AddEntry("Time", 1);
44  fComboColor->AddEntry("ToT", 2);
45  fComboColor->AddEntry("Red", 4);
46  fComboColor->Resize(170, 20);
47  // connect ComboBox to functionality DoColor()
48  fComboColor->Connect(
49  "Selected(Int_t)", "CbmPointSetArrayEditor", this, "DoColor()");
50  fCframe->AddFrame(
51  fComboColor, new TGLayoutHints(kLHintsRight | kLHintsExpandX, 1, 1, 2, 1));
52  AddFrame(fCframe, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
53 
54  // frame for ComboBox Marker
55  TGCompositeFrame* fCframe2 =
56  new TGCompositeFrame(this, width, 20, kHorizontalFrame | kFixedWidth);
57  TGLabel* fLabel2 = new TGLabel(fCframe2, "Marker:");
58  fCframe2->AddFrame(
59  fLabel2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 1, 1, 2, 1));
60  fComboMarker = new TGComboBox(fCframe2);
61  // options for Marker-Coding (have to be in CbmPointSetArray::ApplyMarker() aswell with same integer)
62  fComboMarker->AddEntry("const.", 3);
63  fComboMarker->AddEntry("CluSize", 1);
64  fComboMarker->AddEntry("CluSize (real)", 2);
65  fComboMarker->Resize(170, 20);
66  // connect ComboBox to functionality DoMarker()
67  fComboMarker->Connect(
68  "Selected(Int_t)", "CbmPointSetArrayEditor", this, "DoMarker()");
69  fCframe2->AddFrame(
70  fComboMarker, new TGLayoutHints(kLHintsRight | kLHintsExpandX, 1, 1, 2, 1));
71 
72  AddFrame(fCframe2, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
73 }
74 
77 
79 
82 
84  fM = dynamic_cast<CbmPointSetArray*>(obj);
85  // set default selected values
86  fComboColor->Select(fM->GetColorMode());
87  fComboMarker->Select(fM->GetMarkerMode());
88 }
89 
92 
94  fM->SetColorMode(fComboColor->GetSelected());
95  fM->ApplyColorMode();
96  Update();
97 }
98 
101 
103  fM->SetMarkerMode(fComboMarker->GetSelected());
104  fM->ApplyMarkerMode();
105  Update();
106 }
107 
CbmPointSetArrayEditor::fComboMarker
TGComboBox * fComboMarker
Definition: CbmPointSetArrayEditor.h:40
ClassImp
ClassImp(CbmPointSetArrayEditor)
CbmPointSetArrayEditor::CbmPointSetArrayEditor
CbmPointSetArrayEditor(const CbmPointSetArrayEditor &)
CbmPointSetArray::ApplyColorMode
void ApplyColorMode()
Apply ColorMode to bins.
Definition: CbmPointSetArray.cxx:71
CbmPointSetArrayEditor::~CbmPointSetArrayEditor
~CbmPointSetArrayEditor()
Destructor.
Definition: CbmPointSetArrayEditor.cxx:78
CbmPointSetArray
Definition: CbmPointSetArray.h:23
CbmPointSetArray::ApplyMarkerMode
void ApplyMarkerMode()
Apply MarkerMode to bins.
Definition: CbmPointSetArray.cxx:126
CbmPointSetArrayEditor
Definition: CbmPointSetArrayEditor.h:32
CbmPointSetArrayEditor::DoMarker
void DoMarker()
Set the markerMode of CbmPointSetArray.
Definition: CbmPointSetArrayEditor.cxx:102
CbmPointSetArray::SetMarkerMode
void SetMarkerMode(Int_t markerMode)
Definition: CbmPointSetArray.h:45
CbmPointSetArrayEditor::DoColor
void DoColor()
Set the colorMode of CbmPointSetArray.
Definition: CbmPointSetArrayEditor.cxx:93
CbmPointSetArray::GetMarkerMode
Int_t GetMarkerMode() const
Definition: CbmPointSetArray.h:49
CbmPointSetArrayEditor::fM
CbmPointSetArray * fM
Definition: CbmPointSetArrayEditor.h:38
CbmPointSetArray.h
CbmPointSetArray::SetColorMode
void SetColorMode(Int_t colorMode)
Definition: CbmPointSetArray.h:44
CbmPointSetArrayEditor::fComboColor
TGComboBox * fComboColor
Definition: CbmPointSetArrayEditor.h:39
CbmPointSetArrayEditor.h
CbmPointSetArray::GetColorMode
Int_t GetColorMode() const
Definition: CbmPointSetArray.h:48
CbmPointSetArrayEditor::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: CbmPointSetArrayEditor.cxx:83