#include "TEvePolygonSetProjectedEditor.h"
#include "TEvePolygonSetProjected.h"
#include "TColor.h"
#include "TGLabel.h"
#include "TGNumberEntry.h"
#include "TGColorSelect.h"
#include "TGColorDialog.h"
ClassImp(TEvePolygonSetProjectedEditor);
TEvePolygonSetProjectedEditor::TEvePolygonSetProjectedEditor(const TGWindow *p,
Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fPS(0),
fLineWidth(0),
fLineColor(0)
{
MakeTitle("TEvePolygonSetProjected");
{
TGCompositeFrame *f = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
TGLabel *l = new TGLabel(f, "LineColor:");
f->AddFrame(l, new TGLayoutHints(kLHintsLeft, 2, 2, 1, 1));
fLineColor = new TGColorSelect(f, 0, -1);
fLineColor->Connect("ColorSelected(Pixel_t)", "TEvePolygonSetProjectedEditor", this, "DoLineColor(Pixel_t)");
f->AddFrame(fLineColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
fLineWidth = new TGNumberEntry(f, 0., 4, -1,
TGNumberFormat::kNESRealOne, TGNumberFormat::kNEAPositive,
TGNumberFormat::kNELLimitMinMax, 0.1, 20.0);
fLineWidth->GetNumberEntry()->SetToolTipText("Line width of outline.");
fLineWidth->Connect("ValueSet(Long_t)", "TEvePolygonSetProjectedEditor", this, "DoLineWidth()");
f->AddFrame(fLineWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
}
}
void TEvePolygonSetProjectedEditor::SetModel(TObject* obj)
{
fPS = dynamic_cast<TEvePolygonSetProjected*>(obj);
fLineWidth->SetNumber(fPS->fLineWidth);
fLineColor->SetColor(TColor::Number2Pixel(fPS->GetLineColor()), kFALSE);
}
void TEvePolygonSetProjectedEditor::DoLineWidth()
{
fPS->fLineWidth = fLineWidth->GetNumber();
Update();
}
void TEvePolygonSetProjectedEditor::DoLineColor(Pixel_t pixel)
{
fPS->SetLineColor(TColor::GetColor(pixel));
Update();
}
Last change: Wed Jun 25 08:37:43 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.