1 #include "NLTPolygonSetEditor.h"
2 #include <Reve/NLTPolygonSet.h>
7 #include <TGNumberEntry.h>
8 #include <TGColorSelect.h>
9 #include <TGColorDialog.h>
14 ClassImp(NLTPolygonSetEditor)
16 NLTPolygonSetEditor::NLTPolygonSetEditor(const TGWindow *p,
17 Int_t width, Int_t height,
18 UInt_t options, Pixel_t back) :
19 TGedFrame(p, width, height, options | kVerticalFrame, back),
25 MakeTitle("NLTPolygonSet");
28 TGCompositeFrame *f1 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
29 TGLabel *l = new TGLabel(f1, "FillColor:");
30 f1->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 25, 2, 1, 1));
31 fFillColor = new TGColorSelect(f1, 0, -1);
32 fFillColor->Connect("ColorSelected(Pixel_t)", "Reve::NLTPolygonSetEditor", this, "DoFillColor(Pixel_t)");
33 f1->AddFrame(fFillColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
34 AddFrame(f1, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
39 TGCompositeFrame *f = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
41 TGLabel *l = new TGLabel(f, "LineColor:");
42 f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 25, 2, 1, 1));
43 fLineColor = new TGColorSelect(f, 0, -1);
44 fLineColor->Connect("ColorSelected(Pixel_t)", "Reve::NLTPolygonSetEditor", this, "DoLineColor(Pixel_t)");
45 f->AddFrame(fLineColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
47 fLineWidth = new TGNumberEntry(f, 0., 6, -1,
48 TGNumberFormat::kNESRealOne, TGNumberFormat::kNEAPositive,
49 TGNumberFormat::kNELLimitMinMax, 0.1, 2000.0);
50 fLineWidth->GetNumberEntry()->SetToolTipText("Line witdth of outline.");
51 fLineWidth->Connect("ValueSet(Long_t)", "Reve::NLTPolygonSetEditor", this, "DoLineWidth()");
52 f->AddFrame(fLineWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
54 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
59 /**************************************************************************/
60 NLTPolygonSetEditor::~NLTPolygonSetEditor()
63 /**************************************************************************/
65 void NLTPolygonSetEditor::DoFillColor(Pixel_t pixel)
67 printf("do fill color \n");
68 fPS->SetFillColor(pixel);
72 /**************************************************************************/
73 void NLTPolygonSetEditor::DoLineWidth()
75 // Double_t lw = fLineWidth->GetNumber();
76 //fPS->SetLineWidth(lw);
77 fPS->fLineWidth = fLineWidth->GetNumber();
81 /**************************************************************************/
82 void NLTPolygonSetEditor::DoLineColor(Pixel_t pixel)
84 fPS->SetLineColor(pixel);
88 /**************************************************************************/
90 void NLTPolygonSetEditor::SetModel(TObject* obj)
92 fPS = dynamic_cast<NLTPolygonSet*>(obj);
93 // fFillColor->SetColor(TColor::Number2Pixel(fPS->GetFillColor()), kFALSE);
94 fLineWidth->SetNumber(fPS->fLineWidth);
95 fLineColor->SetColor(TColor::Number2Pixel(fPS->GetLineColor()), kFALSE);