26 ClassImp(TEveProjectionAxesEditor);
30 TEveProjectionAxesEditor::TEveProjectionAxesEditor(
const TGWindow *p, Int_t width, Int_t height,
31 UInt_t options, Pixel_t back) :
32 TGedFrame(p, width, height, options | kVerticalFrame, back),
44 MakeTitle(
"TEveProjectionAxis");
48 TGHorizontalFrame* f =
new TGHorizontalFrame(
this);
50 TGCompositeFrame *labfr =
new TGHorizontalFrame(f, labw, 20, kFixedSize);
51 labfr->AddFrame(
new TGLabel(labfr,
"Labels:") ,
new TGLayoutHints(kLHintsLeft | kLHintsBottom));
52 f->AddFrame(labfr,
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
54 fLabMode =
new TGComboBox(f,
"Position");
55 fLabMode->AddEntry(
"Value", 1);
56 fLabMode->AddEntry(
"Position", 0);
57 fLabMode->GetTextEntry()->SetToolTipText(
"Set tick-marks on equidistant values/screen position.");
58 TGListBox* lb = fLabMode->GetListBox();
59 lb->Resize(lb->GetWidth(), 2*18);
60 fLabMode->Resize(80, 20);
61 fLabMode->Connect(
"Selected(Int_t)",
"TEveProjectionAxesEditor",
this,
"DoLabMode(Int_t)");
62 f->AddFrame(fLabMode,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
67 TGHorizontalFrame* f =
new TGHorizontalFrame(
this);
68 TGCompositeFrame *labfr =
new TGHorizontalFrame(f, labw, 20, kFixedSize);
69 labfr->AddFrame(
new TGLabel(labfr,
"Axes:") ,
new TGLayoutHints(kLHintsLeft | kLHintsBottom));
70 f->AddFrame(labfr,
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
73 fAxesMode =
new TGComboBox(f,
"All");
74 fAxesMode->AddEntry(
"Horizontal", TEveProjectionAxes::kHorizontal);
75 fAxesMode->AddEntry(
"Vertical",TEveProjectionAxes::kVertical);
76 fAxesMode->AddEntry(
"All", TEveProjectionAxes::kAll);
77 TGListBox* lb = fAxesMode->GetListBox();
78 lb->Resize(lb->GetWidth(), 2*18);
79 fAxesMode->Resize(80, 20);
80 fAxesMode->Connect(
"Selected(Int_t)",
"TEveProjectionAxesEditor",
this,
"DoAxesMode(Int_t)");
81 f->AddFrame(fAxesMode,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
88 fCenterFrame = CreateEditorTabSubFrame(
"Center");
90 TGCompositeFrame *title1 =
new TGCompositeFrame(fCenterFrame, 180, 10,
95 title1->AddFrame(
new TGLabel(title1,
"Distortion Center"),
96 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
97 title1->AddFrame(
new TGHorizontal3DLine(title1),
98 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
99 fCenterFrame->AddFrame(title1,
new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
104 TGHorizontalFrame* hf1 =
new TGHorizontalFrame(fCenterFrame);
106 fDrawOrigin =
new TGCheckButton(hf1,
"DrawOrigin");
107 hf1->AddFrame(fDrawOrigin,
new TGLayoutHints(kLHintsLeft, 2,1,0,4));
108 fDrawOrigin->Connect(
"Toggled(Bool_t)",
"TEveProjectionAxesEditor",
this,
"DoDrawOrigin()");
111 fDrawCenter =
new TGCheckButton(hf1,
"DrawCenter");
112 hf1->AddFrame(fDrawCenter,
new TGLayoutHints(kLHintsLeft, 2,1,0,4));
113 fDrawCenter->Connect(
"Toggled(Bool_t)",
"TEveProjectionAxesEditor",
this,
"DoDrawCenter()");
115 fCenterFrame->AddFrame(hf1,
new TGLayoutHints(kLHintsTop, 0,0,0,0));
123 void TEveProjectionAxesEditor::SetModel(TObject* obj)
125 fM =
dynamic_cast<TEveProjectionAxes*
>(obj);
127 fLabMode->Select(fM->GetLabMode(), kFALSE);
128 fAxesMode->Select(fM->GetAxesMode(), kFALSE);
129 fDrawCenter->SetState(fM->GetDrawCenter() ? kButtonDown : kButtonUp);
130 fDrawOrigin->SetState(fM->GetDrawOrigin() ? kButtonDown : kButtonUp);
137 void TEveProjectionAxesEditor::DoDrawOrigin()
139 fM->SetDrawOrigin(fDrawOrigin->IsOn());
146 void TEveProjectionAxesEditor::DoDrawCenter()
148 fM->SetDrawCenter(fDrawCenter->IsOn());
155 void TEveProjectionAxesEditor::DoLabMode(Int_t mode)
157 TEveProjectionAxes::ELabMode em = (TEveProjectionAxes::ELabMode ) mode;
165 void TEveProjectionAxesEditor::DoAxesMode(Int_t mode)
167 TEveProjectionAxes::EAxesMode em = (TEveProjectionAxes::EAxesMode ) mode;