Added parameter 'Width_t fWidth' to TrackRnrStyle and a method to change width of...
[u/mrichter/AliRoot.git] / EVE / Reve / TrackEditors.cxx
index 2bab8e469a3ae0299bf3621def9cf16ed8529433..c63e42044e877d70f107facf62b1e265e4770c4e 100644 (file)
@@ -13,6 +13,7 @@
 #include <TGNumberEntry.h>
 #include <TGColorSelect.h>
 #include <TGDoubleSlider.h>
+#include "TGComboBox.h"
 
 using namespace Reve;
 
@@ -119,14 +120,23 @@ TrackListEditor::TrackListEditor(const TGWindow *p,
 
   // --- Rendering control
 
-  fRnrTracks = new TGCheckButton(this, "Render tracks");
-  AddFrame(fRnrTracks, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
-  fRnrTracks->Connect
-    ("Toggled(Bool_t)",
-     "Reve::TrackListEditor", this, "DoRnrTracks()");
+  {
+    TGHorizontalFrame* f = new TGHorizontalFrame(this);
+    fRnrTracks = new TGCheckButton(f, "Render tracks");
+    f->AddFrame(fRnrTracks, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 0));
+    fRnrTracks->Connect
+      ("Toggled(Bool_t)", "Reve::TrackListEditor", this, "DoRnrTracks()");
+    fWidthCombo = new TGLineWidthComboBox(f);
+    fWidthCombo->Resize(80, 18);
+    f->AddFrame(fWidthCombo, new TGLayoutHints(kLHintsLeft, 8, 1, 0, 0));
+
+    fWidthCombo->Connect
+      ("Selected(Int_t)", "Reve::TrackListEditor", this, "DoLineWidth(Int_t)"); 
+    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 3, 0));
+  }
 
   fRnrMarkers = new TGCheckButton(this, "Render markers");
-  AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fRnrMarkers->Connect
     ("Toggled(Bool_t)",
      "Reve::TrackListEditor", this, "DoRnrMarkers()");  
@@ -134,11 +144,11 @@ TrackListEditor::TrackListEditor(const TGWindow *p,
   // --- Kinematics fitting
 
   fFitDaughters = new TGCheckButton(this, "Fit daughters");
-  AddFrame(fFitDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fFitDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fFitDaughters->Connect("Toggled(Bool_t)","Reve::TrackListEditor", this, "DoFitDaughters()");
 
   fFitDecay = new TGCheckButton(this, "Fit decay");
-  AddFrame(fFitDecay, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fFitDecay, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fFitDecay->Connect("Toggled(Bool_t)","Reve::TrackListEditor", this, "DoFitDecay()");  
 
   // --- Selectors
@@ -168,6 +178,8 @@ void TrackListEditor::SetModel(TObject* obj)
   fMinAng->SetNumber(fTC->GetMinAng());
   fDelta->SetNumber(fTC->GetDelta());
 
+  fWidthCombo->Select(fTC->GetWidth());
+
   fRnrTracks->SetState(fTC->GetRnrTracks() ? kButtonDown : kButtonUp);
   fRnrMarkers->SetState(fTC->GetRnrMarkers() ? kButtonDown : kButtonUp);
 
@@ -212,6 +224,14 @@ void TrackListEditor::DoDelta()
 
 /**************************************************************************/
 
+void TrackListEditor::DoLineWidth(Int_t width)
+{
+  fTC->SetWidth(width);
+  Update();
+}
+
+/**************************************************************************/
+
 void TrackListEditor::DoRnrTracks()
 {
   fTC->SetRnrTracks(fRnrTracks->IsOn());