TBox.h

Go to the documentation of this file.
00001 // @(#)root/graf:$Id: TBox.h 36489 2010-11-03 08:33:25Z brun $
00002 // Author: Rene Brun   12/12/94
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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 #ifndef ROOT_TBox
00013 #define ROOT_TBox
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TBox                                                                 //
00019 //                                                                      //
00020 // Box class.                                                           //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027 #ifndef ROOT_TAttLine
00028 #include "TAttLine.h"
00029 #endif
00030 #ifndef ROOT_TAttFill
00031 #include "TAttFill.h"
00032 #endif
00033 
00034 class TBox : public TObject, public TAttLine, public TAttFill {
00035 
00036 private:
00037    TObject     *fTip;          //!tool tip associated with box
00038 
00039 protected:
00040    Double_t     fX1;           //X of 1st point
00041    Double_t     fY1;           //Y of 1st point
00042    Double_t     fX2;           //X of 2nd point
00043    Double_t     fY2;           //Y of 2nd point
00044    Bool_t       fResizing;     //!True if box is being resized
00045 
00046 public:
00047    //----- Private bits, clients can only test but not change them
00048    enum {
00049       kCannotMove    = BIT(12)  //if set the box cannot be moved/resized
00050    };
00051    TBox();
00052    TBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
00053    TBox(const TBox &box);
00054    TBox& operator=(const TBox&);
00055    virtual ~TBox();
00056    void Copy(TObject &box) const;
00057    virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00058    virtual void  Draw(Option_t *option="");
00059    virtual TBox *DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t  y2);
00060    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
00061    Bool_t        IsBeingResized() const { return fResizing; }
00062    Double_t      GetX1() const { return fX1; }
00063    Double_t      GetX2() const { return fX2; }
00064    Double_t      GetY1() const { return fY1; }
00065    Double_t      GetY2() const { return fY2; }
00066    virtual void  HideToolTip(Int_t event);
00067    virtual Int_t IsInside(Double_t x, Double_t y) const;
00068    virtual void  ls(Option_t *option="") const;
00069    virtual void  Paint(Option_t *option="");
00070    virtual void  PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="");
00071    virtual void  Print(Option_t *option="") const;
00072    virtual void  SavePrimitive(ostream &out, Option_t *option = "");
00073    virtual void  SetX1(Double_t x1) {fX1=x1;}
00074    virtual void  SetX2(Double_t x2) {fX2=x2;}
00075    virtual void  SetY1(Double_t y1) {fY1=y1;}
00076    virtual void  SetY2(Double_t y2) {fY2=y2;}
00077    virtual void  SetToolTipText(const char *text, Long_t delayms = 1000);
00078 
00079    ClassDef(TBox,2)  //Box class
00080 };
00081 
00082 #endif
00083 

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