TEveStraightLineSetEditor.cxx

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveStraightLineSetEditor.cxx 21310 2007-12-10 19:05:45Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TEveStraightLineSetEditor.h"
00013 #include "TEveStraightLineSet.h"
00014 
00015 #include "TVirtualPad.h"
00016 #include "TColor.h"
00017 
00018 #include "TGLabel.h"
00019 #include "TGButton.h"
00020 #include "TGNumberEntry.h"
00021 #include "TGColorSelect.h"
00022 #include "TGDoubleSlider.h"
00023 
00024 //______________________________________________________________________________
00025 // TEveStraightLineSetEditor
00026 //
00027 // Editor for TEveStraightLineSet class.
00028 
00029 ClassImp(TEveStraightLineSetEditor)
00030 
00031 //______________________________________________________________________________
00032 TEveStraightLineSetEditor::TEveStraightLineSetEditor(const TGWindow *p, Int_t width, Int_t height,
00033                                                      UInt_t options, Pixel_t back) :
00034    TGedFrame(p, width, height, options | kVerticalFrame, back),
00035    fM(0)
00036                                                     // Initialize widget pointers to 0
00037 {
00038    // Constructor.
00039 
00040    MakeTitle("TEveStraightLineSet");
00041 
00042    TGHorizontalFrame* frame = new TGHorizontalFrame(this);
00043 
00044    fRnrMarkers = new TGCheckButton(frame, "RnrMarkers");
00045    frame->AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsLeft, 1, 2, 1, 1));
00046    fRnrMarkers->Connect
00047       ("Toggled(Bool_t)",
00048        "TEveStraightLineSetEditor", this, "DoRnrMarkers()");
00049 
00050    fRnrLines = new TGCheckButton(frame, "RnrLines");
00051    frame->AddFrame(fRnrLines, new TGLayoutHints(kLHintsLeft, 2, 1, 1, 1));
00052    fRnrLines->Connect
00053       ("Toggled(Bool_t)",
00054        "TEveStraightLineSetEditor", this, "DoRnrLines()");
00055 
00056    AddFrame(frame, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
00057 }
00058 
00059 /******************************************************************************/
00060 
00061 //______________________________________________________________________________
00062 void TEveStraightLineSetEditor::SetModel(TObject* obj)
00063 {
00064    // Set model object.
00065 
00066    fM = dynamic_cast<TEveStraightLineSet*>(obj);
00067 
00068    // Set values of widgets
00069    fRnrMarkers->SetState(fM->GetRnrMarkers() ? kButtonDown : kButtonUp);
00070    fRnrLines->SetState(fM->GetRnrLines() ? kButtonDown : kButtonUp);
00071 }
00072 
00073 /******************************************************************************/
00074 
00075 // Implements callback/slot methods
00076 
00077 //______________________________________________________________________________
00078 void TEveStraightLineSetEditor::DoRnrMarkers()
00079 {
00080    // Slot for RnrMarkers.
00081 
00082    fM->SetRnrMarkers(fRnrMarkers->IsOn());
00083    Update();
00084 }
00085 
00086 //______________________________________________________________________________
00087 void TEveStraightLineSetEditor::DoRnrLines()
00088 {
00089    // Slot for RnrLines.
00090 
00091    fM->SetRnrLines(fRnrLines->IsOn());
00092    Update();
00093 }

Generated on Tue Jul 5 14:16:14 2011 for ROOT_528-00b_version by  doxygen 1.5.1