ROOT logo
// @(#)root/graf:$Id: TBox.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Rene Brun   12/12/94

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TBox
#define ROOT_TBox


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TBox                                                                 //
//                                                                      //
// Box class.                                                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif

class TBox : public TObject, public TAttLine, public TAttFill {

private:
   TObject     *fTip;          //!tool tip associated with box

protected:
   Double_t     fX1;           //X of 1st point
   Double_t     fY1;           //Y of 1st point
   Double_t     fX2;           //X of 2nd point
   Double_t     fY2;           //Y of 2nd point
   Bool_t       fResizing;     //!True if box is being resized

public:
   //----- Private bits, clients can only test but not change them
   enum {
      kCannotMove    = BIT(12)  //if set the box cannot be moved/resized
   };
   TBox();
   TBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
   TBox(const TBox &box);
   TBox& operator=(const TBox&);
   virtual ~TBox();
   void Copy(TObject &box) const;
   virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
   virtual void  Draw(Option_t *option="");
   virtual TBox *DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t  y2);
   virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
   Bool_t        IsBeingResized() const { return fResizing; }
   Double_t      GetX1() const { return fX1; }
   Double_t      GetX2() const { return fX2; }
   Double_t      GetY1() const { return fY1; }
   Double_t      GetY2() const { return fY2; }
   virtual void  HideToolTip(Int_t event);
   virtual void  ls(Option_t *option="") const;
   virtual void  Paint(Option_t *option="");
   virtual void  PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="");
   virtual void  Print(Option_t *option="") const;
   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
   virtual void  SetX1(Double_t x1) {fX1=x1;}
   virtual void  SetX2(Double_t x2) {fX2=x2;}
   virtual void  SetY1(Double_t y1) {fY1=y1;}
   virtual void  SetY2(Double_t y2) {fY2=y2;}
   virtual void  SetToolTipText(const char *text, Long_t delayms = 1000);

   ClassDef(TBox,2)  //Box class
};

#endif

 TBox.h:1
 TBox.h:2
 TBox.h:3
 TBox.h:4
 TBox.h:5
 TBox.h:6
 TBox.h:7
 TBox.h:8
 TBox.h:9
 TBox.h:10
 TBox.h:11
 TBox.h:12
 TBox.h:13
 TBox.h:14
 TBox.h:15
 TBox.h:16
 TBox.h:17
 TBox.h:18
 TBox.h:19
 TBox.h:20
 TBox.h:21
 TBox.h:22
 TBox.h:23
 TBox.h:24
 TBox.h:25
 TBox.h:26
 TBox.h:27
 TBox.h:28
 TBox.h:29
 TBox.h:30
 TBox.h:31
 TBox.h:32
 TBox.h:33
 TBox.h:34
 TBox.h:35
 TBox.h:36
 TBox.h:37
 TBox.h:38
 TBox.h:39
 TBox.h:40
 TBox.h:41
 TBox.h:42
 TBox.h:43
 TBox.h:44
 TBox.h:45
 TBox.h:46
 TBox.h:47
 TBox.h:48
 TBox.h:49
 TBox.h:50
 TBox.h:51
 TBox.h:52
 TBox.h:53
 TBox.h:54
 TBox.h:55
 TBox.h:56
 TBox.h:57
 TBox.h:58
 TBox.h:59
 TBox.h:60
 TBox.h:61
 TBox.h:62
 TBox.h:63
 TBox.h:64
 TBox.h:65
 TBox.h:66
 TBox.h:67
 TBox.h:68
 TBox.h:69
 TBox.h:70
 TBox.h:71
 TBox.h:72
 TBox.h:73
 TBox.h:74
 TBox.h:75
 TBox.h:76
 TBox.h:77
 TBox.h:78
 TBox.h:79
 TBox.h:80
 TBox.h:81
 TBox.h:82