ROOT logo
// @(#)root/graf:$Id: TText.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Nicolas 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_TText
#define ROOT_TText


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TText                                                                //
//                                                                      //
// Text.                                                                //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TAttText
#include "TAttText.h"
#endif

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif


class TText : public TNamed, public TAttText {

protected:
   Double_t     fX;           // X position of text (left,center,etc..)
   Double_t     fY;           // Y position of text (left,center,etc..)

public:
   // TText status bits
   enum { kTextNDC = BIT(14) };

   TText();
   TText(Double_t x, Double_t y, const char *text);
   TText(const TText &text);
   virtual ~TText();
   void             Copy(TObject &text) const;
   virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
   virtual TText   *DrawText(Double_t x, Double_t y, const char *text);
   virtual TText   *DrawTextNDC(Double_t x, Double_t y, const char *text);
   virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);

   virtual void     GetControlBox(Int_t x, Int_t y, Double_t theta,
                                  Int_t cBoxX[4], Int_t cBoxY[4]);
   Double_t         GetX() const  { return fX; }
   virtual void     GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle = kFALSE);
   virtual void     GetTextAscentDescent(UInt_t &a, UInt_t &d, const char *text) const;
   virtual void     GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const;
   Double_t         GetY() const  { return fY; }

   virtual void     ls(Option_t *option="") const;
   virtual void     Paint(Option_t *option="");
   virtual void     PaintControlBox(Int_t x, Int_t y, Double_t theta);
   virtual void     PaintText(Double_t x, Double_t y, const char *text);
   virtual void     PaintTextNDC(Double_t u, Double_t v, const char *text);
   virtual void     Print(Option_t *option="") const;
   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
   virtual void     SetNDC(Bool_t isNDC=kTRUE);
   virtual void     SetText(Double_t x, Double_t y, const char *text) {fX=x; fY=y; SetTitle(text);} // *MENU* *ARGS={x=>fX,y=>fY,text=>fTitle}
   virtual void     SetX(Double_t x) { fX = x; } // *MENU*
   virtual void     SetY(Double_t y) { fY = y; } // *MENU*

   ClassDef(TText,2)  //Text
};

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