#include "TEveProjectionAxesEditor.h"
#include "TEveProjectionAxes.h"
#include "TEveGValuators.h"
#include "TGComboBox.h"
#include "TGButton.h"
#include "TGLabel.h"
#include "TG3DLine.h"
ClassImp(TEveProjectionAxesEditor);
TEveProjectionAxesEditor::TEveProjectionAxesEditor(const TGWindow *p, Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0),
fStepMode(0),
fNumTickMarks(0),
fCenterFrame(0),
fDrawCenter(0),
fDrawOrigin(0)
{
MakeTitle("TEveProjectionAxis");
TGHorizontalFrame* f = new TGHorizontalFrame(this);
TGLabel* lab = new TGLabel(f, "TickMark Step:");
f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 3, 1, 2));
fStepMode = new TGComboBox(f, "Position");
fStepMode->AddEntry("Value", 1);
fStepMode->AddEntry("Position", 0);
fStepMode->GetTextEntry()->SetToolTipText("Set tick-marks on equidistant values/screen position.");
TGListBox* lb = fStepMode->GetListBox();
lb->Resize(lb->GetWidth(), 2*18);
fStepMode->Resize(80, 20);
fStepMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoStepMode(Int_t)");
f->AddFrame(fStepMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
AddFrame(f);
fNumTickMarks = new TEveGValuator(this, "TickMark Num:", 90, 0);
fNumTickMarks->SetLabelWidth(87);
fNumTickMarks->SetNELength(4);
fNumTickMarks->Build();
fNumTickMarks->SetLimits(3, 50);
fNumTickMarks->Connect("ValueSet(Double_t)", "TEveProjectionAxesEditor", this, "DoNumTickMarks()");
AddFrame(fNumTickMarks, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
fCenterFrame = CreateEditorTabSubFrame("Center");
TGCompositeFrame *title1 = new TGCompositeFrame(fCenterFrame, 180, 10,
kHorizontalFrame |
kLHintsExpandX |
kFixedWidth |
kOwnBackground);
title1->AddFrame(new TGLabel(title1, "Distortion Center"),
new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
title1->AddFrame(new TGHorizontal3DLine(title1),
new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
fCenterFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
{
TGHorizontalFrame* hf1 = new TGHorizontalFrame(fCenterFrame);
fDrawOrigin = new TGCheckButton(hf1, "DrawOrigin");
hf1->AddFrame(fDrawOrigin, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
fDrawOrigin->Connect("Toggled(Bool_t)"," TEveProjectionAxesEditor", this, "DoDrawOrigin()");
fDrawCenter = new TGCheckButton(hf1, "DrawCenter");
hf1->AddFrame(fDrawCenter, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
fDrawCenter->Connect("Toggled(Bool_t)"," TEveProjectionAxesEditor", this, "DoDrawCenter()");
fCenterFrame->AddFrame(hf1, new TGLayoutHints(kLHintsTop, 0,0,0,0));
}
}
void TEveProjectionAxesEditor::SetModel(TObject* obj)
{
fM = dynamic_cast<TEveProjectionAxes*>(obj);
fStepMode->Select(fM->GetStepMode(), kFALSE);
fNumTickMarks->SetValue(fM->GetNumTickMarks());
fDrawCenter->SetState(fM->GetDrawCenter() ? kButtonDown : kButtonUp);
fDrawOrigin->SetState(fM->GetDrawOrigin() ? kButtonDown : kButtonUp);
}
void TEveProjectionAxesEditor::DoDrawOrigin()
{
fM->SetDrawOrigin(fDrawOrigin->IsOn());
Update();
}
void TEveProjectionAxesEditor::DoDrawCenter()
{
fM->SetDrawCenter(fDrawCenter->IsOn());
Update();
}
void TEveProjectionAxesEditor::DoStepMode(Int_t mode)
{
TEveProjectionAxes::EMode em = (TEveProjectionAxes::EMode ) mode;
fM->SetStepMode(em);
Update();
}
void TEveProjectionAxesEditor::DoNumTickMarks()
{
fM->SetNumTickMarks((Int_t)fNumTickMarks->GetValue());
Update();
}
Last change: Wed Jun 25 08:37:48 2008
Last generated: 2008-06-25 08:37
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.