30 ClassImp(TEveShapeEditor);
35 TEveShapeEditor::TEveShapeEditor(
const TGWindow *p, Int_t width, Int_t height,
36 UInt_t options, Pixel_t back) :
37 TGedFrame(p, width, height, options | kVerticalFrame, back),
44 MakeTitle(
"TEveShape");
47 TGCompositeFrame *f =
new TGCompositeFrame(
this, 80, 20, kHorizontalFrame);
49 TGLabel *l =
new TGLabel(f,
"LineColor:");
50 f->AddFrame(l,
new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
51 fLineColor =
new TGColorSelect(f, 0, -1);
52 fLineColor->Connect(
"ColorSelected(Pixel_t)",
"TEveShapeEditor",
this,
"DoLineColor(Pixel_t)");
53 f->AddFrame(fLineColor,
new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
55 fLineWidth =
new TGNumberEntry(f, 0., 4, -1,
56 TGNumberFormat::kNESRealOne, TGNumberFormat::kNEAPositive,
57 TGNumberFormat::kNELLimitMinMax, 0.1, 20.0);
58 fLineWidth->GetNumberEntry()->SetToolTipText(
"Line width of outline.");
59 fLineWidth->Connect(
"ValueSet(Long_t)",
"TEveShapeEditor",
this,
"DoLineWidth()");
60 f->AddFrame(fLineWidth,
new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
62 AddFrame(f,
new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
65 TGHorizontalFrame* f =
new TGHorizontalFrame(
this);
67 fDrawFrame =
new TGCheckButton(f,
"Draw Frame");
68 f->AddFrame(fDrawFrame,
new TGLayoutHints(kLHintsLeft, 1,2,0,0));
69 fDrawFrame->Connect(
"Toggled(Bool_t)",
"TEveShapeEditor",
this,
"DoDrawFrame()");
71 fHighlightFrame =
new TGCheckButton(f,
"Highlight Frame");
72 f->AddFrame(fHighlightFrame,
new TGLayoutHints(kLHintsLeft, 2,1,0,0));
73 fHighlightFrame->Connect(
"Toggled(Bool_t)",
"TEveShapeEditor",
this,
"DoHighlightFrame()");
75 AddFrame(f,
new TGLayoutHints(kLHintsTop, 0,0,2,1));
82 void TEveShapeEditor::SetModel(TObject* obj)
84 fM =
dynamic_cast<TEveShape*
>(obj);
86 fLineWidth->SetNumber(fM->fLineWidth);
87 fLineColor->SetColor(TColor::Number2Pixel(fM->fLineColor), kFALSE);
88 fDrawFrame ->SetState(fM->fDrawFrame ? kButtonDown : kButtonUp);
89 fHighlightFrame->SetState(fM->fHighlightFrame ? kButtonDown : kButtonUp);
95 void TEveShapeEditor::DoLineWidth()
97 fM->SetLineWidth(fLineWidth->GetNumber());
104 void TEveShapeEditor::DoLineColor(Pixel_t pixel)
106 fM->SetLineColor(TColor::GetColor(pixel));
113 void TEveShapeEditor::DoDrawFrame()
115 fM->SetDrawFrame(fDrawFrame->IsOn());
122 void TEveShapeEditor::DoHighlightFrame()
124 fM->SetHighlightFrame(fHighlightFrame->IsOn());